rspectacular 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rspectacular/selectors.rb +10 -8
- data/lib/rspectacular/selectors/defaults.rb +49 -49
- data/lib/rspectacular/version.rb +1 -1
- 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: 0a326a51bf1583e4aecba367c22f01645937e156
|
4
|
+
data.tar.gz: bdd2c5ea9cbf0d8054f74eb39e9e9eb9ba58be85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 441cb7fa2b3243d268d895cf489c918c37c1bdfd30d67a95092e41d5f114eea8d0f89bccb6590e182f377a2592b0464cc54ce1489001f5e0672b552cef8ae31f
|
7
|
+
data.tar.gz: b9e7b2b98e0758d442252bd450137e6cbd6b54d00b6d4ed8c9100fb80a08c2fffe999ddf3e0ae4e0c4d5c3ac8cdfde6c86d00fa16692eb8a414c878cb4cd647b
|
@@ -13,14 +13,16 @@ def idsf(*args)
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def sf(*args)
|
16
|
-
|
17
|
-
|
16
|
+
selector_description = args[0]
|
17
|
+
selector_entry = RSpectacular.selectors.find { |regex, selector| selector_description.match regex }
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
fail "Cannot find selector for '#{selector_description}'. Please add it to the list of selectors." if selector_entry.nil?
|
20
|
+
|
21
|
+
selector = selector_entry[1]
|
22
|
+
|
23
|
+
if selector.respond_to? :call
|
24
|
+
selector.call(*args)
|
25
|
+
else
|
26
|
+
selector
|
25
27
|
end
|
26
28
|
end
|
@@ -1,51 +1,51 @@
|
|
1
1
|
module RSpectacular
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
2
|
+
def self.default_selectors
|
3
|
+
{
|
4
|
+
/the Facebook application/ => lambda do
|
5
|
+
frame_element = find 'html#facebook div#pagelet_app_runner iframe'
|
6
|
+
frame_element[:id]
|
7
|
+
end,
|
8
|
+
|
9
|
+
/the flash(.*)/ => lambda do |*args|
|
10
|
+
flash_type = args[0][/the flash(.*)/, 1]
|
11
|
+
flash_type_class = flash_type.strip
|
12
|
+
flash_type_class = flash_type_class.empty? ? '' : ".#{flash_type_class}"
|
13
|
+
|
14
|
+
".flash#{flash_type_class} p"
|
15
|
+
end,
|
16
|
+
|
17
|
+
###
|
18
|
+
# Facebook
|
19
|
+
#
|
20
|
+
/the Facebook login form/ => 'html#facebook form#login_form',
|
21
|
+
/the Facebook page timeline nav bar/ => 'html#facebook #fbTimelineNavTopRow',
|
22
|
+
/the Facebook account menu/ => '#navAccountLink',
|
23
|
+
|
24
|
+
###
|
25
|
+
# PayPal
|
26
|
+
#
|
27
|
+
/the "Pay with PayPal" button/ => 'input[alt="Check out with PayPal"]',
|
28
|
+
|
29
|
+
###
|
30
|
+
# Forms
|
31
|
+
#
|
32
|
+
/the errors for (.*)/ => lambda { "#{sf $1}+div.error" },
|
33
|
+
|
34
|
+
###
|
35
|
+
# Windows
|
36
|
+
#
|
37
|
+
/the most recently opened window/ => lambda { page.driver.browser.window_handles.last },
|
38
|
+
/the alert dialog/ => lambda { page.driver.browser.switch_to.alert },
|
39
|
+
|
40
|
+
###
|
41
|
+
# Date Picker Buttons
|
42
|
+
#
|
43
|
+
/the date picker button for today/ => '.ui-datepicker-today',
|
44
|
+
|
45
|
+
###
|
46
|
+
# Model Links
|
47
|
+
#
|
48
|
+
/the (.*) button for/ => lambda { "##{$1.gsub(/ /, '_')}_#{args[0].class.name.underscore}_#{args[0].id}_link" }
|
49
|
+
}
|
50
|
+
end
|
51
51
|
end
|
data/lib/rspectacular/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspectacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|