pickles 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cucumber/pickles/helpers/node_finders.rb +17 -10
- data/lib/cucumber/pickles/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: 60e12a093f0976dc32ffba53f9e8ada6cd0e686a
|
4
|
+
data.tar.gz: d514867ab85fdb7376daa8b5aafd85f3a9da142a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adaa725437c33b2845d905afa75ac54ac70b137f8f606c5af351f14d7ccb5ba9e31bf4b6d1a009a9c08fb50c84e21130c798abadb57b25638b1f40f3239d0626
|
7
|
+
data.tar.gz: f59cc23cf4a1790634fae5da2a0d6af13988bd1f1c8f9a8a000fdd894f08e3bc3a16942d9b37b88f95ae3a66b4b3862c8ef3b20187888a4a46244c2d07c61117
|
@@ -92,21 +92,28 @@ module NodeFinders
|
|
92
92
|
|
93
93
|
inputtable_field_xpath = "*[self::input or self::textarea or @contenteditable]"
|
94
94
|
|
95
|
-
xpath = "(#{label_xpath}
|
95
|
+
xpath = "(#{label_xpath}/ancestor::*[.//#{inputtable_field_xpath}][position()=1]//#{inputtable_field_xpath})#{index_xpath}"
|
96
96
|
|
97
|
-
#
|
98
|
-
_rescued_find([:xpath, xpath, options], locator, within: within, message: "find_node(#{locator}) => look for closest fillable field") do
|
97
|
+
_rescued_find([:xpath, xpath, options], locator, within: within, message: "find_node(#{locator}) => look for closest fillable field, index by input") do
|
99
98
|
|
100
|
-
|
101
|
-
_rescued_find([:fillable_field, locator, options], locator, within: within, message: 'Capybara#fillable_input') do
|
99
|
+
inputtable_field_xpath = "*[self::input or self::textarea or @contenteditable]"
|
102
100
|
|
103
|
-
|
104
|
-
raise Capybara::ElementNotFound,
|
105
|
-
"Unable to find fillable field by locator #{locator}",
|
106
|
-
caller
|
101
|
+
xpath = "(#{label_xpath})#{index_xpath}/ancestor::*[.//#{inputtable_field_xpath}][position()=1]//#{inputtable_field_xpath}"
|
107
102
|
|
108
|
-
|
103
|
+
# case 1
|
104
|
+
_rescued_find([:xpath, xpath, options], locator, within: within, message: "find_node(#{locator}) => look for closest fillable field, index by label") do
|
105
|
+
|
106
|
+
# case 2
|
107
|
+
_rescued_find([:fillable_field, locator, options], locator, within: within, message: 'Capybara#fillable_input') do
|
108
|
+
|
109
|
+
# all cases failed => raise
|
110
|
+
raise Capybara::ElementNotFound,
|
111
|
+
"Unable to find fillable field by locator #{locator}",
|
112
|
+
caller
|
109
113
|
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
110
117
|
end
|
111
118
|
|
112
119
|
end
|