true_automation 0.5.9 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cc9e6c269815476bedfdab280e9bdb3f6b501c35bde134ebd1c1701cf894b5c
|
4
|
+
data.tar.gz: 50fa9493181c181937e7c49fc1c0786b62c62964832257b836e6844b20ee7f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c383abe0231435fdec8372e98cc45b5c8c5b96ec54e673fea2970dfcbc0fec8cc5290d0ed16ade739e8939c12277ce3179b0cb44f2560dd282aecef27c020ad4
|
7
|
+
data.tar.gz: 2d7b326dc4f5d2522d65c4d819d12862e5322a4b3a2f89dd1b7217bd7c5c9e66e94f582e2c6f547128e7998c1782a8d315e7f50b66376f6e680a8b91919a78af
|
@@ -10,6 +10,7 @@ module TrueAutomation
|
|
10
10
|
def start(options)
|
11
11
|
@port = options[:port]
|
12
12
|
remote = options[:remote]
|
13
|
+
recorder = options[:ta_recorder]
|
13
14
|
ta_debug = options[:ta_debug]
|
14
15
|
|
15
16
|
if options[:ta_service]
|
@@ -31,7 +32,7 @@ module TrueAutomation
|
|
31
32
|
Dir.mkdir('log') unless File.exist?('log')
|
32
33
|
logfile = "log/trueautomation-#{Time.now.strftime('%Y%m%dT%H%M%S')}.log"
|
33
34
|
|
34
|
-
@pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}#{driver_path}#{remote}#{ta_debug}")
|
35
|
+
@pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}#{driver_path}#{remote}#{ta_debug}#{recorder}")
|
35
36
|
puts "Started TrueAutomation.IO client with pid #{@pid} listening to port #{@port}"
|
36
37
|
|
37
38
|
@pid
|
@@ -3,13 +3,13 @@ require_relative '../client'
|
|
3
3
|
module TrueAutomation
|
4
4
|
module Driver
|
5
5
|
class AppiumLib < Appium::Core::Driver
|
6
|
-
def initialize(
|
6
|
+
def initialize(**opts)
|
7
7
|
@ta_client = TrueAutomation::Client.new
|
8
8
|
@remote = ''
|
9
|
-
super
|
9
|
+
super(**opts)
|
10
10
|
end
|
11
11
|
|
12
|
-
def start_driver(
|
12
|
+
def start_driver(**opts)
|
13
13
|
@ta_client.start(port: @port,
|
14
14
|
remote: @remote,
|
15
15
|
ta_debug: @ta_debug,
|
@@ -20,7 +20,7 @@ module TrueAutomation
|
|
20
20
|
at_exit do
|
21
21
|
@ta_client.stop
|
22
22
|
end
|
23
|
-
super
|
23
|
+
super(**opts)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -68,6 +68,10 @@ module TrueAutomation
|
|
68
68
|
class Capybara < Capybara::Selenium::Driver
|
69
69
|
def initialize(app, **options)
|
70
70
|
options = fetch_options(options)
|
71
|
+
if options[:browser].to_s != 'remote'
|
72
|
+
default_options = Selenium::WebDriver::Options.send(options[:browser] || :chrome)
|
73
|
+
end
|
74
|
+
options[:capabilities] ||= default_options
|
71
75
|
@port = options.delete(:port) || find_available_port('localhost')
|
72
76
|
@driver = options.delete(:driver)
|
73
77
|
@driver_version = options.delete(:driver_version)
|
@@ -89,19 +93,11 @@ module TrueAutomation
|
|
89
93
|
options ||= {}
|
90
94
|
ta_url = options[:ta_url] || "http://localhost:#{@port}/"
|
91
95
|
|
92
|
-
capabilities = options[:capabilities] ||
|
96
|
+
capabilities = options[:capabilities] || Selenium::WebDriver::Options.chrome
|
93
97
|
|
94
|
-
if options
|
98
|
+
if options && options[:browser] == :remote
|
95
99
|
raise 'Remote driver URL is not specified' unless options[:url]
|
96
|
-
|
97
|
-
input_caps = options[:capabilities]&.as_json || {}
|
98
|
-
browser = opts_browser(options[:capabilities] || Selenium::WebDriver::Chrome::Capabilities.new)
|
99
|
-
browser_class_name = browser.to_s.slice(0,1).capitalize + browser.to_s.slice(1..-1)
|
100
|
-
capabilities = browser.to_s == 'remote' ?
|
101
|
-
Selenium::WebDriver::Remote::Options.new :
|
102
|
-
self.class.class_eval("Selenium::WebDriver::#{browser_class_name}::Options").send(browser)
|
103
|
-
copy_options(capabilities, input_caps)
|
104
|
-
|
100
|
+
capabilities = duplicate_options(capabilities)
|
105
101
|
capabilities.add_preference(:taRemoteUrl, options[:url])
|
106
102
|
@remote = ' --remote'
|
107
103
|
end
|
@@ -118,7 +114,8 @@ module TrueAutomation
|
|
118
114
|
ta_debug: @ta_debug,
|
119
115
|
driver: @driver,
|
120
116
|
ta_service_path: @ta_service&.executable_path,
|
121
|
-
driver_version: @driver_version
|
117
|
+
driver_version: @driver_version,
|
118
|
+
ta_recorder: @ta_recorder)
|
122
119
|
|
123
120
|
@ta_client.wait_until_start
|
124
121
|
|
@@ -150,26 +147,51 @@ module TrueAutomation
|
|
150
147
|
|
151
148
|
private
|
152
149
|
|
150
|
+
def options_class(browser)
|
151
|
+
browser.to_s == 'remote' ?
|
152
|
+
Selenium::WebDriver::Remote::Options :
|
153
|
+
eval("Selenium::WebDriver::#{browser_class_name(browser)}::Options")
|
154
|
+
end
|
155
|
+
|
156
|
+
def browser_class_name(browser)
|
157
|
+
browser.to_s.slice(0,1).capitalize + browser.to_s.slice(1..-1)
|
158
|
+
end
|
159
|
+
|
153
160
|
def opts_browser(opts)
|
154
161
|
opts.class.name.split('::')[2].downcase.to_sym
|
155
162
|
end
|
156
163
|
|
164
|
+
def opts_to_json(opts)
|
165
|
+
opts.is_a?(Selenium::WebDriver::Options) ?
|
166
|
+
opts&.options :
|
167
|
+
opts&.as_json
|
168
|
+
end
|
169
|
+
|
170
|
+
def duplicate_options(original_options)
|
171
|
+
browser = opts_browser(original_options || Selenium::WebDriver::Options.chrome)
|
172
|
+
opts = opts_to_json(original_options) || {}
|
173
|
+
capabilities = options_class(browser).new(**opts)
|
174
|
+
original_options.extensions.each do |ext|
|
175
|
+
capabilities.add_extension(ext)
|
176
|
+
end
|
177
|
+
capabilities
|
178
|
+
end
|
179
|
+
|
157
180
|
def fetch_options(options)
|
158
181
|
if options.key?(:options)
|
159
|
-
|
160
|
-
desCaps = Selenium::WebDriver::Remote::Capabilities.send(browser.downcase)
|
161
|
-
opts = options[:options].as_json
|
162
|
-
copy_options(desCaps, opts)
|
163
|
-
options[:capabilities] = desCaps
|
182
|
+
options[:capabilities] = duplicate_options(options[:options])
|
164
183
|
options.delete(:options)
|
165
184
|
end
|
185
|
+
if options.delete(:ta_recorder)
|
186
|
+
@ta_recorder = ' --ta-recorder'
|
187
|
+
end
|
166
188
|
options
|
167
189
|
end
|
168
190
|
|
169
191
|
def copy_options(caps, opts)
|
170
192
|
# Add options to capabilities mapping if required
|
171
193
|
opts.keys.each do |key|
|
172
|
-
caps.
|
194
|
+
caps.add_option(key, opts[key])
|
173
195
|
end
|
174
196
|
end
|
175
197
|
|
data/true_automation.gemspec
CHANGED
@@ -29,6 +29,6 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
30
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.4'
|
32
|
-
spec.add_development_dependency 'appium_lib', '~>
|
33
|
-
spec.add_development_dependency 'appium_lib_core', '~> 4.
|
32
|
+
spec.add_development_dependency 'appium_lib', '~> 12.2.2'
|
33
|
+
spec.add_development_dependency 'appium_lib_core', '~> 6.4.1'
|
34
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: true_automation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrueAutomation.IO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 12.2.2
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 12.2.2
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: appium_lib_core
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 6.4.1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 6.4.1
|
97
97
|
description: " true_automation gem enables awesome TrueAutomation.IO features for
|
98
98
|
Capybara and Watir projects.\n"
|
99
99
|
email:
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.4.
|
140
|
+
rubygems_version: 3.4.13
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: TrueAutomation.IO
|