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 +4 -4
- data/Gemfile.lock +4 -4
- data/NEWS.md +5 -0
- data/gemfiles/2.2.gemfile.lock +1 -1
- data/gemfiles/2.3.gemfile.lock +1 -1
- data/gemfiles/2.4.gemfile.lock +4 -4
- data/lib/capybara/webkit/driver.rb +1 -1
- data/lib/capybara/webkit/version.rb +1 -1
- data/spec/driver_spec.rb +27 -0
- data/src/FindModal.cpp +10 -13
- data/src/FindModal.h +1 -4
- data/src/WebPage.cpp +3 -3
- data/src/WebPage.h +2 -2
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: caa991e4ca62a2ae01175d74269b04c85109d019
|
4
|
+
data.tar.gz: 9715e5c18998f8d6b33fa73de57d01e64c59413b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bdd5799550be5189825638154cd8f49e79bb5428de741369a6889cfb01f6e4591562efd162cf02d2232757075d3736b595826daa4ca78ffefed96074e8534cc
|
7
|
+
data.tar.gz: 86aef4be069c961c3fd8a9b5f0cdcb93eb7f935c90741b2f4a80542aefdba23ff62a2c5540692abb3ea286b39c1d46eb3a79be5247288884f3784d580b348757
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
capybara-webkit (1.3.
|
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.
|
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.
|
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
data/gemfiles/2.2.gemfile.lock
CHANGED
data/gemfiles/2.3.gemfile.lock
CHANGED
data/gemfiles/2.4.gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
capybara-webkit (1.3.
|
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.
|
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.
|
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)
|
data/spec/driver_spec.rb
CHANGED
@@ -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
|
data/src/FindModal.cpp
CHANGED
@@ -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
|
-
|
13
|
-
|
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(
|
14
|
+
handleModalReady();
|
17
15
|
}
|
18
16
|
}
|
19
17
|
|
20
|
-
void FindModal::handleModalReady(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
}
|
data/src/FindModal.h
CHANGED
data/src/WebPage.cpp
CHANGED
@@ -472,8 +472,8 @@ int WebPage::modalCount() {
|
|
472
472
|
return m_modalMessages.length();
|
473
473
|
}
|
474
474
|
|
475
|
-
QString WebPage::modalMessage(
|
476
|
-
return m_modalMessages
|
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(
|
484
|
+
emit modalReady();
|
485
485
|
}
|
data/src/WebPage.h
CHANGED
@@ -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(
|
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(
|
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.
|
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-
|
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.
|
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: []
|