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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 53b4ee10d5b145283abf6bfc60c4ef0fb16b5dda76ec730a6727c63f6116906a
4
- data.tar.gz: bd2ec80cf30c27b8c0012987b9e1189c5527ca5b8ae0fb66fe022475e863cf5c
3
+ metadata.gz: '091ff22c4f74ee0e70238adf6d044b93d7b989954c8080b8d7e289d917fe6986'
4
+ data.tar.gz: ce33cac99f7631febd8c362e0b74160e29180a4271ab0218c6932757736601e8
5
5
  SHA512:
6
- metadata.gz: 35e0c6d1fca40a3e497d7bf5cf6b1f1af289de54ade56212495fde80ca1bdce8aae547a1af9b794e9ada3c0054b9e236828e5751c458c2d6c6899bb21c3a61f7
7
- data.tar.gz: 353ccba018403b376caf6a1f1d33c9bb90baab3375b6b4374f284d31292eca04a1c7f9f6fcf7c6f3431f7faa636046f9a065a07df58a0be3c14f26f32110e0a1
6
+ metadata.gz: b5981dc66c90872097718763169e90e717edeafaae3f551785be38e01dc0594d81f771269873042ed998ad5733267db6d0ac74749e00287fd275895a7dab84f5
7
+ data.tar.gz: 62cb8fa7ed7405a8c0a36fbefab4c304520316286428e61ae3380b918ac65e189aa71cb7ab67552a2798b099f75771ecde55f32b1587ee082f33f9a30a3c6bf8
@@ -1,5 +1,5 @@
1
1
  module TestaAppiumDriver
2
- module AndroidAttributeModule
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::AndroidAttributeModule
101
+ include TestaAppiumDriver::Attributes
102
102
 
103
103
 
104
104
  # element index in parent element, starts from 0
@@ -2,7 +2,7 @@ module Selenium
2
2
  module WebDriver
3
3
  class Element
4
4
  include TestaAppiumDriver::ClassSelectors
5
- include TestaAppiumDriver::AndroidAttributeModule
5
+ include TestaAppiumDriver::Attributes
6
6
  end
7
7
  end
8
8
  end
@@ -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 = @driver.get_timeouts["implicit"] / 1000)
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 > Time.now.to_f
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 = @driver.get_timeouts["implicit"] / 1000)
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 > Time.now.to_f
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(*args)
146
- @driver.window_size(*args)
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
- #noinspection RubyYardReturnMatch
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TestaAppiumDriver
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -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 need to achieve your goals."
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.2
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-19 00:00:00.000000000 Z
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 significantly
70
- reduces the amount of code need to achieve your goals.
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