capybara-ng 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/angular.rb +9 -0
- data/lib/angular/driver.rb +3 -0
- data/lib/angular/dsl.rb +11 -4
- data/lib/angular/element_helper.rb +3 -0
- data/lib/angular/locator.rb +3 -0
- data/lib/angular/setup.rb +1 -1
- data/lib/angular/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee1078d214243d3fe0d47d1cffa2c797a6622b2d
|
4
|
+
data.tar.gz: 3bbaf75d9cc3494ebbcd2d970f625a8c4d617ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1dc56cb845ab105cdad7b127e6114ba2cee00397dfc43f4de9a333c9da26f59c50f28b573128a37e4fd284a7d48114365bfd822db6afbf0b3b6d814635eadf10
|
7
|
+
data.tar.gz: 66bf50cf8c1c101c923db57f142ff8b0f67899098ca4caa32aa0b7f090d75000888f33833adf559f1febd45f90e3d1c0e1bd4726af1ab23281ee9508aa0b02ee
|
data/.gitignore
CHANGED
data/lib/angular.rb
CHANGED
@@ -4,6 +4,15 @@ require 'capybara'
|
|
4
4
|
module Angular
|
5
5
|
class NotFound < StandardError
|
6
6
|
end
|
7
|
+
|
8
|
+
def self.root_selector
|
9
|
+
@root_slector ||= 'body'
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.root_selector=(root_selector)
|
13
|
+
@root_selector = root_selector
|
14
|
+
end
|
15
|
+
|
7
16
|
end
|
8
17
|
|
9
18
|
require 'angular/log'
|
data/lib/angular/driver.rb
CHANGED
data/lib/angular/dsl.rb
CHANGED
@@ -4,6 +4,13 @@ module DSL
|
|
4
4
|
@ng ||= Angular::Setup.new(Capybara.current_session)
|
5
5
|
end
|
6
6
|
|
7
|
+
def ng_root_selector(root_selector = nil)
|
8
|
+
if root_selector
|
9
|
+
@ng_root_selector = root_selector
|
10
|
+
end
|
11
|
+
@ng_root_selector || Angular.root_selector
|
12
|
+
end
|
13
|
+
|
7
14
|
def ng_install
|
8
15
|
ng.install
|
9
16
|
end
|
@@ -16,14 +23,14 @@ module DSL
|
|
16
23
|
# @return current location absolute url
|
17
24
|
#
|
18
25
|
def ng_location_abs(opt = {})
|
19
|
-
selector = opt.delete(:rootSelector) ||
|
26
|
+
selector = opt.delete(:rootSelector) || ng_root_selector
|
20
27
|
ng.make_call :getLocationAbsUrl, [selector], opt
|
21
28
|
end
|
22
29
|
|
23
30
|
# @return current location absolute url
|
24
31
|
#
|
25
32
|
def ng_location(opt = {})
|
26
|
-
selector = opt.delete(:rootSelector) ||
|
33
|
+
selector = opt.delete(:rootSelector) || ng_root_selector
|
27
34
|
ng.make_call :getLocation, [selector], opt
|
28
35
|
end
|
29
36
|
|
@@ -31,7 +38,7 @@ module DSL
|
|
31
38
|
# @return current location
|
32
39
|
#
|
33
40
|
def ng_set_location(url, opt = {})
|
34
|
-
selector = opt.delete(:rootSelector) ||
|
41
|
+
selector = opt.delete(:rootSelector) || ng_root_selector
|
35
42
|
ng.make_call :setLocation, [selector, url], opt
|
36
43
|
end
|
37
44
|
|
@@ -42,7 +49,7 @@ module DSL
|
|
42
49
|
# @return eval result
|
43
50
|
#
|
44
51
|
def ng_eval(expr, opt = {})
|
45
|
-
selector = opt.delete(:rootSelector) ||
|
52
|
+
selector = opt.delete(:rootSelector) || ng_root_selector
|
46
53
|
ng.make_call :evaluate, [selector, expr], opt
|
47
54
|
end
|
48
55
|
|
data/lib/angular/locator.rb
CHANGED
data/lib/angular/setup.rb
CHANGED
data/lib/angular/version.rb
CHANGED