pickles 0.1.8 → 0.1.9
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/config.rb +1 -1
- data/lib/cucumber/pickles/helpers/node_finders.rb +2 -3
- data/lib/cucumber/pickles/steps/fill_in/complex_input.rb +4 -2
- data/lib/cucumber/pickles/steps/fill_in/factory.rb +16 -1
- data/lib/cucumber/pickles/steps/fill_in/input.rb +2 -0
- data/lib/cucumber/pickles/version.rb +1 -1
- data/spec/helpers/waiter_spec.rb +1 -0
- data/spec/steps/fill_in/factory_spec.rb +10 -0
- 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: 8118ba0ab14b4b72c919b150f89486f1e6adb6a9
|
4
|
+
data.tar.gz: b9735e920420d9fcaaf34d87d7923d77dacdf0a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94df6c00755830b691ba3323d62653c1759723c62c9a57c591e61a0bc2f4527cd5acb6a6863dd5b5ea2946367742d8b3c6cb18ee32e4b43f7bb511048d7ec44e
|
7
|
+
data.tar.gz: 7832423793a2791d27882482a4eb6d4530d47e6b7af0be48fd3ae98b829576e3a67b56afeece897306d7d107c2d3b20b5e475b4799a0f0241bac83a964354365
|
@@ -78,7 +78,8 @@ module NodeFinders
|
|
78
78
|
within ||= Capybara.current_session
|
79
79
|
options[:visible] = false
|
80
80
|
|
81
|
-
locator, index
|
81
|
+
locator, index = Locator::Index.execute(input_locator)
|
82
|
+
locator, label_xpath = Locator::Equal.execute(locator)
|
82
83
|
|
83
84
|
if index
|
84
85
|
index_xpath = "[#{index}]"
|
@@ -89,8 +90,6 @@ module NodeFinders
|
|
89
90
|
# case 3
|
90
91
|
_rescued_find([:xpath, xpath, options], locator, within: within, message: "@contenteditable with placeholder = #{locator}") do
|
91
92
|
|
92
|
-
locator, label_xpath = Locator::Equal.execute(input_locator)
|
93
|
-
|
94
93
|
inputtable_field_xpath = "*[self::input or self::textarea or @contenteditable]"
|
95
94
|
|
96
95
|
xpath = "(#{label_xpath})#{index_xpath}/ancestor::*[.//#{inputtable_field_xpath}][position()=1]//#{inputtable_field_xpath}"
|
@@ -9,7 +9,11 @@ class FillIN::Factory
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def call
|
12
|
-
if
|
12
|
+
if in_quotes?
|
13
|
+
remove_quotes!
|
14
|
+
end
|
15
|
+
|
16
|
+
if !@value.nil? && @value[':'] && !in_quotes?
|
13
17
|
step = FillIN::ComplexInput
|
14
18
|
elsif @label =~ TAG
|
15
19
|
@label = $1
|
@@ -22,4 +26,15 @@ class FillIN::Factory
|
|
22
26
|
step.new(@label, @value, @within)
|
23
27
|
end
|
24
28
|
|
29
|
+
private
|
30
|
+
|
31
|
+
def in_quotes?
|
32
|
+
@in_quotes ||= @value && @value[0] == "\"" && @value[-1] == "\""
|
33
|
+
end
|
34
|
+
|
35
|
+
def remove_quotes!
|
36
|
+
@value[0] = ''
|
37
|
+
@value[-1] = ''
|
38
|
+
end
|
39
|
+
|
25
40
|
end
|
data/spec/helpers/waiter_spec.rb
CHANGED
@@ -39,6 +39,16 @@ RSpec.describe '#FillIN::Factory' do
|
|
39
39
|
expect(step).to be_instance_of(FillIN::ComplexInput)
|
40
40
|
end
|
41
41
|
|
42
|
+
it 'uses default input step if value has : and surrounded by quotes' do
|
43
|
+
label = "input"
|
44
|
+
value = "\"1:2:3\""
|
45
|
+
|
46
|
+
step = FillIN::Factory.new(label, value).call
|
47
|
+
|
48
|
+
expect(step).to be_instance_of(FillIN::Input)
|
49
|
+
expect(step.value).to eq "1:2:3"
|
50
|
+
end
|
51
|
+
|
42
52
|
it 'uses input step by default' do
|
43
53
|
label = "input"
|
44
54
|
value = "1"
|