true_automation 0.3.18 → 0.3.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/true_automation/driver/capybara.rb +20 -25
- data/lib/true_automation/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 934dd5a759321e68a750b1ae5481c984d3bba96415a0b8512d0c562f4570d352
|
4
|
+
data.tar.gz: f2f0a01a262cd0203280060e4a71e5c23935fbe500dd798b1994ae5d0c2f1622
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f2ea276c77f1697e1f92eea037608b98d56d8bb5fbe667055696845f28e888ef694afb26daba0ab72bd58720bdbaa60e31258d95f3658bf1588fa9c711ad6f
|
7
|
+
data.tar.gz: 782c86425c2415f177a37d311d564fc9e396a2253e967b059d03f76e5aec10b30ed80acc0a079237322d2f303933d416a6a9fd74be7b7c7c485130789ec14c78
|
@@ -1,4 +1,19 @@
|
|
1
1
|
require_relative '../client'
|
2
|
+
module Capybara
|
3
|
+
module Queries
|
4
|
+
class SelectorQuery
|
5
|
+
alias_method :original_description, :description
|
6
|
+
def description(only_applied = false)
|
7
|
+
desc = original_description
|
8
|
+
matched_result = desc.match(/.*__taonly__(.+)__taonly__.*/)
|
9
|
+
if selector = matched_result && matched_result[1]
|
10
|
+
desc = "TrueAutomation element #{selector} on the page"
|
11
|
+
end
|
12
|
+
desc
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
2
17
|
|
3
18
|
module TrueAutomation
|
4
19
|
class RecordNotFound < StandardError; end
|
@@ -18,8 +33,7 @@ module TrueAutomation
|
|
18
33
|
options ||= {}
|
19
34
|
ta_url = options[:ta_url] || "http://localhost:#{@port}/"
|
20
35
|
|
21
|
-
capabilities = options[:desired_capabilities]
|
22
|
-
capabilities ||= {}
|
36
|
+
capabilities = options[:desired_capabilities] || {}
|
23
37
|
|
24
38
|
if options and options[:browser] == :remote
|
25
39
|
raise 'Remote driver URL is not specified' unless options[:url]
|
@@ -36,7 +50,10 @@ module TrueAutomation
|
|
36
50
|
|
37
51
|
def browser
|
38
52
|
unless @browser
|
39
|
-
@ta_client.start(port: @port,
|
53
|
+
@ta_client.start(port: @port,
|
54
|
+
remote: @remote,
|
55
|
+
driver: @driver,
|
56
|
+
driver_version: @driver_version)
|
40
57
|
|
41
58
|
@ta_client.wait_until_start
|
42
59
|
|
@@ -48,28 +65,6 @@ module TrueAutomation
|
|
48
65
|
end
|
49
66
|
@browser
|
50
67
|
end
|
51
|
-
|
52
|
-
def find_css(selector)
|
53
|
-
res = super
|
54
|
-
check_selector(selector) if !res || res.empty?
|
55
|
-
res
|
56
|
-
end
|
57
|
-
|
58
|
-
def find_xpath(selector)
|
59
|
-
res = super
|
60
|
-
check_selector(selector) if !res || res.empty?
|
61
|
-
res
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
def check_selector(selector)
|
67
|
-
if ta_selector_match = selector.match(/__taonly__(.+)__taonly__/)
|
68
|
-
error_text = "Element '#{ta_selector_match[1]}' was not found in database. " +
|
69
|
-
'Please provide a selector to find and initialize element.'
|
70
|
-
raise TrueAutomation::RecordNotFound, error_text
|
71
|
-
end
|
72
|
-
end
|
73
68
|
end
|
74
69
|
end
|
75
70
|
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.22
|
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-11-22 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.7.7
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: TrueAutomation.IO
|