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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8018d3a5453853ae73d3ec4b61bd281c14a95be0
4
- data.tar.gz: 6b5845e50c7ba54f14505812dfb8488f691c61bc
3
+ metadata.gz: 763495a5866fc3cfc1096efddba1c0c0bfec8e53
4
+ data.tar.gz: 4d2291b4b4af79ff2a6b1b3639a9fc8183fd3311
5
5
  SHA512:
6
- metadata.gz: 13376b14178baebdc1383701ce3d5da4fe68b2fd96833df988a43ff9b12c0d0d51676697c35640272d3528c21872cc2541bb4dca8f05593b06df1c9a64402a91
7
- data.tar.gz: 6918a080cf7bf285c393d27fb7ad23835fb0665731edb68738ac6de29c6ed36c3da9fa0a8a832b526aefa7173ab859e1a3b19b8ec3a312a0783fea78c3ed2162
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 oldOpen = XMLHttpRequest.prototype.open;
63
+ var oldSend = XMLHttpRequest.prototype.send;
61
64
  window.activeRequests = 0;
62
- XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
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
- oldOpen.call(this, method, url, async, user, pass);
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
 
@@ -1,3 +1,3 @@
1
1
  module Pickles
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
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.7
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-09-21 00:00:00.000000000 Z
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.12
149
+ rubygems_version: 2.6.8
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: Capybara test helpers