watir 6.19.0 → 6.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +5 -0
- data/lib/watir/locators/element/selector_builder/xpath.rb +10 -2
- data/lib/watir/version.rb +1 -1
- data/spec/watirspec/html/special_chars.html +3 -0
- data/spec/watirspec/special_chars_spec.rb +10 -0
- data/spec/watirspec/window_switching_spec.rb +9 -0
- data/watir.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c714ef62b6caccbf6f2885fd9ea9ece26d42c9b64f64642dadd445e35029da0c
|
4
|
+
data.tar.gz: 2621db569beaa32c36577da613a0c27e16a64ca45e286a37e1cd000c3bf46db1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510bf92bb5212caec7334540076448f43bf13e4fcef510a36c78188718a1e744094b7cfe6dad3b713f51a2cf36f9ad22d5dfbf5983406fdb0bddcf75fb9a3fff
|
7
|
+
data.tar.gz: 634cff1ed0f60d0d88f6596b377933b0ec6eda95dae9fd554352e4bb6c55ef2f8f7b791fd0b2abc8bcc39d3bc4e4a4f52429c7db6efae533fb1d8f0e45159159
|
data/CHANGES.md
CHANGED
@@ -205,7 +205,7 @@ module Watir
|
|
205
205
|
def lhs_for(key, downcase: false)
|
206
206
|
case key
|
207
207
|
when String
|
208
|
-
|
208
|
+
process_string key
|
209
209
|
when :tag_name
|
210
210
|
'local-name()'
|
211
211
|
when :href
|
@@ -215,7 +215,7 @@ module Watir
|
|
215
215
|
when :contains_text
|
216
216
|
'normalize-space()'
|
217
217
|
when ::Symbol
|
218
|
-
lhs =
|
218
|
+
lhs = process_string key.to_s.tr('_', '-')
|
219
219
|
downcase ? XpathSupport.downcase(lhs) : lhs
|
220
220
|
else
|
221
221
|
raise LocatorException, "Unable to build XPath using #{key}:#{key.class}"
|
@@ -266,6 +266,14 @@ module Watir
|
|
266
266
|
|
267
267
|
false
|
268
268
|
end
|
269
|
+
|
270
|
+
def process_string(name)
|
271
|
+
if name =~ /^[a-zA-Z_:][a-zA-Z0-9_:.\-]*$/
|
272
|
+
"@#{name}"
|
273
|
+
else
|
274
|
+
"(attribute::*[local-name(.) = '#{name}'])"
|
275
|
+
end
|
276
|
+
end
|
269
277
|
end
|
270
278
|
end
|
271
279
|
end
|
data/lib/watir/version.rb
CHANGED
@@ -8,5 +8,8 @@
|
|
8
8
|
<body>
|
9
9
|
<div id='single-quote'>single 'quotes'</div>
|
10
10
|
<div id='double-quote'>double "quotes"</div>
|
11
|
+
<div underscored_attribute='true'>underscored attribute</div>
|
12
|
+
<div id='special' we{ird='foo'>attribute with non-standard XML characters</div>
|
13
|
+
<custom-tag id='custom_tag'>custom tag</custom-tag>
|
11
14
|
</body>
|
12
15
|
</html>
|
@@ -8,4 +8,14 @@ describe Watir::Browser do
|
|
8
8
|
it 'finds elements with single quotes' do
|
9
9
|
expect(browser.div(text: "single 'quotes'")).to exist
|
10
10
|
end
|
11
|
+
|
12
|
+
it 'finds elements with non-standard character locators' do
|
13
|
+
expect(browser.div('we{ird' => 'foo')).to exist
|
14
|
+
expect(browser.div('we{ird': 'foo')).to exist
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'finds element with underscored attribute' do
|
18
|
+
expect(browser.div('underscored_attribute' => 'true')).to exist
|
19
|
+
expect(browser.div('underscored_attribute' => true)).to exist
|
20
|
+
end
|
11
21
|
end
|
@@ -103,6 +103,15 @@ describe Watir::Browser do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
describe '#switch_window' do
|
106
|
+
it 'stays on the same window when matches single window' do
|
107
|
+
browser.switch_window
|
108
|
+
browser.window.close
|
109
|
+
browser.original_window.use
|
110
|
+
|
111
|
+
title = browser.title
|
112
|
+
expect { browser.window(title: title).use }.not_to raise_exception(TimeoutError)
|
113
|
+
end
|
114
|
+
|
106
115
|
it 'switches to second window' do
|
107
116
|
original_window = browser.window
|
108
117
|
browser.switch_window
|
data/watir.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
26
26
|
s.require_paths = ['lib']
|
27
27
|
|
28
|
-
s.add_dependency 'selenium-webdriver', '
|
28
|
+
s.add_dependency 'selenium-webdriver', '>= 3.142.7'
|
29
29
|
s.add_runtime_dependency 'regexp_parser', '>= 1.2', '< 3'
|
30
30
|
|
31
31
|
s.add_development_dependency 'activesupport', '~> 4.0', '>= 4.1.11' # for pluralization during code generation
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: watir
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.19.
|
4
|
+
version: 6.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
@@ -10,20 +10,20 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-03-
|
13
|
+
date: 2021-03-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: selenium-webdriver
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 3.142.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: 3.142.7
|
29
29
|
- !ruby/object:Gem::Dependency
|