capybara-widgets 0.2.2 → 0.2.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f25d932ff565ce8c892a8f67ef212c61edfd2f
|
4
|
+
data.tar.gz: 0154bf14ea9f129ef817af426097d16d15dec169
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d823d6063bd84f1cf2e955a931904e3a98f662f4de5d581fcd80f1da779888f7f2538cbd8d818545a6c3dd6b66a6cf4ceba6a85d24344c83a78db15ba0bfbb46
|
7
|
+
data.tar.gz: 1f568992b156b08d190b2dd6dcf6e5eab5fabb3f382e81e22673b5d0d34c4bfb7af946a876a4a72825065c44f7c13cfb48d7c8e02f6e2546729defc2bda4a1f7
|
@@ -11,6 +11,7 @@ module Capybara
|
|
11
11
|
|
12
12
|
class_attribute :path
|
13
13
|
class_attribute :path_matcher
|
14
|
+
class_attribute :url_matcher
|
14
15
|
|
15
16
|
def self.inherited(subclass)
|
16
17
|
PageCollection.instance.registry << subclass
|
@@ -33,9 +34,14 @@ module Capybara
|
|
33
34
|
|
34
35
|
def opened?
|
35
36
|
eventually do
|
36
|
-
result = self.path_matcher?
|
37
|
-
|
38
|
-
|
37
|
+
result = if self.path_matcher?
|
38
|
+
current_path =~ self.path_matcher
|
39
|
+
elsif self.url_matcher?
|
40
|
+
current_url =~ self.url_matcher
|
41
|
+
else
|
42
|
+
self.path?
|
43
|
+
current_path =~ %r{#{Regexp.quote(self.path)}}
|
44
|
+
end
|
39
45
|
raise "#{self.class.name} is not opened" unless result
|
40
46
|
result
|
41
47
|
end
|
@@ -44,6 +44,14 @@ When(/^I open "([^"]*)" from a "([^"]*)"$/) do |action_param, widget_path|
|
|
44
44
|
target_widget.open!(action_param)
|
45
45
|
end
|
46
46
|
|
47
|
+
# Example:
|
48
|
+
# I select "My first account" in "Account chooser"
|
49
|
+
# is mapped to:
|
50
|
+
# AccountChooser.new.select!("My first account")
|
51
|
+
When(/^I select "([^"]*)" (?:in|on)(?: an?)? "([^"]*)"$/) do |action_param, widget_path|
|
52
|
+
target_widget = resolve_widget(widget_path)
|
53
|
+
target_widget.select!(action_param)
|
54
|
+
end
|
47
55
|
|
48
56
|
And(/^I should see the following "([^"]*)" in a "([^"]*)"$/) do |field_name, widget_path, table|
|
49
57
|
expected_values = table.raw.flatten
|
@@ -90,4 +98,4 @@ And(/^the "([^"]*)" should( not)? be "([^"]*)" in a "([^"]*)"$/) do |field_name,
|
|
90
98
|
end
|
91
99
|
end
|
92
100
|
end
|
93
|
-
end
|
101
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitalii Grygoruk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|