watigiri 0.6.3 → 0.7.0
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 +4 -4
- data/.rubocop.yml +16 -19
- data/Gemfile +2 -0
- data/README.md +8 -5
- data/lib/extensions/watir/browser.rb +0 -10
- data/lib/extensions/watir/element.rb +2 -4
- data/lib/watigiri.rb +13 -2
- data/lib/watigiri/locators/element/locator.rb +58 -152
- data/lib/watigiri/locators/element/matcher.rb +48 -0
- data/watigiri.gemspec +5 -5
- metadata +17 -24
- data/lib/extensions/watir/iframe.rb +0 -21
- data/lib/watigiri/locators/element/selector_builder.rb +0 -46
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: da263e5f7d120b61e288323b90693c26727443db
|
|
4
|
+
data.tar.gz: 269323c23f8984029d65ab06111ca5ad229592cf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f556b15ed2568fc2522ae72d0cbf661d3c72968675a1ac74709c234a74dcea78d53e95798c0c624aa4cacd1a5e428365f46aa2fd31318307689387e836089889
|
|
7
|
+
data.tar.gz: 4841c01d4994f8b1994ce634d6162b6341cb77dc69126aa9589aa267e3ad575568c29ded15732a9308c77cbb1f75badbddc87b4122b0bf2c2b3d22527d20734b
|
data/.rubocop.yml
CHANGED
|
@@ -1,39 +1,36 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
-
TargetRubyVersion: 2.3.
|
|
2
|
+
TargetRubyVersion: 2.3.8
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# Default Preferences
|
|
6
|
+
#
|
|
3
7
|
|
|
4
|
-
# Cop supports --auto-correct.
|
|
5
|
-
# Configuration parameters: EnforcedStyle.
|
|
6
|
-
# SupportedStyles: when_needed, always, never
|
|
7
8
|
Style/FrozenStringLiteralComment:
|
|
8
9
|
Enabled: false
|
|
9
10
|
|
|
10
|
-
# Cop supports --auto-correct.
|
|
11
|
-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
|
12
|
-
# SupportedStyles: space, no_space, compact
|
|
13
|
-
# SupportedStylesForEmptyBraces: space, no_space
|
|
14
11
|
Layout/SpaceInsideHashLiteralBraces:
|
|
15
12
|
EnforcedStyle: no_space
|
|
16
13
|
|
|
17
14
|
Style/CommentedKeyword:
|
|
18
15
|
Enabled: false
|
|
19
16
|
|
|
20
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
|
21
|
-
# URISchemes: http, https
|
|
22
17
|
Metrics/LineLength:
|
|
23
18
|
Max: 120
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
Style/Documentation:
|
|
21
|
+
Enabled: false
|
|
22
|
+
|
|
27
23
|
Metrics/BlockLength:
|
|
28
24
|
Exclude:
|
|
29
25
|
- 'spec/**/*'
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
#
|
|
28
|
+
# Adjustable Parameters
|
|
29
|
+
#
|
|
33
30
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
Metrics/AbcSize:
|
|
32
|
+
Exclude:
|
|
33
|
+
- 'spec/locator_spec_helper.rb'
|
|
37
34
|
|
|
38
|
-
Metrics/
|
|
39
|
-
Max:
|
|
35
|
+
Metrics/MethodLength:
|
|
36
|
+
Max: 11
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Watigiri
|
|
2
2
|
|
|
3
|
-
Watigiri is an
|
|
3
|
+
Watigiri is an extension gem to Watir that attempts to make it seamless for actions to be taken using Nokogiri
|
|
4
4
|
instead of Selenium in the places it makes sense to do so.
|
|
5
5
|
|
|
6
6
|
The advantage of Nokogiri is that it parses the DOM very quickly. This provides two primary opportunities for speeding
|
|
@@ -11,8 +11,8 @@ The advantage of Nokogiri is that it parses the DOM very quickly. This provides
|
|
|
11
11
|
dozen wire calls to locate and obtain text information from each, you can make one wire call to obtain the DOM and then
|
|
12
12
|
quickly locate and obtain all of the information necessary at each element location.
|
|
13
13
|
|
|
14
|
-
2. Iterating over a collection of elements
|
|
15
|
-
|
|
14
|
+
2. Iterating over a collection of elements to match a regular expression.
|
|
15
|
+
Watir implements this by locating a subset of elements that might match and then making wire calls
|
|
16
16
|
on each to check if they actually match the provided regular expression.
|
|
17
17
|
If the number of elements to be checked is large, using Nokogiri can show a significant performance improvement.
|
|
18
18
|
|
|
@@ -40,10 +40,13 @@ require 'watigiri'
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Once required, Watigiri will automatically speed up the location of elements using regular expression values.
|
|
43
|
+
If you would like to turn this feature off, you can set: `Watigiri.match_regexp = false`
|
|
43
44
|
|
|
44
45
|
To speed up the gathering of text values, use the text-bang method (`Element#text!` instead of `Element#text`).
|
|
45
|
-
Watigiri flushes the cached DOM whenever a user takes an action that might have changed the DOM
|
|
46
|
-
|
|
46
|
+
Watigiri flushes the cached DOM whenever a user takes an action that might have changed the DOM
|
|
47
|
+
(clicks, navigations, etc).
|
|
48
|
+
So the performance improvement will be based on the number of successive calls of `#text!`
|
|
49
|
+
before taking other actions.
|
|
47
50
|
|
|
48
51
|
## Contributing
|
|
49
52
|
|
|
@@ -19,16 +19,6 @@ module Watir
|
|
|
19
19
|
after_hooks.delete(@reset_doc_hook)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
# Uses Nokogiri to return the text of page body.
|
|
24
|
-
#
|
|
25
|
-
# @return [String]
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
def text!
|
|
29
|
-
body.text!
|
|
30
|
-
end
|
|
31
|
-
|
|
32
22
|
def locator_namespace
|
|
33
23
|
@locator_namespace ||= Watigiri::Locators
|
|
34
24
|
end
|
|
@@ -10,7 +10,7 @@ module Watir
|
|
|
10
10
|
@doc = html
|
|
11
11
|
return if html.nil?
|
|
12
12
|
|
|
13
|
-
@reset_doc_hook = ->(
|
|
13
|
+
@reset_doc_hook = ->(*) { reset_doc }
|
|
14
14
|
browser.after_hooks.add(@reset_doc_hook)
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -19,8 +19,6 @@ module Watir
|
|
|
19
19
|
browser.after_hooks.delete(@reset_doc_hook)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
#
|
|
23
|
-
# TODO - reimplement with Watir Executor when available
|
|
24
22
|
#
|
|
25
23
|
# Uses Nokogiri to return the text of the element.
|
|
26
24
|
#
|
|
@@ -28,7 +26,7 @@ module Watir
|
|
|
28
26
|
#
|
|
29
27
|
|
|
30
28
|
def text!
|
|
31
|
-
|
|
29
|
+
selector_builder.built[:nokogiri] = true
|
|
32
30
|
text.strip
|
|
33
31
|
end
|
|
34
32
|
|
data/lib/watigiri.rb
CHANGED
|
@@ -3,7 +3,18 @@ require 'nokogiri'
|
|
|
3
3
|
|
|
4
4
|
require 'extensions/watir/browser'
|
|
5
5
|
require 'extensions/watir/element'
|
|
6
|
-
require 'extensions/watir/iframe'
|
|
7
6
|
|
|
8
7
|
require 'watigiri/locators/element/locator'
|
|
9
|
-
require 'watigiri/locators/element/
|
|
8
|
+
require 'watigiri/locators/element/matcher'
|
|
9
|
+
|
|
10
|
+
module Watigiri
|
|
11
|
+
@match_regexp = true
|
|
12
|
+
|
|
13
|
+
class << self
|
|
14
|
+
attr_writer :match_regexp
|
|
15
|
+
|
|
16
|
+
def match_regexp?
|
|
17
|
+
@match_regexp
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -1,192 +1,98 @@
|
|
|
1
1
|
module Watigiri
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@element = element
|
|
7
|
-
@selector = selector
|
|
8
|
-
end
|
|
2
|
+
module Locators
|
|
3
|
+
class Element
|
|
4
|
+
class Locator < Watir::Locators::Element::Locator
|
|
5
|
+
private
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
end
|
|
13
|
-
end
|
|
7
|
+
def matching_elements
|
|
8
|
+
return super unless use_nokogiri?
|
|
14
9
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@nokogiri = @selector.delete(:nokogiri)
|
|
19
|
-
return super unless @nokogiri || regex?
|
|
20
|
-
|
|
21
|
-
set_nokogiri
|
|
22
|
-
|
|
23
|
-
element = using_watir(:first)
|
|
24
|
-
return if element.nil?
|
|
25
|
-
@nokogiri ? element.element : nokogiri_to_selenium(element)
|
|
26
|
-
rescue Selenium::WebDriver::Error::NoSuchElementError, Selenium::WebDriver::Error::StaleElementReferenceError
|
|
27
|
-
nil
|
|
28
|
-
end
|
|
10
|
+
# Element should be using `#fragment` instead of `#inner_html`, but can't because of
|
|
11
|
+
# https://github.com/sparklemotion/nokogiri/issues/572
|
|
12
|
+
command = locator_scope.is_a?(Watir::Browser) ? :html : :inner_html
|
|
29
13
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return super unless @nokogiri || regex?
|
|
14
|
+
args = wd_locator.to_a.flatten
|
|
15
|
+
args[0] = "at_#{args[0]}" unless match_regexp?
|
|
33
16
|
|
|
34
|
-
|
|
17
|
+
result = populate_doc command, *args
|
|
18
|
+
match_regexp? ? filter_elements(result) : result
|
|
19
|
+
end
|
|
35
20
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
def filter_elements(elements)
|
|
22
|
+
element_matcher.nokogiri = true
|
|
23
|
+
found = [element_matcher.match(elements, match_values, @filter)].flatten.compact
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
25
|
+
se_elements = nokogiri_to_selenium(elements, found)
|
|
26
|
+
@filter == :first ? se_elements.first : se_elements
|
|
27
|
+
end
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
end
|
|
29
|
+
def use_nokogiri?
|
|
30
|
+
@nokogiri = @built.delete(:nokogiri)
|
|
47
31
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return super unless @nokogiri || regex?
|
|
32
|
+
# Neither CSS nor XPath locator found
|
|
33
|
+
return false if wd_locator.empty? || @selector.key?(:adjacent)
|
|
51
34
|
|
|
52
|
-
|
|
53
|
-
Watigiri::Element.new element: el, selector: {how => what}
|
|
35
|
+
@nokogiri && match_values.empty? || match_regexp?
|
|
54
36
|
end
|
|
55
|
-
end
|
|
56
37
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
case how
|
|
62
|
-
when :text
|
|
63
|
-
noko_element.inner_text
|
|
64
|
-
when :tag_name
|
|
65
|
-
noko_element.name.downcase
|
|
66
|
-
else
|
|
67
|
-
noko_element.attribute(how.to_s.tr('_', '-')).to_s.strip
|
|
38
|
+
def populate_doc(command, key, value)
|
|
39
|
+
@query_scope.doc ||= Nokogiri::HTML(locator_scope.send(command)).tap { |d| d.css('script').remove }
|
|
40
|
+
@query_scope.doc.send(key, value)
|
|
68
41
|
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def nokogiri_to_selenium(element)
|
|
72
|
-
return element if element.is_a?(Selenium::WebDriver::Element)
|
|
73
|
-
tag = element.tag_name
|
|
74
|
-
index = @query_scope.doc.xpath(".//#{tag}").find_index { |el| el == element.element }
|
|
75
|
-
Watir::Element.new(@query_scope, index: index, tag_name: tag).wd
|
|
76
|
-
end
|
|
77
42
|
|
|
78
|
-
|
|
79
|
-
|
|
43
|
+
def wd_locator
|
|
44
|
+
@wd_locator ||= @built.select { |k, _v| %i[css xpath].include?(k) }
|
|
45
|
+
end
|
|
80
46
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
47
|
+
def match_regexp?
|
|
48
|
+
@match_regexp ||= Watigiri.match_regexp? && match_values.all? do |k, v|
|
|
49
|
+
v.is_a?(Regexp) && !k.to_s.include?('visible') && !k.to_s.include?('label')
|
|
50
|
+
end &&
|
|
51
|
+
!match_values.empty?
|
|
52
|
+
end
|
|
84
53
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
element.element
|
|
90
|
-
else
|
|
91
|
-
element
|
|
54
|
+
def nokogiri_to_selenium(elements, found)
|
|
55
|
+
locator_scope.elements(wd_locator).map.each_with_index do |el, idx|
|
|
56
|
+
el.wd if found&.include? elements[idx]
|
|
57
|
+
end.compact
|
|
92
58
|
end
|
|
93
59
|
end
|
|
60
|
+
end
|
|
94
61
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
# https://github.com/sparklemotion/nokogiri/issues/572
|
|
100
|
-
doc = if @query_scope.is_a?(Watir::Browser)
|
|
101
|
-
Nokogiri::HTML(@query_scope.html)
|
|
102
|
-
else
|
|
103
|
-
Nokogiri::HTML(@query_scope.inner_html)
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
@query_scope.doc = doc.tap { |d| d.css('script').remove }
|
|
107
|
-
end
|
|
62
|
+
class TextField
|
|
63
|
+
class Locator < Element::Locator
|
|
64
|
+
def use_nokogiri?
|
|
65
|
+
return false if @built.key?(:text)
|
|
108
66
|
|
|
109
|
-
|
|
110
|
-
|
|
67
|
+
super
|
|
68
|
+
end
|
|
111
69
|
end
|
|
112
70
|
end
|
|
113
71
|
|
|
114
|
-
class
|
|
115
|
-
class Locator <
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
end
|
|
72
|
+
class TextArea
|
|
73
|
+
class Locator < Element::Locator
|
|
74
|
+
def use_nokogiri?
|
|
75
|
+
return false if @built.key?(:value)
|
|
119
76
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
include LocatorHelpers
|
|
77
|
+
super
|
|
78
|
+
end
|
|
123
79
|
end
|
|
124
80
|
end
|
|
125
81
|
|
|
126
82
|
class Cell
|
|
127
|
-
class Locator <
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
# Don't use for rows
|
|
131
|
-
def regex?
|
|
83
|
+
class Locator < Element::Locator
|
|
84
|
+
def use_nokogiri?
|
|
132
85
|
false
|
|
133
86
|
end
|
|
134
87
|
end
|
|
135
88
|
end
|
|
136
89
|
|
|
137
90
|
class Row
|
|
138
|
-
class Locator <
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
# Don't use for rows
|
|
142
|
-
def regex?
|
|
91
|
+
class Locator < Element::Locator
|
|
92
|
+
def use_nokogiri?
|
|
143
93
|
false
|
|
144
94
|
end
|
|
145
95
|
end
|
|
146
96
|
end
|
|
147
|
-
|
|
148
|
-
class TextArea
|
|
149
|
-
class Locator < Watir::Locators::Element::Locator
|
|
150
|
-
include LocatorHelpers
|
|
151
|
-
|
|
152
|
-
def regex?
|
|
153
|
-
return @regex unless @regex.nil?
|
|
154
|
-
|
|
155
|
-
return false unless (@selector.keys & %i[adjacent visible label text visible_text visible_label]).empty?
|
|
156
|
-
@regex = @selector.any? { |k, v| v.is_a?(Regexp) && k != :value }
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
|
|
161
|
-
class TextField
|
|
162
|
-
class Locator < Watir::Locators::TextField::Locator
|
|
163
|
-
include LocatorHelpers
|
|
164
|
-
|
|
165
|
-
def matches_selector?(element, rx_selector)
|
|
166
|
-
return super if element.is_a? Selenium::WebDriver::Element
|
|
167
|
-
rx_selector = rx_selector.dup
|
|
168
|
-
|
|
169
|
-
tag_name = element.tag_name
|
|
170
|
-
|
|
171
|
-
%i[text value label].each do |key|
|
|
172
|
-
next unless rx_selector.key?(key)
|
|
173
|
-
correct_key = tag_name == 'input' ? :value : :text
|
|
174
|
-
rx_selector[correct_key] = rx_selector.delete(key)
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
rx_selector.all? do |how, what|
|
|
178
|
-
val = fetch_value(element, how)
|
|
179
|
-
what == val || val =~ /#{what}/
|
|
180
|
-
end
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
def regex?
|
|
184
|
-
return @regex unless @regex.nil?
|
|
185
|
-
|
|
186
|
-
return false unless (@selector.keys & %i[adjacent visible label text visible_text visible_label]).empty?
|
|
187
|
-
@regex = @selector.any? { |k, v| v.is_a?(Regexp) && k != :value }
|
|
188
|
-
end
|
|
189
|
-
end
|
|
190
|
-
end
|
|
191
97
|
end
|
|
192
98
|
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
module Watigiri
|
|
2
|
+
module Locators
|
|
3
|
+
module MatcherHelpers
|
|
4
|
+
attr_accessor :nokogiri
|
|
5
|
+
|
|
6
|
+
def matching_labels(elements, *)
|
|
7
|
+
nokogiri ? elements : super
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def fetch_value(element, how)
|
|
11
|
+
return super unless nokogiri
|
|
12
|
+
|
|
13
|
+
case how
|
|
14
|
+
when :text
|
|
15
|
+
element.inner_text
|
|
16
|
+
when :href
|
|
17
|
+
element.attribute('href')&.to_s&.strip
|
|
18
|
+
when :tag_name
|
|
19
|
+
element.name.downcase
|
|
20
|
+
else
|
|
21
|
+
super.to_s
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def deprecate_text_regexp(*)
|
|
26
|
+
# not applicable to Watigiri
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
class Button
|
|
31
|
+
class Matcher < Watir::Locators::Button::Matcher
|
|
32
|
+
include MatcherHelpers
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class Element
|
|
37
|
+
class Matcher < Watir::Locators::Element::Matcher
|
|
38
|
+
include MatcherHelpers
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class TextField
|
|
43
|
+
class Matcher < Watir::Locators::TextField::Matcher
|
|
44
|
+
include MatcherHelpers
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
data/watigiri.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
5
5
|
spec.name = 'watigiri'
|
|
6
|
-
spec.version = '0.
|
|
6
|
+
spec.version = '0.7.0'
|
|
7
7
|
spec.authors = ['Titus Fortner']
|
|
8
8
|
spec.email = ['titusfortner@gmail.com']
|
|
9
9
|
|
|
@@ -22,12 +22,12 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_development_dependency 'bundler'
|
|
26
|
-
spec.add_development_dependency 'rake'
|
|
27
|
-
spec.add_development_dependency 'rspec'
|
|
25
|
+
spec.add_development_dependency 'bundler'
|
|
26
|
+
spec.add_development_dependency 'rake'
|
|
27
|
+
spec.add_development_dependency 'rspec'
|
|
28
28
|
spec.add_development_dependency 'rubocop'
|
|
29
29
|
spec.add_development_dependency 'webdrivers', '~> 3.3', '>= 3.3.3'
|
|
30
30
|
|
|
31
31
|
spec.add_runtime_dependency 'nokogiri'
|
|
32
|
-
spec.add_runtime_dependency 'watir', '~> 6.
|
|
32
|
+
spec.add_runtime_dependency 'watir', '~> 6.16.4'
|
|
33
33
|
end
|
metadata
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: watigiri
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Titus Fortner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-12-
|
|
11
|
+
date: 2018-12-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '0'
|
|
20
20
|
type: :development
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '0'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: rake
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '0'
|
|
34
34
|
type: :development
|
|
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: '
|
|
40
|
+
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - "
|
|
45
|
+
- - ">="
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
47
|
+
version: '0'
|
|
48
48
|
type: :development
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - "
|
|
52
|
+
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
54
|
+
version: '0'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rubocop
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -106,20 +106,14 @@ dependencies:
|
|
|
106
106
|
requirements:
|
|
107
107
|
- - "~>"
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version:
|
|
110
|
-
- - "<"
|
|
111
|
-
- !ruby/object:Gem::Version
|
|
112
|
-
version: '6.16'
|
|
109
|
+
version: 6.16.4
|
|
113
110
|
type: :runtime
|
|
114
111
|
prerelease: false
|
|
115
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
116
113
|
requirements:
|
|
117
114
|
- - "~>"
|
|
118
115
|
- !ruby/object:Gem::Version
|
|
119
|
-
version:
|
|
120
|
-
- - "<"
|
|
121
|
-
- !ruby/object:Gem::Version
|
|
122
|
-
version: '6.16'
|
|
116
|
+
version: 6.16.4
|
|
123
117
|
description: |
|
|
124
118
|
By default Watir locates elements with Selenium; this gem will replace Selenium calls
|
|
125
119
|
with Nokogiri calls where designated.
|
|
@@ -139,10 +133,9 @@ files:
|
|
|
139
133
|
- Rakefile
|
|
140
134
|
- lib/extensions/watir/browser.rb
|
|
141
135
|
- lib/extensions/watir/element.rb
|
|
142
|
-
- lib/extensions/watir/iframe.rb
|
|
143
136
|
- lib/watigiri.rb
|
|
144
137
|
- lib/watigiri/locators/element/locator.rb
|
|
145
|
-
- lib/watigiri/locators/element/
|
|
138
|
+
- lib/watigiri/locators/element/matcher.rb
|
|
146
139
|
- support/travis.sh
|
|
147
140
|
- watigiri.gemspec
|
|
148
141
|
homepage: http://github.com/titusfortner/watigiri
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module Watir
|
|
2
|
-
class IFrame < HTMLElement
|
|
3
|
-
#
|
|
4
|
-
# Uses Nokogiri to return the text of iframe body.
|
|
5
|
-
#
|
|
6
|
-
# @return [String]
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
def text!
|
|
10
|
-
body.text!
|
|
11
|
-
end
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
class FramedDriver
|
|
15
|
-
alias watir_switch! switch!
|
|
16
|
-
def switch!
|
|
17
|
-
@browser.doc = nil
|
|
18
|
-
watir_switch!
|
|
19
|
-
end
|
|
20
|
-
end # FramedDriver
|
|
21
|
-
end # Watir
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
module Watigiri
|
|
2
|
-
module Locators
|
|
3
|
-
module SelectorHelpers
|
|
4
|
-
def normalized_selector
|
|
5
|
-
@selector.delete(:nokogiri)
|
|
6
|
-
super
|
|
7
|
-
end
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
class Element
|
|
11
|
-
class SelectorBuilder < Watir::Locators::Element::SelectorBuilder
|
|
12
|
-
include SelectorHelpers
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
class Button
|
|
17
|
-
class SelectorBuilder < Watir::Locators::Button::SelectorBuilder
|
|
18
|
-
include SelectorHelpers
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
class Cell
|
|
23
|
-
class SelectorBuilder < Watir::Locators::Cell::SelectorBuilder
|
|
24
|
-
include SelectorHelpers
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
class Row
|
|
29
|
-
class SelectorBuilder < Watir::Locators::Row::SelectorBuilder
|
|
30
|
-
include SelectorHelpers
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
class TextArea
|
|
35
|
-
class SelectorBuilder < Watir::Locators::TextArea::SelectorBuilder
|
|
36
|
-
include SelectorHelpers
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
class TextField
|
|
41
|
-
class SelectorBuilder < Watir::Locators::TextField::SelectorBuilder
|
|
42
|
-
include SelectorHelpers
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|