watir 6.8.1 → 6.8.2

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: 7bab202c139eec8a6f1588038a05b0a6c1fb1967
4
- data.tar.gz: b5b9856ff71421e43bfbc31b982260cafbb759b7
3
+ metadata.gz: 727cd5c1020e932467833d4750dc61716f60b8fb
4
+ data.tar.gz: b0e81b12faace42be3914ef54de2b1d25fddb4cb
5
5
  SHA512:
6
- metadata.gz: df12527b5f19fdb984ae4c9a2aa7d92ec354c8f366b2e42434d260dfd677274a15d1675bdfb0fe53558e5b719e69fb545dad2bbbcb367f0dc83f587343aac00a
7
- data.tar.gz: b581ed689210455fcaf52cb8b1cb2f50eb120e816cc08de4bea703a6cb4ee5f6d057ceaf9790e143e67f05df545f9c9f429aba5d420a19241d4d8d8570fdfc60
6
+ metadata.gz: 4ba07e681cc33793a02bd6a1deff4419bdff895374d7329bb3c55a6c83e820bc9456b56fc4d80ffc2dc9079760615311119b90e5ef76e774f6b85ffc0a506f38
7
+ data.tar.gz: bee368388abe7453cd081bfd55c7f8e9e2417016230a373b3451ea89b48ac49b2ce9ce4e6015ebf8a9540dccf96c484e3a5eb1da741f0c8c0d5a39316d91adfc
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 6.8.2 (2017-09-06)
2
+
3
+ * Fix bug to prevent after_hooks from running when an alert is present
4
+ * Fix bug with actions not correctly timing out (#636)
5
+
1
6
  ### 6.8.1 (2017-09-05)
2
7
 
3
8
  * Ignore index locator when value is zero
@@ -66,7 +66,7 @@ module Watir
66
66
  #
67
67
 
68
68
  def run
69
- if @after_hooks.any? && @browser.window.present?
69
+ if @after_hooks.any? && @browser.window.present? && !@browser.alert.exists?
70
70
  each { |after_hook| after_hook.call(@browser) }
71
71
  end
72
72
  end
@@ -2,8 +2,6 @@ module Watir
2
2
  module Wait
3
3
  class Timer
4
4
 
5
- attr_reader :remaining_time
6
-
7
5
  def initialize(timeout: nil)
8
6
  @end_time = current_time + timeout if timeout
9
7
  @remaining_time = @end_time - current_time if @end_time
@@ -25,6 +23,10 @@ module Watir
25
23
  end
26
24
  end
27
25
 
26
+ def remaining_time
27
+ @end_time - current_time
28
+ end
29
+
28
30
  def reset!
29
31
  @end_time = nil
30
32
  end
@@ -125,21 +125,17 @@ describe "Browser::AfterHooks" do
125
125
  end
126
126
 
127
127
  not_compliant_on :safari, :headless do
128
- it "raises UnhandledAlertError error when running error checks with alert present" do
129
- url = WatirSpec.url_for("alerts.html")
130
- @page_after_hook = Proc.new { browser.url }
131
- browser.after_hooks.add @page_after_hook
132
- browser.goto url
128
+ it "does not run error checks with alert present" do
129
+ browser.goto WatirSpec.url_for("alerts.html")
133
130
 
134
- not_compliant_on :firefox do
135
- expect { browser.button(id: "alert").click }.to raise_error(Selenium::WebDriver::Error::UnhandledAlertError)
136
- end
131
+ @page_after_hook = Proc.new { @yield = browser.title == "Alerts" }
132
+ browser.after_hooks.add @page_after_hook
137
133
 
138
- deviates_on :firefox do
139
- expect { browser.button(id: "alert").click }.to raise_error(Selenium::WebDriver::Error::UnexpectedAlertOpenError)
140
- end
134
+ browser.button(id: "alert").click
135
+ expect(@yield).to be_nil
141
136
 
142
137
  browser.alert.ok
138
+ expect(@yield).to eq true
143
139
  end
144
140
  end
145
141
 
@@ -144,6 +144,23 @@ describe Watir::Element do
144
144
  end
145
145
  end
146
146
 
147
+ compliant_on :relaxed_locate do
148
+ it "clicking automatically waits until the element appears" do
149
+ browser.a(id: 'show_bar').click
150
+ expect { browser.div(id: 'bar').click }.to_not raise_exception
151
+ expect(browser.div(id: 'bar').text).to eq 'changed'
152
+ end
153
+
154
+ it "raises exception if the element doesn't appear" do
155
+ expect { browser.div(id: 'bar').click }.to raise_unknown_object_exception
156
+ end
157
+
158
+ it "raises exception if the element doesn't become enabled" do
159
+ expect { browser.button(id: 'btn').click }.to raise_object_disabled_exception
160
+ end
161
+
162
+ end
163
+
147
164
  not_compliant_on :relaxed_locate do
148
165
  describe "#wait_until &:enabled?" do
149
166
  it "invokes subsequent method calls when the element becomes enabled" do
data/watir.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'watir'
5
- s.version = '6.8.1'
5
+ s.version = '6.8.2'
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.8.1
4
+ version: 6.8.2
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-09-05 00:00:00.000000000 Z
12
+ date: 2017-09-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver