testa_appium_driver 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/testa_appium_driver/android/locator/attributes.rb +2 -2
- data/lib/testa_appium_driver/android/selenium_element.rb +1 -1
- data/lib/testa_appium_driver/common/locator.rb +11 -6
- data/lib/testa_appium_driver/driver.rb +9 -2
- data/lib/testa_appium_driver/ios/locator/attributes.rb +5 -3
- data/lib/testa_appium_driver/version.rb +1 -1
- data/testa_appium_driver.gemspec +2 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '091ff22c4f74ee0e70238adf6d044b93d7b989954c8080b8d7e289d917fe6986'
|
4
|
+
data.tar.gz: ce33cac99f7631febd8c362e0b74160e29180a4271ab0218c6932757736601e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5981dc66c90872097718763169e90e717edeafaae3f551785be38e01dc0594d81f771269873042ed998ad5733267db6d0ac74749e00287fd275895a7dab84f5
|
7
|
+
data.tar.gz: 62cb8fa7ed7405a8c0a36fbefab4c304520316286428e61ae3380b918ac65e189aa71cb7ab67552a2798b099f75771ecde55f32b1587ee082f33f9a30a3c6bf8
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module TestaAppiumDriver
|
2
|
-
module
|
2
|
+
module Attributes
|
3
3
|
|
4
4
|
#noinspection RubyNilAnalysis
|
5
5
|
def attribute(name, *args)
|
@@ -98,7 +98,7 @@ module TestaAppiumDriver
|
|
98
98
|
end
|
99
99
|
|
100
100
|
class Locator
|
101
|
-
include TestaAppiumDriver::
|
101
|
+
include TestaAppiumDriver::Attributes
|
102
102
|
|
103
103
|
|
104
104
|
# element index in parent element, starts from 0
|
@@ -12,6 +12,8 @@ module TestaAppiumDriver
|
|
12
12
|
attr_accessor :driver
|
13
13
|
attr_accessor :strategy
|
14
14
|
attr_accessor :strategy_reason
|
15
|
+
|
16
|
+
# @type [Boolean] used to determine if last selector was one of siblings or children. Only in those selectors we can reliably use xpath array [instance] selector
|
15
17
|
attr_accessor :last_selector_adjacent
|
16
18
|
attr_accessor :can_use_id_strategy
|
17
19
|
|
@@ -68,7 +70,6 @@ module TestaAppiumDriver
|
|
68
70
|
@strategy = params[:strategy]
|
69
71
|
@strategy_reason = params[:strategy_reason]
|
70
72
|
|
71
|
-
# @type [Boolean] used to determine if last selector was one of siblings or children. Only in those selectors we can reliably use xpath array [instance] selector
|
72
73
|
@last_selector_adjacent = false
|
73
74
|
|
74
75
|
init(params, selectors, single)
|
@@ -96,6 +97,7 @@ module TestaAppiumDriver
|
|
96
97
|
end
|
97
98
|
|
98
99
|
|
100
|
+
|
99
101
|
strategy, selector = strategy_and_selector
|
100
102
|
|
101
103
|
|
@@ -105,10 +107,11 @@ module TestaAppiumDriver
|
|
105
107
|
|
106
108
|
# @param [Integer] timeout in seconds
|
107
109
|
# @return [TestaAppiumDriver::Locator]
|
108
|
-
def wait_until_exists(timeout =
|
110
|
+
def wait_until_exists(timeout = nil)
|
111
|
+
timeout = @driver.get_timeouts["implicit"] / 1000 if timeout.nil?
|
109
112
|
start_time = Time.now.to_f
|
110
113
|
until exists?
|
111
|
-
raise "wait until exists timeout exceeded" if start_time + timeout
|
114
|
+
raise "wait until exists timeout exceeded" if start_time + timeout < Time.now.to_f
|
112
115
|
sleep EXISTS_WAIT
|
113
116
|
end
|
114
117
|
self
|
@@ -117,10 +120,11 @@ module TestaAppiumDriver
|
|
117
120
|
|
118
121
|
# @param [Integer] timeout in seconds
|
119
122
|
# @return [TestaAppiumDriver::Locator]
|
120
|
-
def wait_while_exists(timeout =
|
123
|
+
def wait_while_exists(timeout = nil)
|
124
|
+
timeout = @driver.get_timeouts["implicit"] / 1000 if timeout.nil?
|
121
125
|
start_time = Time.now.to_f
|
122
126
|
while exists?
|
123
|
-
raise "wait until exists timeout exceeded" if start_time + timeout
|
127
|
+
raise "wait until exists timeout exceeded" if start_time + timeout < Time.now.to_f
|
124
128
|
sleep EXISTS_WAIT
|
125
129
|
end
|
126
130
|
self
|
@@ -209,7 +213,8 @@ module TestaAppiumDriver
|
|
209
213
|
uiautomator: defined?(self.ui_selector) ? ui_selector : nil,
|
210
214
|
xpath: @xpath_selector,
|
211
215
|
scrollable: @scrollable_locator.nil? ? nil : @scrollable_locator.to_s,
|
212
|
-
scroll_orientation: @scroll_orientation
|
216
|
+
scroll_orientation: @scroll_orientation,
|
217
|
+
resolved: strategy_and_selector
|
213
218
|
}
|
214
219
|
end
|
215
220
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'em/pure_ruby'
|
3
4
|
require 'appium_lib_core'
|
4
5
|
|
@@ -12,8 +13,14 @@ require_relative 'common/selenium_element'
|
|
12
13
|
module TestaAppiumDriver
|
13
14
|
class Driver
|
14
15
|
include Helpers
|
16
|
+
|
17
|
+
# @return [::Appium::Core::Base::Driver] the ruby_lib_core appium driver
|
15
18
|
attr_accessor :driver
|
19
|
+
|
20
|
+
# @return [String] iOS or Android
|
16
21
|
attr_reader :device
|
22
|
+
|
23
|
+
# @return [String] driver automation name (uiautomator2 or xcuitest)
|
17
24
|
attr_reader :automation_name
|
18
25
|
|
19
26
|
# custom options
|
@@ -142,8 +149,8 @@ module TestaAppiumDriver
|
|
142
149
|
@driver.current_package
|
143
150
|
end
|
144
151
|
|
145
|
-
def window_size
|
146
|
-
@driver.window_size
|
152
|
+
def window_size
|
153
|
+
@driver.window_size
|
147
154
|
end
|
148
155
|
|
149
156
|
def back
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module TestaAppiumDriver
|
2
|
-
|
3
|
-
class Locator
|
4
|
-
|
2
|
+
module Attributes
|
5
3
|
|
6
4
|
#noinspection RubyNilAnalysis
|
7
5
|
def attribute(name, *args)
|
@@ -76,4 +74,8 @@ module TestaAppiumDriver
|
|
76
74
|
alias_method :bounds, :rect
|
77
75
|
alias_method :text, :label
|
78
76
|
end
|
77
|
+
#noinspection RubyYardReturnMatch
|
78
|
+
class Locator
|
79
|
+
include TestaAppiumDriver::Attributes
|
80
|
+
end
|
79
81
|
end
|
data/testa_appium_driver.gemspec
CHANGED
@@ -9,13 +9,14 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["karlo.razumovic@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "Appium made easy"
|
12
|
-
spec.description = "Testa appium driver is a wrapper around ruby_lib_core. It significantly reduces the amount of code
|
12
|
+
spec.description = "Testa appium driver is a wrapper around ruby_lib_core. It leverages all driver features and makes them simple and easy to use, significantly reduces the amount of code needed and enables you to define locators that can be reused"
|
13
13
|
spec.homepage = "https://github.com/Karazum/testa_appium_driver"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.4.0"
|
16
16
|
|
17
17
|
#spec.metadata["allowed_push_host"] = "Set to 'https://mygemserver.com'"
|
18
18
|
|
19
|
+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/testa_appium_driver"
|
19
20
|
spec.metadata["homepage_uri"] = spec.homepage
|
20
21
|
spec.metadata["source_code_uri"] = "https://github.com/Karazum/testa_appium_driver"
|
21
22
|
spec.metadata["changelog_uri"] = "https://github.com/Karazum/testa_appium_driver"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testa_appium_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- karlo.razumovic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appium_lib_core
|
@@ -66,8 +66,9 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '13.0'
|
69
|
-
description: Testa appium driver is a wrapper around ruby_lib_core. It
|
70
|
-
|
69
|
+
description: Testa appium driver is a wrapper around ruby_lib_core. It leverages all
|
70
|
+
driver features and makes them simple and easy to use, significantly reduces the
|
71
|
+
amount of code needed and enables you to define locators that can be reused
|
71
72
|
email:
|
72
73
|
- karlo.razumovic@gmail.com
|
73
74
|
executables: []
|
@@ -123,6 +124,7 @@ homepage: https://github.com/Karazum/testa_appium_driver
|
|
123
124
|
licenses:
|
124
125
|
- MIT
|
125
126
|
metadata:
|
127
|
+
documentation_uri: https://www.rubydoc.info/gems/testa_appium_driver
|
126
128
|
homepage_uri: https://github.com/Karazum/testa_appium_driver
|
127
129
|
source_code_uri: https://github.com/Karazum/testa_appium_driver
|
128
130
|
changelog_uri: https://github.com/Karazum/testa_appium_driver
|