watir 6.4.0.rc1 → 6.4.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -1
- data/CHANGES.md +1 -1
- data/lib/watir/elements/element.rb +20 -11
- data/spec/watirspec_helper.rb +0 -4
- data/support/doctest_helper.rb +22 -16
- data/watir.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eec68739222be0a5bf1c319c164f3bbb78c0cfaa
|
4
|
+
data.tar.gz: 4d8ccb213aa1e2bb778ca6d83d751917f2f46dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b287dce03a6b3a81ba1757b13ebe9440e75127b50e76b8f705b26f70d9593f05e9c0aea431c68e16786b5a4cbff712524c0b365e7ee4bfd77184bb44b6a770b
|
7
|
+
data.tar.gz: dc82c3c2faa4eb0efe2f4385baaa4d70649cff116f98b4902a13d9c8f8d5240629b9a032c8d8346d02e2a9d9b34aafb559de85c0a5411532d829c01c18cf86dc
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
@@ -523,6 +523,13 @@ module Watir
|
|
523
523
|
end
|
524
524
|
|
525
525
|
def wait_for_enabled
|
526
|
+
case self
|
527
|
+
when Input, Button, Select, Option
|
528
|
+
# noop
|
529
|
+
else
|
530
|
+
wait_for_exists && return
|
531
|
+
end
|
532
|
+
|
526
533
|
return assert_enabled unless Watir.relaxed_locate?
|
527
534
|
|
528
535
|
begin
|
@@ -650,20 +657,11 @@ module Watir
|
|
650
657
|
already_locked = Wait.timer.locked?
|
651
658
|
Wait.timer = Wait::Timer.new(timeout: Watir.default_timeout) unless already_locked
|
652
659
|
begin
|
653
|
-
|
654
|
-
if self.is_a?(Input) || self.is_a?(Button) || self.is_a?(Select) || self.is_a?(Option)
|
655
|
-
wait_for_enabled
|
656
|
-
else
|
657
|
-
wait_for_exists
|
658
|
-
end
|
659
|
-
else
|
660
|
-
send(exist_check)
|
661
|
-
end
|
662
|
-
|
660
|
+
send exist_check
|
663
661
|
yield
|
664
662
|
rescue Selenium::WebDriver::Error::StaleElementReferenceError
|
665
663
|
retry
|
666
|
-
rescue Selenium::WebDriver::Error::ElementNotVisibleError,
|
664
|
+
rescue Selenium::WebDriver::Error::ElementNotVisibleError, interact_error
|
667
665
|
raise_present unless Wait.timer.remaining_time > 0
|
668
666
|
raise_present unless exist_check == :wait_for_present || exist_check == :wait_for_enabled
|
669
667
|
retry
|
@@ -679,6 +677,17 @@ module Watir
|
|
679
677
|
end
|
680
678
|
end
|
681
679
|
|
680
|
+
|
681
|
+
# Support for Selenium < 3.4.1 with latest Geckodriver
|
682
|
+
def interact_error
|
683
|
+
if defined?(Selenium::WebDriver::Error::ElementNotInteractable)
|
684
|
+
Selenium::WebDriver::Error::ElementNotInteractable
|
685
|
+
else
|
686
|
+
Selenium::WebDriver::Error::ElementNotInteractableError
|
687
|
+
end
|
688
|
+
end
|
689
|
+
|
690
|
+
|
682
691
|
def method_missing(meth, *args, &blk)
|
683
692
|
method = meth.to_s
|
684
693
|
if method =~ Locators::Element::SelectorBuilder::WILDCARD_ATTRIBUTE
|
data/spec/watirspec_helper.rb
CHANGED
data/support/doctest_helper.rb
CHANGED
@@ -9,15 +9,7 @@ require 'watirspec'
|
|
9
9
|
#
|
10
10
|
|
11
11
|
def browser
|
12
|
-
|
13
|
-
opts = {}
|
14
|
-
opts[:args] = ['--no-sandbox'] if ENV['TRAVIS']
|
15
|
-
|
16
|
-
browser = Watir::Browser.new(:chrome, opts)
|
17
|
-
browser.goto WatirSpec.url_for('forms_with_input_elements.html')
|
18
|
-
|
19
|
-
browser
|
20
|
-
end
|
12
|
+
$browser ||= Watir::Browser.new(:chrome)
|
21
13
|
end
|
22
14
|
|
23
15
|
YARD::Doctest.configure do |doctest|
|
@@ -29,6 +21,17 @@ YARD::Doctest.configure do |doctest|
|
|
29
21
|
doctest.skip 'Watir::Window#size'
|
30
22
|
doctest.skip 'Watir::Window#position'
|
31
23
|
|
24
|
+
doctest.before do
|
25
|
+
WatirSpec.run!
|
26
|
+
sleep 1 # give Chrome some time to breathe in
|
27
|
+
browser.goto WatirSpec.url_for('forms_with_input_elements.html')
|
28
|
+
end
|
29
|
+
|
30
|
+
doctest.after do
|
31
|
+
sleep 1 # give Chrome some time to breathe out
|
32
|
+
browser.windows.drop(1).each(&:close)
|
33
|
+
end
|
34
|
+
|
32
35
|
%w[text ok close exists? present?].each do |name|
|
33
36
|
doctest.before("Watir::Alert##{name}") do
|
34
37
|
browser.goto WatirSpec.url_for('alerts.html')
|
@@ -41,6 +44,12 @@ YARD::Doctest.configure do |doctest|
|
|
41
44
|
browser.button(id: 'prompt').click
|
42
45
|
end
|
43
46
|
|
47
|
+
%w[text exists? present?].each do |name|
|
48
|
+
doctest.after("Watir::Alert##{name}") do
|
49
|
+
browser.alert.close
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
44
53
|
%w[Watir::Browser#execute_script Watir::Element#drag_and_drop].each do |name|
|
45
54
|
doctest.before(name) do
|
46
55
|
browser.goto WatirSpec.url_for('drag_and_drop.html')
|
@@ -64,13 +73,10 @@ YARD::Doctest.configure do |doctest|
|
|
64
73
|
end
|
65
74
|
end
|
66
75
|
|
67
|
-
doctest.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
doctest.after do
|
72
|
-
browser.quit
|
73
|
-
@browser = nil
|
76
|
+
doctest.after('Watir::AfterHooks') do
|
77
|
+
browser.after_hooks.each do |hook|
|
78
|
+
browser.after_hooks.delete(hook)
|
79
|
+
end
|
74
80
|
end
|
75
81
|
end
|
76
82
|
|
data/watir.gemspec
CHANGED
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.4.0.
|
4
|
+
version: 6.4.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-06-
|
12
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|