capybara-angular 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capybara/angular/dsl.rb +8 -1
- data/lib/capybara/angular/version.rb +1 -1
- data/lib/capybara/angular/waiter.rb +11 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb7cac0f774a56afa92223cfedc9904bead05ddf
|
4
|
+
data.tar.gz: 45c152c893570c9fd7efe10083e2679c030a6e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d286117b6cd5b5478caab4660cabb4ab359285f19e6afa0b2de47fccb88ab6d9f275164732267e54d111d6f0e3c77422a17f4dde11a41ff67e2e20132d667ef
|
7
|
+
data.tar.gz: f74fe7c012054df62cf4dfeb775a1a2c60aa85390f467f1a833b7c15335df4edb09e837fff5188c1dcf682167ed95b04d19d4021ec2d870dd321043b56f12ba1
|
data/lib/capybara/angular/dsl.rb
CHANGED
@@ -10,13 +10,20 @@ module Capybara
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def page
|
13
|
-
wait_until_angular_ready
|
13
|
+
wait_until_angular_ready unless @ignoring_angular
|
14
14
|
Capybara.current_session
|
15
15
|
end
|
16
16
|
|
17
17
|
def wait_until_angular_ready
|
18
18
|
Waiter.new(Capybara.current_session).wait_until_ready
|
19
19
|
end
|
20
|
+
|
21
|
+
def ignoring_angular
|
22
|
+
@ignoring_angular = true
|
23
|
+
yield
|
24
|
+
ensure
|
25
|
+
@ignoring_angular = false
|
26
|
+
end
|
20
27
|
end
|
21
28
|
end
|
22
29
|
end
|
@@ -48,16 +48,17 @@ module Capybara
|
|
48
48
|
|
49
49
|
def setup_ready
|
50
50
|
page.execute_script <<-JS
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
51
|
+
var el = document.querySelector('body')
|
52
|
+
window.angularReady = false;
|
53
|
+
|
54
|
+
if (angular.getTestability) {
|
55
|
+
angular.getTestability(el).whenStable(function() { window.angularReady = true; });
|
56
|
+
} else {
|
57
|
+
var $browser = angular.element(el).injector().get('$browser');
|
58
|
+
|
59
|
+
if ($browser.outstandingRequestCount > 0) { window.angularReady = false; }
|
60
|
+
$browser.notifyWhenNoOutstandingRequests(function() { window.angularReady = true; });
|
61
|
+
}
|
61
62
|
JS
|
62
63
|
end
|
63
64
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-angular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pawel Pierzchala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|