bauxite 0.6.11 → 0.6.12

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: 413f15eac4a00d31aec202aef4ae0fdd0e5ff830
4
- data.tar.gz: 5cad94b5cedc1fdfd1126691d1ed6aecd9fd2df8
3
+ metadata.gz: eb916454c3e4239c530ddce67a507d4998d1cc07
4
+ data.tar.gz: 434e8e4d01021369e9833296b975d8b335b32a48
5
5
  SHA512:
6
- metadata.gz: 298193bfea45a604a1c60d2e73873e833d6cba0246b81bf110f055b8c6be0b55d75254744a0b2f89529da9e4c0b0e8d6ba4c92bb727fa8b121aebe0c2bd23a84
7
- data.tar.gz: 5d2b5b96366ba582972475a07a8cb4bf0bf6c3837600949bfa1ed91ab5d61a49f335fa201e578eae7b43e6e8ad70041aef01d29a6899cd5f0a0ef39808b253f8
6
+ metadata.gz: 1a5dfc1018b7af61bcd662887a18e8c8e9fee8aa2f49582d188e094bc92c073bd3bb1b2fc41575abe6d71060001099822e1a7b6f6a955ada79d64127d292aa1c
7
+ data.tar.gz: 82e1061d14f13e91d855c57c6b2e22967f3bb068ea49e73e4c582c7828f4f3989647e5d7e92407a306ed92361be411249fd1db7a8133ff7ff4cf45b1f17176ec
@@ -537,11 +537,13 @@ the popup. Alternatively, the action specified could be to
537
537
  <div class="method-source-code" id="assertm-source">
538
538
  <pre><span class="ruby-comment"># File lib/bauxite/actions/assertm.rb, line 40</span>
539
539
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">assertm</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">action</span> = <span class="ruby-string">&#39;accept&#39;</span>)
540
- <span class="ruby-identifier">a</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">switch_to</span>.<span class="ruby-identifier">alert</span>
541
- <span class="ruby-keyword">unless</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">_pattern</span>(<span class="ruby-identifier">text</span>)
542
- <span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">&quot;Assertion failed: expected &#39;#{a.text}&#39;, got &#39;#{actual}&#39;&quot;</span>
540
+ <span class="ruby-identifier">ctx</span>.<span class="ruby-identifier">with_timeout</span> <span class="ruby-constant">Selenium</span><span class="ruby-operator">::</span><span class="ruby-constant">WebDriver</span><span class="ruby-operator">::</span><span class="ruby-constant">Error</span><span class="ruby-operator">::</span><span class="ruby-constant">NoAlertPresentError</span> <span class="ruby-keyword">do</span>
541
+ <span class="ruby-identifier">a</span> = <span class="ruby-ivar">@ctx</span>.<span class="ruby-identifier">driver</span>.<span class="ruby-identifier">switch_to</span>.<span class="ruby-identifier">alert</span>
542
+ <span class="ruby-keyword">unless</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">_pattern</span>(<span class="ruby-identifier">text</span>)
543
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">Bauxite</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span><span class="ruby-operator">::</span><span class="ruby-constant">AssertionError</span>, <span class="ruby-node">&quot;Assertion failed: expected &#39;#{text}&#39;, got &#39;#{a.text}&#39;&quot;</span>
544
+ <span class="ruby-keyword">end</span>
545
+ <span class="ruby-identifier">a</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_sym</span>)
543
546
  <span class="ruby-keyword">end</span>
544
- <span class="ruby-identifier">a</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_sym</span>)
545
547
  <span class="ruby-keyword">end</span></pre>
546
548
  </div>
547
549
 
data/doc/created.rid CHANGED
@@ -1,4 +1,4 @@
1
- Thu, 01 May 2014 14:00:46 -0300
1
+ Mon, 05 May 2014 11:34:05 -0300
2
2
  README.md Wed, 26 Mar 2014 13:39:30 -0300
3
3
  lib/bauxite/selectors/smart.rb Wed, 26 Mar 2014 13:39:30 -0300
4
4
  lib/bauxite/selectors/attr.rb Wed, 26 Mar 2014 13:39:30 -0300
@@ -34,7 +34,7 @@ lib/bauxite/actions/asserth.rb Wed, 26 Mar 2014 13:39:30 -0300
34
34
  lib/bauxite/actions/click.rb Wed, 26 Mar 2014 13:39:30 -0300
35
35
  lib/bauxite/actions/js.rb Wed, 26 Mar 2014 13:39:30 -0300
36
36
  lib/bauxite/actions/capture.rb Wed, 26 Mar 2014 13:39:30 -0300
37
- lib/bauxite/actions/assertm.rb Thu, 01 May 2014 13:49:14 -0300
37
+ lib/bauxite/actions/assertm.rb Mon, 05 May 2014 11:29:04 -0300
38
38
  lib/bauxite/actions/params.rb Wed, 26 Mar 2014 13:39:30 -0300
39
39
  lib/bauxite/actions/assert.rb Wed, 26 Mar 2014 13:39:30 -0300
40
40
  lib/bauxite/actions/open.rb Wed, 26 Mar 2014 13:39:30 -0300
@@ -38,10 +38,12 @@ class Bauxite::Action
38
38
  #
39
39
  # :category: Action Methods
40
40
  def assertm(text, action = 'accept')
41
- a = @ctx.driver.switch_to.alert
42
- unless a.text =~ _pattern(text)
43
- raise Bauxite::Errors::AssertionError, "Assertion failed: expected '#{a.text}', got '#{actual}'"
41
+ ctx.with_timeout Selenium::WebDriver::Error::NoAlertPresentError do
42
+ a = @ctx.driver.switch_to.alert
43
+ unless a.text =~ _pattern(text)
44
+ raise Bauxite::Errors::AssertionError, "Assertion failed: expected '#{text}', got '#{a.text}'"
45
+ end
46
+ a.send(action.to_sym)
44
47
  end
45
- a.send(action.to_sym)
46
48
  end
47
49
  end
data/lib/bauxite.rb CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  #--
24
24
  module Bauxite
25
- VERSION = "0.6.11"
25
+ VERSION = "0.6.12"
26
26
  end
27
27
  #++
28
28
 
data/test/alert/page.html CHANGED
@@ -1,5 +1,5 @@
1
1
  <html>
2
- <body onload="alert('hello world!');">
2
+ <body onload="setTimeout(function() { alert('hello world!'); }, 2000);">
3
3
  <div id="text">There is an alert over this text!</div>
4
4
  </body>
5
5
  </html>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bauxite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patricio Zavolinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-01 00:00:00.000000000 Z
11
+ date: 2014-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver