capybara-webkit 1.3.0 → 1.3.1

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: d61a9d2568a46053dfe21bf58cc9263454c4b489
4
- data.tar.gz: e9689291ccf578f1a2c79e72c3ceb6b0d545dc4c
3
+ metadata.gz: caa991e4ca62a2ae01175d74269b04c85109d019
4
+ data.tar.gz: 9715e5c18998f8d6b33fa73de57d01e64c59413b
5
5
  SHA512:
6
- metadata.gz: 0553617872da58e661c35a40ed83195d5ee013f0f8ca04bb2519f2bff1342b5023580fc3dc5ac6427c645a16511662133036aef648900401cbf46b2bd0ba734a
7
- data.tar.gz: 6dfe749f35bf08f94c31467034eecc7e94e11205bce989a8643addf46d69e0f5295384e39e00ea23c0f21ae463719b8521e42564ee7b5bebbada5d56d2a1f8db
6
+ metadata.gz: 2bdd5799550be5189825638154cd8f49e79bb5428de741369a6889cfb01f6e4591562efd162cf02d2232757075d3736b595826daa4ca78ffefed96074e8534cc
7
+ data.tar.gz: 86aef4be069c961c3fd8a9b5f0cdcb93eb7f935c90741b2f4a80542aefdba23ff62a2c5540692abb3ea286b39c1d46eb3a79be5247288884f3784d580b348757
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capybara-webkit (1.3.0)
4
+ capybara-webkit (1.3.1)
5
5
  capybara (>= 2.0.2, < 2.5.0)
6
6
  json
7
7
 
@@ -12,7 +12,7 @@ GEM
12
12
  appraisal (0.4.0)
13
13
  bundler
14
14
  rake
15
- capybara (2.4.1)
15
+ capybara (2.4.4)
16
16
  mime-types (>= 1.16)
17
17
  nokogiri (>= 1.3.3)
18
18
  rack (>= 1.0.0)
@@ -30,12 +30,12 @@ GEM
30
30
  launchy (2.4.2-java)
31
31
  addressable (~> 2.3)
32
32
  spoon (~> 0.0.1)
33
- mime-types (2.3)
33
+ mime-types (2.4.3)
34
34
  mini_magick (3.2.1)
35
35
  subexec (~> 0.0.4)
36
36
  mini_portile (0.6.0)
37
37
  multi_json (1.8.4)
38
- nokogiri (1.6.2.1)
38
+ nokogiri (1.6.3.1)
39
39
  mini_portile (= 0.6.0)
40
40
  rack (1.5.2)
41
41
  rack-protection (1.3.2)
data/NEWS.md CHANGED
@@ -1,3 +1,8 @@
1
+ New for 1.3.1:
2
+
3
+ * Inherit from Capybara::Driver::Base for Capybara 2.4.4 compatibility.
4
+ * Fix a bug in the modal API which could cause an incorrect modal to be found.
5
+
1
6
  New for 1.3.0:
2
7
 
3
8
  * Capybara 2.4 compatibility.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- capybara-webkit (1.3.0)
4
+ capybara-webkit (1.3.1)
5
5
  capybara (>= 2.0.2, < 2.5.0)
6
6
  json
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- capybara-webkit (1.3.0)
4
+ capybara-webkit (1.3.1)
5
5
  capybara (>= 2.0.2, < 2.5.0)
6
6
  json
7
7
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- capybara-webkit (1.3.0)
4
+ capybara-webkit (1.3.1)
5
5
  capybara (>= 2.0.2, < 2.5.0)
6
6
  json
7
7
 
@@ -12,7 +12,7 @@ GEM
12
12
  appraisal (0.4.1)
13
13
  bundler
14
14
  rake
15
- capybara (2.4.1)
15
+ capybara (2.4.4)
16
16
  mime-types (>= 1.16)
17
17
  nokogiri (>= 1.3.3)
18
18
  rack (>= 1.0.0)
@@ -25,12 +25,12 @@ GEM
25
25
  json (1.8.1)
26
26
  launchy (2.4.2)
27
27
  addressable (~> 2.3)
28
- mime-types (2.3)
28
+ mime-types (2.4.3)
29
29
  mini_magick (3.7.0)
30
30
  subexec (~> 0.2.1)
31
31
  mini_portile (0.6.0)
32
32
  multi_json (1.10.1)
33
- nokogiri (1.6.2.1)
33
+ nokogiri (1.6.3.1)
34
34
  mini_portile (= 0.6.0)
35
35
  rack (1.5.2)
36
36
  rack-protection (1.5.3)
@@ -8,7 +8,7 @@ require "capybara/webkit/cookie_jar"
8
8
  require "capybara/webkit/errors"
9
9
 
10
10
  module Capybara::Webkit
11
- class Driver
11
+ class Driver < Capybara::Driver::Base
12
12
  attr_reader :browser
13
13
 
14
14
  def initialize(app, options={})
@@ -1,7 +1,7 @@
1
1
  module Capybara
2
2
  module Driver
3
3
  class Webkit
4
- VERSION = '1.3.0'.freeze
4
+ VERSION = '1.3.1'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -656,6 +656,21 @@ describe Capybara::Webkit::Driver do
656
656
  </html>
657
657
  HTML
658
658
  end
659
+
660
+ get '/double' do
661
+ <<-HTML
662
+ <html>
663
+ <head>
664
+ </head>
665
+ <body>
666
+ <script type="text/javascript">
667
+ alert('First alert');
668
+ </script>
669
+ <input type="button" onclick="alert('Second alert')" name="test"/>
670
+ </body>
671
+ </html>
672
+ HTML
673
+ end
659
674
  end
