pickles 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cucumber/pickles/helpers/waiter.rb +10 -4
- data/lib/cucumber/pickles/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 763495a5866fc3cfc1096efddba1c0c0bfec8e53
|
4
|
+
data.tar.gz: 4d2291b4b4af79ff2a6b1b3639a9fc8183fd3311
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: baa010f04476adc48f95725fee9bf0f045c2e093656faa128f7fa0b0440c524dd0b2d1b33a883a475993fe9b11b5ebc410bb94b0d6f19a18e111960dcd127aae
|
7
|
+
data.tar.gz: 7deaf0a5273bb476b5b7aa167bd2d03a2259b8037510a78e8c5c1bf79fc3729d1e6805ed19d0d3be566b36d2a28b948cdf5d6601ccf76e769d040cdb80ae305b
|
@@ -50,6 +50,9 @@
|
|
50
50
|
# end
|
51
51
|
# end
|
52
52
|
|
53
|
+
#
|
54
|
+
# XMLHttpRequest.prototype.open broken in Angular2 + zone.js => have to redefine XMLHttpRequest.prototype.send
|
55
|
+
#
|
53
56
|
def stub_xml_http_request(page)
|
54
57
|
page.evaluate_script <<-JAVASCRIPT
|
55
58
|
(function() {
|
@@ -57,9 +60,9 @@ def stub_xml_http_request(page)
|
|
57
60
|
if (window.ajaxRequestIsSet) { return; };
|
58
61
|
window.ajaxRequestIsSet = true;
|
59
62
|
|
60
|
-
var
|
63
|
+
var oldSend = XMLHttpRequest.prototype.send;
|
61
64
|
window.activeRequests = 0;
|
62
|
-
XMLHttpRequest.prototype.
|
65
|
+
XMLHttpRequest.prototype.send = function(method, url, async, user, pass) {
|
63
66
|
window.activeRequests++;
|
64
67
|
this.addEventListener("readystatechange", function() {
|
65
68
|
if (this.readyState == 4) {
|
@@ -79,10 +82,9 @@ def stub_xml_http_request(page)
|
|
79
82
|
|
80
83
|
}
|
81
84
|
}, false);
|
82
|
-
|
85
|
+
oldSend.call(this, method, url, async, user, pass);
|
83
86
|
};
|
84
87
|
|
85
|
-
|
86
88
|
var style = document.createElement('style');
|
87
89
|
style.type = 'text/css';
|
88
90
|
style.innerHTML = '* {' +
|
@@ -146,6 +148,10 @@ module Waiter
|
|
146
148
|
end
|
147
149
|
|
148
150
|
def pending_ajax_requests_num
|
151
|
+
req_num = page.evaluate_script("window.activeRequests")
|
152
|
+
return req_num if req_num
|
153
|
+
|
154
|
+
stub_xml_http_request(page)
|
149
155
|
page.evaluate_script("window.activeRequests")
|
150
156
|
end
|
151
157
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pickles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -146,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
148
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.6.
|
149
|
+
rubygems_version: 2.6.8
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Capybara test helpers
|