testa_appium_driver 0.1.0 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.idea/deployment.xml +2 -9
- data/.idea/webServers.xml +1 -1
- data/README.md +365 -52
- data/lib/testa_appium_driver/android/class_selectors.rb +50 -0
- data/lib/testa_appium_driver/android/driver.rb +2 -1
- data/lib/testa_appium_driver/android/locator/attributes.rb +4 -4
- data/lib/testa_appium_driver/android/locator.rb +17 -5
- data/lib/testa_appium_driver/android/selenium_element.rb +1 -1
- data/lib/testa_appium_driver/common/constants.rb +2 -0
- data/lib/testa_appium_driver/common/helpers.rb +26 -28
- data/lib/testa_appium_driver/common/locator/scroll_actions.rb +152 -58
- data/lib/testa_appium_driver/common/locator.rb +58 -10
- data/lib/testa_appium_driver/common/scroll_actions/w3c_scroll_actions.rb +12 -4
- data/lib/testa_appium_driver/common/scroll_actions.rb +36 -33
- data/lib/testa_appium_driver/common/selenium_element.rb +19 -0
- data/lib/testa_appium_driver/driver.rb +41 -41
- data/lib/testa_appium_driver/ios/driver.rb +1 -0
- data/lib/testa_appium_driver/ios/locator/attributes.rb +5 -3
- data/lib/testa_appium_driver/ios/locator.rb +17 -4
- data/lib/testa_appium_driver/version.rb +1 -1
- data/testa_appium_driver.gemspec +41 -40
- data/testa_appium_driver.iml +1 -35
- metadata +11 -8
@@ -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
|
@@ -1,13 +1,21 @@
|
|
1
1
|
require_relative 'locator/attributes'
|
2
2
|
|
3
3
|
module TestaAppiumDriver
|
4
|
-
#noinspection RubyTooManyInstanceVariablesInspection
|
5
4
|
class Locator
|
6
5
|
include TypeSelectors
|
7
6
|
|
8
7
|
def init(params, selectors, single)
|
9
8
|
if is_scrollable_selector?(selectors, single)
|
10
9
|
@scroll_orientation = :vertical
|
10
|
+
|
11
|
+
if !params[:top].nil? || !params[:bottom].nil? || !params[:right].nil? || !params[:left].nil?
|
12
|
+
@scroll_deadzone = {}
|
13
|
+
@scroll_deadzone[:top] = params[:top].to_f unless params[:top].nil?
|
14
|
+
@scroll_deadzone[:bottom] = params[:bottom].to_f unless params[:bottom].nil?
|
15
|
+
@scroll_deadzone[:right] = params[:right].to_f unless params[:right].nil?
|
16
|
+
@scroll_deadzone[:left] = params[:left].to_f unless params[:left].nil?
|
17
|
+
end
|
18
|
+
|
11
19
|
params[:scrollable_locator] = self.dup
|
12
20
|
end
|
13
21
|
|
@@ -15,12 +23,17 @@ module TestaAppiumDriver
|
|
15
23
|
end
|
16
24
|
|
17
25
|
|
18
|
-
|
19
|
-
|
26
|
+
# @return [Array] returns 2 elements. The first is the resolved find element strategy and the second is the resolved selector
|
27
|
+
def strategy_and_selector
|
28
|
+
if @can_use_id_strategy
|
29
|
+
return FIND_STRATEGY_NAME, @can_use_id_strategy
|
30
|
+
end
|
31
|
+
[FIND_STRATEGY_XPATH, @xpath_selector]
|
20
32
|
end
|
21
33
|
|
22
34
|
|
23
|
-
|
35
|
+
|
36
|
+
# @return [Locator] new child locator element
|
24
37
|
def add_child_selector(params)
|
25
38
|
params, selectors = extract_selectors_from_params(params)
|
26
39
|
single = params[:single]
|
data/testa_appium_driver.gemspec
CHANGED
@@ -1,40 +1,41 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/testa_appium_driver/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "testa_appium_driver"
|
7
|
-
spec.version = TestaAppiumDriver::VERSION
|
8
|
-
spec.authors = ["karlo.razumovic"]
|
9
|
-
spec.email = ["karlo.razumovic@gmail.com"]
|
10
|
-
|
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
|
13
|
-
spec.homepage = "https://github.com/Karazum/testa_appium_driver"
|
14
|
-
spec.license = "MIT"
|
15
|
-
spec.required_ruby_version = ">= 2.4.0"
|
16
|
-
|
17
|
-
#spec.metadata["allowed_push_host"] = "Set to 'https://mygemserver.com'"
|
18
|
-
|
19
|
-
spec.metadata["
|
20
|
-
spec.metadata["
|
21
|
-
spec.metadata["
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
spec.
|
30
|
-
spec.
|
31
|
-
|
32
|
-
|
33
|
-
spec.add_runtime_dependency "
|
34
|
-
|
35
|
-
|
36
|
-
spec.add_development_dependency "
|
37
|
-
|
38
|
-
|
39
|
-
#
|
40
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/testa_appium_driver/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "testa_appium_driver"
|
7
|
+
spec.version = TestaAppiumDriver::VERSION
|
8
|
+
spec.authors = ["karlo.razumovic"]
|
9
|
+
spec.email = ["karlo.razumovic@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Appium made easy"
|
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
|
+
spec.homepage = "https://github.com/Karazum/testa_appium_driver"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.4.0"
|
16
|
+
|
17
|
+
#spec.metadata["allowed_push_host"] = "Set to 'https://mygemserver.com'"
|
18
|
+
|
19
|
+
spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/testa_appium_driver"
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/Karazum/testa_appium_driver"
|
22
|
+
spec.metadata["changelog_uri"] = "https://github.com/Karazum/testa_appium_driver"
|
23
|
+
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
26
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
27
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_runtime_dependency "appium_lib_core", ["= 4.7.0"]
|
34
|
+
spec.add_runtime_dependency "json", ["~> 2.3"]
|
35
|
+
|
36
|
+
spec.add_development_dependency "rubocop", ["= 1.19.0"]
|
37
|
+
spec.add_development_dependency "rake", ["~> 13.0"]
|
38
|
+
|
39
|
+
# For more information and examples about making a new gem, checkout our
|
40
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
41
|
+
end
|
data/testa_appium_driver.iml
CHANGED
@@ -39,41 +39,7 @@
|
|
39
39
|
</component>
|
40
40
|
<component name="RakeTasksCache">
|
41
41
|
<option name="myRootTask">
|
42
|
-
<RakeTaskImpl id="rake"
|
43
|
-
<subtasks>
|
44
|
-
<RakeTaskImpl description="Build testa_appium_driver-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
|
45
|
-
<RakeTaskImpl id="build">
|
46
|
-
<subtasks>
|
47
|
-
<RakeTaskImpl description="Generate SHA512 checksum if testa_appium_driver-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
48
|
-
</subtasks>
|
49
|
-
</RakeTaskImpl>
|
50
|
-
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
51
|
-
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
52
|
-
<RakeTaskImpl description="Build and install testa_appium_driver-0.1.0.gem into system gems" fullCommand="install" id="install" />
|
53
|
-
<RakeTaskImpl id="install">
|
54
|
-
<subtasks>
|
55
|
-
<RakeTaskImpl description="Build and install testa_appium_driver-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
|
56
|
-
</subtasks>
|
57
|
-
</RakeTaskImpl>
|
58
|
-
<RakeTaskImpl description="Create tag v0.1.0 and build and push testa_appium_driver-0.1.0.gem to rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
59
|
-
<RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
|
60
|
-
<RakeTaskImpl id="rubocop">
|
61
|
-
<subtasks>
|
62
|
-
<RakeTaskImpl description="Auto-correct RuboCop offenses" fullCommand="rubocop:auto_correct" id="auto_correct" />
|
63
|
-
</subtasks>
|
64
|
-
</RakeTaskImpl>
|
65
|
-
<RakeTaskImpl description="Run RSpec code examples" fullCommand="spec" id="spec" />
|
66
|
-
<RakeTaskImpl description="" fullCommand="default" id="default" />
|
67
|
-
<RakeTaskImpl description="" fullCommand="release" id="release" />
|
68
|
-
<RakeTaskImpl id="release">
|
69
|
-
<subtasks>
|
70
|
-
<RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
|
71
|
-
<RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
|
72
|
-
<RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
|
73
|
-
</subtasks>
|
74
|
-
</RakeTaskImpl>
|
75
|
-
</subtasks>
|
76
|
-
</RakeTaskImpl>
|
42
|
+
<RakeTaskImpl id="rake" />
|
77
43
|
</option>
|
78
44
|
</component>
|
79
45
|
</module>
|
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.4
|
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
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: '2.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: '2.3'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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: []
|
@@ -109,6 +110,7 @@ files:
|
|
109
110
|
- lib/testa_appium_driver/common/scroll_actions.rb
|
110
111
|
- lib/testa_appium_driver/common/scroll_actions/json_wire_scroll_actions.rb
|
111
112
|
- lib/testa_appium_driver/common/scroll_actions/w3c_scroll_actions.rb
|
113
|
+
- lib/testa_appium_driver/common/selenium_element.rb
|
112
114
|
- lib/testa_appium_driver/driver.rb
|
113
115
|
- lib/testa_appium_driver/ios/driver.rb
|
114
116
|
- lib/testa_appium_driver/ios/locator.rb
|
@@ -122,6 +124,7 @@ homepage: https://github.com/Karazum/testa_appium_driver
|
|
122
124
|
licenses:
|
123
125
|
- MIT
|
124
126
|
metadata:
|
127
|
+
documentation_uri: https://www.rubydoc.info/gems/testa_appium_driver
|
125
128
|
homepage_uri: https://github.com/Karazum/testa_appium_driver
|
126
129
|
source_code_uri: https://github.com/Karazum/testa_appium_driver
|
127
130
|
changelog_uri: https://github.com/Karazum/testa_appium_driver
|