660
675
  end
661
676
 
@@ -681,6 +696,18 @@ describe Capybara::Webkit::Driver do
681
696
  }.to raise_error Capybara::ModalNotFound, "Unable to find modal dialog with No?"
682
697
  end
683
698
 
699
+ it 'finds two alert windows in a row' do
700
+ driver.accept_modal(:alert, text: 'First alert') do
701
+ visit('/double')
702
+ end
703
+
704
+ expect {
705
+ driver.accept_modal(:alert, text: 'Boom') do
706
+ driver.find_xpath("//input").first.click
707
+ end
708
+ }.to raise_error Capybara::ModalNotFound, "Unable to find modal dialog with Boom"
709
+ end
710
+
684
711
  it 'waits to accept an async alert modal' do
685
712
  visit("/async")
686
713
  alert_message = driver.accept_modal(:alert) do
@@ -5,25 +5,22 @@
5
5
  #include "ErrorMessage.h"
6
6
 
7
7
  FindModal::FindModal(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
8
- m_modalId = 0;
9
8
  }
10
9
 
11
10
  void FindModal::start() {
12
- m_modalId = arguments()[0].toInt();
13
- if (page()->modalCount() < m_modalId) {
14
- connect(page(), SIGNAL(modalReady(int)), SLOT(handleModalReady(int)));
11
+ if (page()->modalCount() == 0) {
12
+ connect(page(), SIGNAL(modalReady()), SLOT(handleModalReady()));
15
13
  } else {
16
- handleModalReady(m_modalId);
14
+ handleModalReady();
17
15
  }
18
16
  }
19
17
 
20
- void FindModal::handleModalReady(int modalId) {
21
- if (modalId == m_modalId) {
22
- sender()->disconnect(SIGNAL(modalReady(int)), this, SLOT(handleModalReady(int)));
23
- if (page()->modalMessage(m_modalId).isNull()) {
24
- finish(false, new ErrorMessage("ModalNotFound", ""));
25
- } else {
26
- finish(true, page()->modalMessage(m_modalId));
27
- }
18
+ void FindModal::handleModalReady() {
19
+ sender()->disconnect(SIGNAL(modalReady()), this, SLOT(handleModalReady()));
20
+ QString message = page()->modalMessage();
21
+ if (message.isNull()) {
22
+ finish(false, new ErrorMessage("ModalNotFound", ""));
23
+ } else {
24
+ finish(true, message);
28
25
  }
29
26
  }
@@ -8,9 +8,6 @@ class FindModal : public SocketCommand {
8
8
  virtual void start();
9
9
 
10
10
  public slots:
11
- void handleModalReady(int);
12
-
13
- private:
14
- int m_modalId;
11
+ void handleModalReady();
15
12
  };
16
13
 
@@ -472,8 +472,8 @@ int WebPage::modalCount() {
472
472
  return m_modalMessages.length();
473
473
  }
474
474
 
475
- QString WebPage::modalMessage(int id) {
476
- return m_modalMessages[id - 1];
475
+ QString WebPage::modalMessage() {
476
+ return m_modalMessages.takeFirst();
477
477
  }
478
478
 
479
479
  void WebPage::addModalMessage(bool expectedType, const QString &message, const QRegExp &expectedMessage) {
@@ -481,5 +481,5 @@ void WebPage::addModalMessage(bool expectedType, const QString &message, const Q
481
481
  m_modalMessages << message;
482
482
  else
483
483
  m_modalMessages << QString();
484
- emit modalReady(m_modalMessages.length());
484
+ emit modalReady();
485
485
  }
@@ -53,7 +53,7 @@ class WebPage : public QWebPage {
53
53
  bool clickTest(QWebElement element, int absoluteX, int absoluteY);
54
54
  void resize(int, int);
55
55
  int modalCount();
56
- QString modalMessage(int);
56
+ QString modalMessage();
57
57
 
58
58
  public slots:
59
59
  bool shouldInterruptJavaScript();
@@ -71,7 +71,7 @@ class WebPage : public QWebPage {
71
71
  void pageFinished(bool);
72
72
  void requestCreated(QByteArray &url, QNetworkReply *reply);
73
73
  void replyFinished(QNetworkReply *reply);
74
- void modalReady(int);
74
+ void modalReady();
75
75
 
76
76
  protected:
77
77
  virtual void javaScriptConsoleMessage(const QString &message, int lineNumber, const QString &sourceID);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-webkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-08-18 00:00:00.000000000 Z
16
+ date: 2014-10-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: capybara
@@ -383,22 +383,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
383
383
  version: '0'
384
384
  requirements: []
385
385
  rubyforge_project:
386
- rubygems_version: 2.2.0
386
+ rubygems_version: 2.2.2
387
387
  signing_key:
388
388
  specification_version: 4
389
389
  summary: Headless Webkit driver for Capybara
390
- test_files:
391
- - spec/browser_spec.rb
392
- - spec/capybara_webkit_builder_spec.rb
393
- - spec/connection_spec.rb
394
- - spec/cookie_jar_spec.rb
395
- - spec/driver_rendering_spec.rb
396
- - spec/driver_resize_window_spec.rb
397
- - spec/driver_spec.rb
398
- - spec/errors_spec.rb
399
- - spec/integration/session_spec.rb
400
- - spec/selenium_compatibility_spec.rb
401
- - spec/self_signed_ssl_cert.rb
402
- - spec/spec_helper.rb
403
- - spec/support/app_runner.rb
404
- - spec/support/matchers/include_response.rb
390
+ test_files: []