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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b67d137fb553725a3560f0a319874cc5306ccb4
4
- data.tar.gz: 94a5b69d2a27b360ba506e974553fec6f5b7dcf8
3
+ metadata.gz: eec68739222be0a5bf1c319c164f3bbb78c0cfaa
4
+ data.tar.gz: 4d8ccb213aa1e2bb778ca6d83d751917f2f46dfb
5
5
  SHA512:
6
- metadata.gz: 57eff53b2276128e6b44b27c840159aabe135e24b0fb76d255ab67d656de25e525ff90f1a9ff99ae8059410870fd424ddb53db3dab41495f177246d8f1410590
7
- data.tar.gz: '08692e0b7d43a2b9aa9092ce1a2009f72d1bce025bf5f8918a6d7167353c08c9a23808230179694267d62c94962c5bfb97d0d45bebf8e1f2cd75a04d21f4b489'
6
+ metadata.gz: 1b287dce03a6b3a81ba1757b13ebe9440e75127b50e76b8f705b26f70d9593f05e9c0aea431c68e16786b5a4cbff712524c0b365e7ee4bfd77184bb44b6a770b
7
+ data.tar.gz: dc82c3c2faa4eb0efe2f4385baaa4d70649cff116f98b4902a13d9c8f8d5240629b9a032c8d8346d02e2a9d9b34aafb559de85c0a5411532d829c01c18cf86dc
@@ -1,5 +1,8 @@
1
+ # Please note that we should not be using container-based infrastructure
2
+ # because Chrome requires a lot of shared memory and Travis does not allow
3
+ # use host's /dev/shm.
4
+ sudo: required
1
5
  dist: trusty
2
- sudo: require
3
6
  rvm:
4
7
  - 2.2.7
5
8
  - 2.3.4
data/CHANGES.md CHANGED
@@ -1,4 +1,4 @@
1
- ### 6.4.0.rc1 (2017-06-21)
1
+ ### 6.4.0 (unreleased)
2
2
 
3
3
  * Significant performance updates
4
4
 
@@ -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
- if exist_check == :wait_for_enabled
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, Selenium::WebDriver::Error::ElementNotInteractableError
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
@@ -163,10 +163,6 @@ class ImplementationConfig
163
163
  Selenium::WebDriver::Chrome.path = path
164
164
  end
165
165
 
166
- if ENV['TRAVIS']
167
- opts[:args] << "--no-sandbox" # https://github.com/travis-ci/travis-ci/issues/938
168
- end
169
-
170
166
  opts
171
167
  end
172
168
 
@@ -9,15 +9,7 @@ require 'watirspec'
9
9
  #
10
10
 
11
11
  def browser
12
- @browser ||= begin
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.before do
68
- WatirSpec.run!
69
- end
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
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'watir'
5
- s.version = '6.4.0.rc1'
5
+ s.version = '6.4.0.rc2'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.authors = ['Alex Rodionov', 'Titus Fortner']
8
8
  s.email = ['p0deje@gmail.com', 'titusfortner@gmail.com']
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.rc1
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-21 00:00:00.000000000 Z
12
+ date: 2017-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver