true_automation 0.3.13 → 0.3.14
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 +29 -1
- 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: f74933439507bf53b0b63ffc2f61c9fb1dbd459772bbbe50c7af5929f5f96c99
|
4
|
+
data.tar.gz: 3fcf260be97dc3bf8f98ac2f2c0b67620d29d8589553759dfef406e8a22382f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ace762129d35a4f9eb21229c1af9b0e9bac2826335148ba4a74c9f52dcfd92e4b1da7ec9cf9e1e41291e85102cbc916bce1eff838b71b4c0d10d7c312a9ff46
|
7
|
+
data.tar.gz: 342f0dba3fd190c5403749cc6113cf77b73cf2d7d6d5e55e63b5cabf93c8d17831bf632dc9dc7fb93c4781b6b288865a12e02fd186556eea0d7cc5be0bcd9e18
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require_relative '../client'
|
2
2
|
|
3
3
|
module TrueAutomation
|
4
|
+
class RecordNotFound < StandardError; end
|
5
|
+
|
4
6
|
module Driver
|
5
7
|
class Capybara < Capybara::Selenium::Driver
|
6
8
|
def initialize(app, **options)
|
@@ -42,6 +44,32 @@ module TrueAutomation
|
|
42
44
|
end
|
43
45
|
@browser
|
44
46
|
end
|
47
|
+
|
48
|
+
def find_css(selector)
|
49
|
+
res = super
|
50
|
+
if (!res || res.empty?)
|
51
|
+
check_selector(selector)
|
52
|
+
end
|
53
|
+
res
|
54
|
+
end
|
55
|
+
|
56
|
+
def find_xpath(selector)
|
57
|
+
res = super
|
58
|
+
if (!res || res.empty?)
|
59
|
+
check_selector(selector)
|
60
|
+
end
|
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.new(error_text)
|
71
|
+
end
|
72
|
+
end
|
45
73
|
end
|
46
74
|
end
|
47
|
-
end
|
75
|
+
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.14
|
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-05-
|
11
|
+
date: 2018-05-31 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.3
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: TrueAutomation.IO
|