true_automation 0.3.16 → 0.3.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/true_automation/client.rb +7 -1
- data/lib/true_automation/driver/capybara.rb +8 -10
- data/lib/true_automation/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44ca6e8ad7d27d427c2eb8f9ab88ec47b45c608b
|
4
|
+
data.tar.gz: 61a40e7da600632b06fdb544f313768760dfd003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de8b7948f32793100823dd8c12170bcf67da2741ba25a64d87edb93426a29c1f766737f5967d2f46b6c89b4690f45acdc33e8a94c009f730258ec18fac59696b
|
7
|
+
data.tar.gz: 36ce4d0a8613fd5743bc25f53ecd73e9db9ee7ff02c6b78ad8501ec90f4d620da2b11f42c7fa339648f2479ea00196e0c998491d80fa72c6e9f09bf35c7cfce5
|
@@ -11,6 +11,12 @@ module TrueAutomation
|
|
11
11
|
|
12
12
|
@port = options[:port] || 9515
|
13
13
|
remote = options[:remote]
|
14
|
+
|
15
|
+
if options[:driver]
|
16
|
+
driver_path = " --driver #{options[:driver]}"
|
17
|
+
driver_path += " --driver-version #{options[:driver_version]}" if options[:driver_version]
|
18
|
+
end
|
19
|
+
|
14
20
|
@executable = ENV['TRUEAUTOMATION_EXEC'] || 'trueautomation'
|
15
21
|
|
16
22
|
if find_executable(@executable).nil?
|
@@ -23,7 +29,7 @@ module TrueAutomation
|
|
23
29
|
Dir.mkdir('log') unless File.exist?('log')
|
24
30
|
logfile = "log/trueautomation-#{Time.now.strftime('%Y%m%dT%H%M%S')}.log"
|
25
31
|
|
26
|
-
@pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}
|
32
|
+
@pid = spawn("#{@executable} --log-file #{logfile} --port #{@port}#{driver_path}#{remote}")
|
27
33
|
puts "Started TrueAutomation.IO client with pid #{@pid} listening to port #{@port}"
|
28
34
|
|
29
35
|
@pid
|
@@ -7,6 +7,8 @@ module TrueAutomation
|
|
7
7
|
class Capybara < Capybara::Selenium::Driver
|
8
8
|
def initialize(app, **options)
|
9
9
|
@port = options.delete(:port) || 9515
|
10
|
+
@driver = options.delete(:driver)
|
11
|
+
@driver_version = options.delete(:driver_version)
|
10
12
|
|
11
13
|
super(app, options)
|
12
14
|
|
@@ -18,11 +20,11 @@ module TrueAutomation
|
|
18
20
|
|
19
21
|
capabilities = options[:desired_capabilities]
|
20
22
|
capabilities ||= {}
|
21
|
-
|
23
|
+
|
22
24
|
if options and options[:browser] == :remote
|
23
25
|
raise 'Remote driver URL is not specified' unless options[:url]
|
24
26
|
capabilities[:taRemoteUrl] = options[:url]
|
25
|
-
@remote = '--remote'
|
27
|
+
@remote = ' --remote'
|
26
28
|
else
|
27
29
|
capabilities[:browser] = options[:browser] || :chrome
|
28
30
|
end
|
@@ -34,7 +36,7 @@ module TrueAutomation
|
|
34
36
|
|
35
37
|
def browser
|
36
38
|
unless @browser
|
37
|
-
@ta_client.start(port: @port, remote: @remote)
|
39
|
+
@ta_client.start(port: @port, remote: @remote, driver: @driver, driver_version: @driver_version)
|
38
40
|
|
39
41
|
@ta_client.wait_until_start
|
40
42
|
|
@@ -49,17 +51,13 @@ module TrueAutomation
|
|
49
51
|
|
50
52
|
def find_css(selector)
|
51
53
|
res = super
|
52
|
-
if
|
53
|
-
check_selector(selector)
|
54
|
-
end
|
54
|
+
check_selector(selector) if !res || res.empty?
|
55
55
|
res
|
56
56
|
end
|
57
57
|
|
58
58
|
def find_xpath(selector)
|
59
59
|
res = super
|
60
|
-
if
|
61
|
-
check_selector(selector)
|
62
|
-
end
|
60
|
+
check_selector(selector) if !res || res.empty?
|
63
61
|
res
|
64
62
|
end
|
65
63
|
|
@@ -69,7 +67,7 @@ module TrueAutomation
|
|
69
67
|
if ta_selector_match = selector.match(/__taonly__(.+)__taonly__/)
|
70
68
|
error_text = "Element '#{ta_selector_match[1]}' was not found in database. " +
|
71
69
|
'Please provide a selector to find and initialize element.'
|
72
|
-
raise TrueAutomation::RecordNotFound
|
70
|
+
raise TrueAutomation::RecordNotFound, error_text
|
73
71
|
end
|
74
72
|
end
|
75
73
|
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.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrueAutomation.IO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.5.2
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: TrueAutomation.IO
|