spreewald 2.2.1 → 2.2.2

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +5 -0
  4. data/README.md +7 -7
  5. data/lib/spreewald/email_steps.rb +10 -8
  6. data/lib/spreewald/web_steps.rb +12 -7
  7. data/lib/spreewald_support/version.rb +1 -1
  8. data/tests/rails-3_capybara-1/Gemfile.lock +1 -1
  9. data/tests/rails-3_capybara-1/config/cucumber.yml +2 -0
  10. data/tests/rails-3_capybara-1/config/database.yml +7 -0
  11. data/tests/rails-3_capybara-1/features/support/paths.rb +16 -0
  12. data/tests/rails-3_capybara-1/features/support/selectors.rb +52 -0
  13. data/tests/rails-3_capybara-2/Gemfile.lock +1 -1
  14. data/tests/rails-3_capybara-2/Rakefile +18 -0
  15. data/tests/rails-3_capybara-2/config.ru +4 -0
  16. data/tests/rails-4_capybara-3/Gemfile.lock +1 -1
  17. data/tests/rails-4_capybara-3/features/development_steps.feature +8 -0
  18. data/tests/rails-4_capybara-3/features/email_steps.feature +216 -0
  19. data/tests/rails-4_capybara-3/features/overriding.feature +5 -0
  20. data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +3 -0
  21. data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +56 -0
  22. data/tests/rails-4_capybara-3/features/support/paths.rb +16 -0
  23. data/tests/rails-4_capybara-3/features/support/selectors.rb +52 -0
  24. data/tests/rails-4_capybara-3/features/table_steps.feature +293 -0
  25. data/tests/rails-4_capybara-3/features/web_steps.feature +295 -0
  26. data/tests/shared/app/views/forms/disabled_elements.html.haml +53 -0
  27. data/tests/shared/features/shared/email_steps.feature +3 -11
  28. data/tests/shared/features/shared/web_steps.feature +25 -0
  29. metadata +5 -31
  30. data/tests/rails-3_capybara-1/app +0 -1
  31. data/tests/rails-3_capybara-1/config/cucumber.yml +0 -1
  32. data/tests/rails-3_capybara-1/config/database.yml +0 -1
  33. data/tests/rails-3_capybara-1/db +0 -1
  34. data/tests/rails-3_capybara-1/features/shared +0 -1
  35. data/tests/rails-3_capybara-1/features/support/paths.rb +0 -1
  36. data/tests/rails-3_capybara-1/features/support/selectors.rb +0 -1
  37. data/tests/rails-3_capybara-1/public +0 -1
  38. data/tests/rails-3_capybara-2/Rakefile +0 -1
  39. data/tests/rails-3_capybara-2/app +0 -1
  40. data/tests/rails-3_capybara-2/config +0 -1
  41. data/tests/rails-3_capybara-2/config.ru +0 -1
  42. data/tests/rails-3_capybara-2/db +0 -1
  43. data/tests/rails-3_capybara-2/features +0 -1
  44. data/tests/rails-3_capybara-2/public +0 -1
  45. data/tests/rails-3_capybara-2/script +0 -1
  46. data/tests/rails-4_capybara-3/app +0 -1
  47. data/tests/rails-4_capybara-3/db +0 -1
  48. data/tests/rails-4_capybara-3/features/development_steps.feature +0 -1
  49. data/tests/rails-4_capybara-3/features/email_steps.feature +0 -1
  50. data/tests/rails-4_capybara-3/features/overriding.feature +0 -1
  51. data/tests/rails-4_capybara-3/features/step_definitions/overriding_steps.rb +0 -1
  52. data/tests/rails-4_capybara-3/features/step_definitions/test_steps.rb +0 -1
  53. data/tests/rails-4_capybara-3/features/support/paths.rb +0 -1
  54. data/tests/rails-4_capybara-3/features/support/selectors.rb +0 -1
  55. data/tests/rails-4_capybara-3/features/table_steps.feature +0 -1
  56. data/tests/rails-4_capybara-3/features/web_steps.feature +0 -1
  57. data/tests/rails-4_capybara-3/public/fixture_files +0 -1
  58. data/tests/shared/db/test.sqlite3 +0 -0
@@ -0,0 +1,5 @@
1
+ Feature: Overriding Spreewald-steps
2
+
3
+ Scenario: The developer should be able to override any Spreewald step without Cucumber raising Cucumber::Ambiguous
4
+ When I go to "/static_pages/overridden"
5
+ Then I should see "overridden value"
@@ -0,0 +1,3 @@
1
+ Then /^I should see "overridden value"$/ do
2
+ expect(page).to have_content('overridden value')
3
+ end
@@ -0,0 +1,56 @@
1
+ require 'cucumber/rspec/doubles'
2
+
3
+ RSPEC_EXPECTATION_NOT_MET_ERROR = RSpec::Expectations::ExpectationNotMetError
4
+
5
+ Then /^the following steps? should (fail|succeed):$/ do |expectation, steps_table|
6
+ steps = steps_table.raw.flatten
7
+
8
+ steps.each do |step|
9
+ if expectation == 'fail'
10
+ expect { step(step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
11
+
12
+ else # succeed
13
+ step(step)
14
+ end
15
+
16
+ end
17
+ end
18
+
19
+ When /^I run the following steps?:$/ do |steps_table|
20
+ steps = steps_table.raw.flatten
21
+
22
+ steps.each do |step|
23
+ step(step)
24
+ end
25
+ end
26
+
27
+ Then /^the following multiline step should (fail|succeed):$/ do |expectation, multiline_step|
28
+ multiline_step = multiline_step.gsub(%{'''}, %{"""})
29
+ if expectation == 'fail'
30
+ expect { steps(multiline_step) }.to raise_error(RSPEC_EXPECTATION_NOT_MET_ERROR)
31
+ else # succeed
32
+ steps(multiline_step)
33
+ end
34
+
35
+ end
36
+
37
+ Then(/^a hidden string with quotes should not be visible$/) do
38
+ hidden_string = %Q{hidden '" quotes}
39
+ assert_hidden(:text => hidden_string)
40
+ end
41
+
42
+ Then(/^a visible string with quotes should be visible$/) do
43
+ visible_string = %Q{visible '" quotes}
44
+ assert_visible(:text => visible_string)
45
+ end
46
+
47
+ Then(/^'show me the page' should open the page or take a screenshot$/) do
48
+ # Projects with Capybara 1 & 2 use the launchy gem
49
+ if Capybara::VERSION < "3.0"
50
+ expect(Launchy).to receive(:open)
51
+ step 'show me the page'
52
+ else
53
+ expect_any_instance_of(Capybara::Screenshot::Saver).to receive(:save)
54
+ step 'show me the page'
55
+ end
56
+ end
@@ -0,0 +1,16 @@
1
+ module NavigationHelpers
2
+
3
+ def path_to(page_name)
4
+ case page_name
5
+ when /^"(.*)"$/
6
+ $1
7
+
8
+ else
9
+ raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
10
+ "Now, go and add a mapping in #{__FILE__}"
11
+ end
12
+ end
13
+
14
+ end
15
+
16
+ World(NavigationHelpers)
@@ -0,0 +1,52 @@
1
+ module HtmlSelectorsHelpers
2
+ # Maps a name to a selector. Used primarily by the
3
+ #
4
+ # When /^(.+) within (.+)$/ do |step, scope|
5
+ #
6
+ # step definitions in web_steps.rb
7
+ #
8
+ def selector_for(locator)
9
+ case locator
10
+
11
+ when /^a panel?$/
12
+ '.panel'
13
+
14
+ when /^a panels nested contents?$/
15
+ '.panel--nested-contents'
16
+
17
+ when /^the timeline?$/
18
+ '.timeline'
19
+
20
+ when /^the table row containing "(.+?)"$/
21
+ all('tr').detect { |tr| tr.text.include? $1 } || raise("Could not find tr containing #{$1.inspect}")
22
+
23
+ when /^a table$/
24
+ '.table'
25
+
26
+ # Add more mappings here.
27
+ # Here is an example that pulls values out of the Regexp:
28
+ #
29
+ # when /^the (notice|error|info) flash$/
30
+ # ".flash.#{$1}"
31
+
32
+ # You can also return an array to use a different selector
33
+ # type, like:
34
+ #
35
+ # when /the header/
36
+ # [:xpath, "//header"]
37
+
38
+ # This allows you to provide a quoted selector as the scope
39
+ # for "within" steps as was previously the default for the
40
+ # web steps:
41
+ when /^"(.+)"$/
42
+ $1
43
+
44
+ else
45
+ raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
46
+ "Now, go and add a mapping in #{__FILE__}"
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ World(HtmlSelectorsHelpers)
@@ -0,0 +1,293 @@
1
+ Feature: Table steps
2
+
3
+
4
+ Scenario: should see a table with the following rows
5
+ When I go to "/tables/table1"
6
+ Then the following multiline step should succeed:
7
+ """
8
+ Then I should see a table with the following rows:
9
+ | 1-1 | 1-2 | 1-3 |
10
+ | 2-1 | 2-2 | 2-3 |
11
+ | 3-1 | 3-2 | 3-3 |
12
+ """
13
+ And the following multiline step should succeed:
14
+ """
15
+ Then I should see a table with the following rows:
16
+ | 1-1 | 1-3 |
17
+ | 2-1 | 2-3 |
18
+ | 3-1 | 3-3 |
19
+ """
20
+ And the following multiline step should succeed:
21
+ """
22
+ Then I should see a table with the following rows:
23
+ | 1-2 | 1-3 |
24
+ | 2-2 | 2-3 |
25
+ | 3-2 | 3-3 |
26
+ """
27
+ And the following multiline step should succeed:
28
+ """
29
+ Then I should see a table with the following rows:
30
+ | 1-1 | 1-2 | 1-3 |
31
+ | 3-1 | 3-2 | 3-3 |
32
+ """
33
+ And the following multiline step should succeed:
34
+ """
35
+ Then I should see a table with the following rows:
36
+ | 2-1 | 2-2 | 2-3 |
37
+ | 3-1 | 3-2 | 3-3 |
38
+ """
39
+ And the following multiline step should succeed:
40
+ """
41
+ Then I should see a table with the following rows:
42
+ | 1-1 | 1-2 | 1-3 |
43
+ | 2-1 | 2-2 | 2-3 |
44
+ """
45
+ And the following multiline step should succeed:
46
+ """
47
+ Then I should see a table with the following rows:
48
+ | 1-1 | 1-3 |
49
+ | 3-1 | 3-3 |
50
+ """
51
+ And the following multiline step should succeed:
52
+ """
53
+ Then I should see a table with the following rows:
54
+ | 1* | 1-3 |
55
+ | 3* | 3-3 |
56
+ """
57
+ And the following multiline step should fail:
58
+ """
59
+ Then I should see a table with the following rows:
60
+ | 3-1 | 3-2 | 3-3 |
61
+ | 1-1 | 1-2 | 1-3 |
62
+ | 2-1 | 2-2 | 2-3 |
63
+ """
64
+ But the following multiline step should fail:
65
+ """
66
+ Then I should see a table with the following rows:
67
+ | 1-1 | 1-2 | 1-3 |
68
+ | 2-1 | 2-2 | 2-3 |
69
+ | 3-1 | 3-2 | foo |
70
+ """
71
+ And the following multiline step should fail:
72
+ """
73
+ Then I should see a table with the following rows:
74
+ | 1-1 | 1-2 | 1-3 |
75
+ | 2-1 | foo | 2-3 |
76
+ | 3-1 | 3-2 | 3-3 |
77
+ """
78
+ And the following multiline step should fail:
79
+ """
80
+ Then I should see a table with the following rows:
81
+ | 1 | 1-3 |
82
+ | 3 | 3-3 |
83
+ """
84
+
85
+
86
+ Scenario: Cell content normalization
87
+ When I go to "/tables/table_with_weird_spaces"
88
+ Then I should see a table with the following rows:
89
+ | one two | three four |
90
+ | five six | seven eight |
91
+ | nineten | eleventwelve |
92
+
93
+
94
+ Scenario: should not see a table with the following rows
95
+ When I go to "/tables/table1"
96
+ Then the following multiline step should fail:
97
+ """
98
+ Then I should not see a table with the following rows:
99
+ | 1-1 | 1-2 | 1-3 |
100
+ | 2-1 | 2-2 | 2-3 |
101
+ | 3-1 | 3-2 | 3-3 |
102
+ """
103
+ But the following multiline step should succeed:
104
+ """
105
+ Then I should not see a table with the following rows:
106
+ | 3-1 | 3-2 | 3-3 |
107
+ | 1-1 | 1-2 | 1-3 |
108
+ | 2-1 | 2-2 | 2-3 |
109
+ """
110
+
111
+
112
+ Scenario: should see a table with exactly the following rows
113
+ When I go to "/tables/table1"
114
+ Then the following multiline step should succeed:
115
+ """
116
+ Then I should see a table with exactly the following rows:
117
+ | 1-1 | 1-2 | 1-3 |
118
+ | 2-1 | 2-2 | 2-3 |
119
+ | 3-1 | 3-2 | 3-3 |
120
+ """
121
+ And the following multiline step should succeed:
122
+ """
123
+ Then I should see a table with exactly the following rows:
124
+ | 1-1 | 1-3 |
125
+ | 2-1 | 2-3 |
126
+ | 3-1 | 3-3 |
127
+ """
128
+ But the following multiline step should fail:
129
+ """
130
+ Then I should see a table with exactly the following rows:
131
+ | 2-1 | 2-2 | 2-3 |
132
+ | 1-1 | 1-2 | 1-3 |
133
+ | 3-1 | 3-2 | 3-3 |
134
+ """
135
+ And the following multiline step should fail:
136
+ """
137
+ Then I should see a table with exactly the following rows:
138
+ | 1-1 | 1-2 | 1-3 |
139
+ | 3-1 | 3-2 | 3-3 |
140
+ """
141
+
142
+
143
+ Scenario: should not see a table with exactly the following rows
144
+ When I go to "/tables/table1"
145
+ Then the following multiline step should fail:
146
+ """
147
+ Then I should not see a table with exactly the following rows:
148
+ | 1-1 | 1-2 | 1-3 |
149
+ | 2-1 | 2-2 | 2-3 |
150
+ | 3-1 | 3-2 | 3-3 |
151
+ """
152
+ And the following multiline step should fail:
153
+ """
154
+ Then I should not see a table with exactly the following rows:
155
+ | 1-1 | 1-3 |
156
+ | 2-1 | 2-3 |
157
+ | 3-1 | 3-3 |
158
+ """
159
+ But the following multiline step should succeed:
160
+ """
161
+ Then I should not see a table with exactly the following rows:
162
+ | 2-1 | 2-2 | 2-3 |
163
+ | 1-1 | 1-2 | 1-3 |
164
+ | 3-1 | 3-2 | 3-3 |
165
+ """
166
+ And the following multiline step should succeed:
167
+ """
168
+ Then I should not see a table with exactly the following rows:
169
+ | 1-1 | 1-2 | 1-3 |
170
+ | 3-1 | 3-2 | 3-3 |
171
+ """
172
+
173
+
174
+ Scenario: should see a table with the following rows in any order
175
+ When I go to "/tables/table1"
176
+ Then the following multiline step should succeed:
177
+ """
178
+ Then I should see a table with the following rows in any order:
179
+ | 1-1 | 1-2 | 1-3 |
180
+ | 2-1 | 2-2 | 2-3 |
181
+ | 3-1 | 3-2 | 3-3 |
182
+ """
183
+ And the following multiline step should succeed:
184
+ """
185
+ Then I should see a table with the following rows in any order:
186
+ | 1-1 | 1-2 | 1-3 |
187
+ | 3-1 | 3-2 | 3-3 |
188
+ """
189
+ And the following multiline step should succeed:
190
+ """
191
+ Then I should see a table with the following rows in any order:
192
+ | 3-1 | 3-2 | 3-3 |
193
+ | 1-1 | 1-2 | 1-3 |
194
+ | 2-1 | 2-2 | 2-3 |
195
+ """
196
+ But the following multiline step should fail:
197
+ """
198
+ Then I should see a table with the following rows in any order:
199
+ | 1-1 | 1-2 | 1-3 |
200
+ | 2-1 | 2-2 | 2-3 |
201
+ | 3-1 | 3-2 | foo |
202
+ """
203
+ And the following multiline step should fail:
204
+ """
205
+ Then I should see a table with the following rows in any order:
206
+ | 1 | 1-3 |
207
+ | 3 | 3-3 |
208
+ """
209
+
210
+
211
+ Scenario: should not see a table with the following rows in any order
212
+ When I go to "/tables/table1"
213
+ Then the following multiline step should fail:
214
+ """
215
+ Then I should not see a table with the following rows in any order:
216
+ | 1-1 | 1-2 | 1-3 |
217
+ | 2-1 | 2-2 | 2-3 |
218
+ | 3-1 | 3-2 | 3-3 |
219
+ """
220
+ And the following multiline step should fail:
221
+ """
222
+ Then I should not see a table with the following rows in any order:
223
+ | 1-1 | 1-2 | 1-3 |
224
+ | 3-1 | 3-2 | 3-3 |
225
+ """
226
+ And the following multiline step should fail:
227
+ """
228
+ Then I should not see a table with the following rows in any order:
229
+ | 3-1 | 3-2 | 3-3 |
230
+ | 1-1 | 1-2 | 1-3 |
231
+ | 2-1 | 2-2 | 2-3 |
232
+ """
233
+ But the following multiline step should succeed:
234
+ """
235
+ Then I should not see a table with the following rows in any order:
236
+ | 1-1 | 1-2 | 1-3 |
237
+ | 2-1 | 2-2 | 2-3 |
238
+ | 3-1 | 3-2 | foo |
239
+ """
240
+ And the following multiline step should succeed:
241
+ """
242
+ Then I should not see a table with the following rows in any order:
243
+ | 1 | 1-3 |
244
+ | 3 | 3-3 |
245
+ """
246
+
247
+
248
+ Scenario: should see a table with exactly the following rows in any order
249
+ When I go to "/tables/table1"
250
+ Then the following multiline step should succeed:
251
+ """
252
+ Then I should see a table with exactly the following rows in any order:
253
+ | 1-1 | 1-2 | 1-3 |
254
+ | 2-1 | 2-2 | 2-3 |
255
+ | 3-1 | 3-2 | 3-3 |
256
+ """
257
+ And the following multiline step should succeed:
258
+ """
259
+ Then I should see a table with exactly the following rows in any order:
260
+ | 3-1 | 3-2 | 3-3 |
261
+ | 1-1 | 1-2 | 1-3 |
262
+ | 2-1 | 2-2 | 2-3 |
263
+ """
264
+ But the following multiline step should fail:
265
+ """
266
+ Then I should see a table with exactly the following rows in any order:
267
+ | 1-1 | 1-2 | 1-3 |
268
+ | 3-1 | 3-2 | 3-3 |
269
+ """
270
+
271
+
272
+ Scenario: should not see a table with exactly the following rows in any order
273
+ When I go to "/tables/table1"
274
+ Then the following multiline step should fail:
275
+ """
276
+ Then I should not see a table with exactly the following rows in any order:
277
+ | 1-1 | 1-2 | 1-3 |
278
+ | 2-1 | 2-2 | 2-3 |
279
+ | 3-1 | 3-2 | 3-3 |
280
+ """
281
+ And the following multiline step should fail:
282
+ """
283
+ Then I should not see a table with exactly the following rows in any order:
284
+ | 3-1 | 3-2 | 3-3 |
285
+ | 1-1 | 1-2 | 1-3 |
286
+ | 2-1 | 2-2 | 2-3 |
287
+ """
288
+ But the following multiline step should succeed:
289
+ """
290
+ Then I should not see a table with exactly the following rows in any order:
291
+ | 1-1 | 1-2 | 1-3 |
292
+ | 3-1 | 3-2 | 3-3 |
293
+ """
@@ -0,0 +1,295 @@
1
+ Feature: Web steps
2
+
3
+ Scenario: /^the "([^"]*)" field should (not )?contain "([^"]*)"$/
4
+ When I go to "/forms/form1"
5
+ Then the "Text control" field should contain "Text control value"
6
+ Then the "Text control" field should not contain "false text"
7
+ Then the "Select control" field should contain "Label 2"
8
+ Then the "Select control without selection" field should contain "Label 1"
9
+ Then the "Textarea control" field should contain "Textarea control value"
10
+ Then the "Empty control" field should contain ""
11
+
12
+
13
+ Scenario: /^the "([^"]*)" field should (not )?contain:/
14
+ When I go to "/forms/form2"
15
+ Then the "Text control" field should contain:
16
+ """
17
+ Text control value
18
+ """
19
+ Then the "Textarea control" field should contain:
20
+ """
21
+ Textarea control line 1
22
+ Textarea control line 2
23
+ """
24
+ Then the "Textarea control" field should not contain:
25
+ """
26
+ Textarea control wrong line 1
27
+ Textarea control wrong line 2
28
+ """
29
+ Then the "Empty textarea control" field should contain:
30
+ """
31
+ """
32
+
33
+
34
+ Scenario: /^the "([^\"]*)" field should( not)? have an error$/
35
+ When I go to "/forms/invalid_form"
36
+ Then the "Text control" field should have an error
37
+ Then the "Textarea control" field should have an error
38
+ Then the "Textarea control" field should have an error
39
+ Then the "Empty textarea control" field should not have an error
40
+
41
+
42
+ Scenario: /^the "([^"]*)" field should have no error$/
43
+ When I go to "/forms/invalid_form"
44
+ Then the "Empty textarea control" field should have no error
45
+
46
+
47
+ Scenario: /^I should see a form with the following values:$/
48
+ When I go to "/forms/form1"
49
+ Then I should see a form with the following values:
50
+ | Text control | Text control value |
51
+ | Select control | Label 2 |
52
+ | Select control without selection | Label 1 |
53
+ | Textarea control | Textarea control value |
54
+ | Empty control | |
55
+
56
+
57
+ Scenario: /^"([^"]*)" should( not)? be selected for "([^"]*)"$/
58
+ When I go to "/forms/form1"
59
+ Then "Label 2" should be selected for "Select control"
60
+ But "Label 1" should not be selected for "Select control"
61
+ And "Label 1" should be selected for "Select control without selection"
62
+
63
+
64
+ Scenario: /^nothing should be selected for "([^"]*)"$/
65
+ When I go to "/forms/form1"
66
+ Then nothing should be selected for "Select control with blank option"
67
+ Then nothing should be selected for "Select control with blank selection"
68
+
69
+ Scenario: /^the radio button "([^"]*)" should( not)? be (?:checked|selected)$/
70
+ When I go to "/forms/form1"
71
+ Then the radio button "Radio 1" should not be selected
72
+ Then the radio button "Radio 2" should not be selected
73
+ When I choose "Radio 1"
74
+ Then the radio button "Radio 1" should be selected
75
+ Then the radio button "Radio 2" should not be selected
76
+ When I choose "Radio 2"
77
+ Then the radio button "Radio 1" should not be selected
78
+ Then the radio button "Radio 2" should be selected
79
+
80
+
81
+ Scenario: /^I go back$/
82
+ Given I go to "/static_pages/link_to_home"
83
+ And I follow "Home"
84
+
85
+ When I go back
86
+ Then I should be on "/static_pages/link_to_home"
87
+
88
+
89
+ Scenario: /^the "([^"]*)" checkbox should( not)? be checked$/
90
+ When I go to "/forms/checkbox_form"
91
+ Then the "Checked" checkbox should be checked
92
+ And the "Unchecked" checkbox should not be checked
93
+
94
+
95
+ @javascript
96
+ Scenario: /^I click on "([^\"]+)"$/
97
+ When I go to "/static_pages/click_on"
98
+ And I click on "Nested"
99
+ # See that it clicks the innermost element with that text
100
+ Then I should see "You clicked on .inner"
101
+ When I click on "Button"
102
+ Then I should see "You clicked on .button"
103
+
104
+
105
+ @javascript
106
+ Scenario: /^I click on the element "([^\"]+)"$/
107
+ When I go to "/static_pages/click_on"
108
+ And I click on the element ".inner"
109
+ Then I should see "You clicked on .inner"
110
+ When I click on the element ".button"
111
+ Then I should see "You clicked on .button"
112
+
113
+
114
+ @javascript
115
+ Scenario: /^I click on the element for .*?$/
116
+ When I go to "/static_pages/click_on"
117
+ And I click on the element for a panel
118
+ Then I should see "You clicked on .panel"
119
+
120
+ When I click on the element for the timeline
121
+ Then I should see "You clicked on .timeline"
122
+ But I should not see "You clicked on .panel"
123
+
124
+ When I click on the element for a panel within ".clickables"
125
+ Then I should see "You clicked on .panel"
126
+
127
+
128
+ Scenario: /^the "(.*?)" select should( not)? be sorted$/
129
+ When I go to "/forms/select_fields"
130
+ Then the "sorted" select should be sorted
131
+ But the "unsorted" select should not be sorted
132
+
133
+
134
+ Scenario: /^Then (the tag )?"..." should( not)? be visible$/
135
+ When I go to "/static_pages/visibility"
136
+ Then "hidden ümläüt" should be hidden
137
+ And "visible ümläüt" should be visible
138
+ And a hidden string with quotes should not be visible
139
+ And a visible string with quotes should be visible
140
+ And "hidden ümläüt" should be hidden
141
+
142
+
143
+ @javascript
144
+ Scenario: /^Then (the tag )?"..." should( not)? be visible$/ with javascript
145
+ When I go to "/static_pages/visibility"
146
+ Then "hidden ümläüt" should be hidden
147
+ And "visible ümläüt" should be visible
148
+ And a hidden string with quotes should not be visible
149
+ And a visible string with quotes should be visible
150
+ And "hidden ümläüt" should be hidden
151
+
152
+
153
+ Scenario: /^the "([^\"]*)" field should( not)? be visible$/
154
+ When I go to "/static_pages/visibility"
155
+ Then the "Visible field" field should be visible
156
+ But the "Hidden field" field should not be visible
157
+
158
+
159
+ @javascript
160
+ Scenario: /^the "([^\"]*)" field should( not)? be visible$/ with Javascript
161
+ When I go to "/static_pages/visibility"
162
+ Then the "Visible field" field should be visible
163
+ But the "Hidden field" field should not be visible
164
+
165
+
166
+ Scenario: /^I should (not )?see (?:an|the) element "([^"]+)"$/
167
+ When I go to "/static_pages/see_element"
168
+ Then I should see an element ".panel"
169
+ And I should see the element ".panel"
170
+ And I should see the element ".panel--nested-contents" within ".panel"
171
+ And I should see the element ".panel--nested-contents" within a panel
172
+ But I should not see an element ".timeline"
173
+ But I should not see the element ".timeline"
174
+
175
+
176
+ Scenario: /^I should (not )?see (?:an|the) element for (.*?)$/
177
+ When I go to "/static_pages/see_element"
178
+ Then I should see an element for a panel
179
+ And I should see the element for a panel
180
+ And I should see the element for a panels nested contents within ".panel"
181
+ And I should see the element for a panels nested contents within a panel
182
+ And I should not see an element for the timeline
183
+ And I should not see the element for the timeline
184
+
185
+
186
+ Scenario: /^((?:|I )should see "([^"]*)" within (.*[^:])$/
187
+ When I go to "/static_pages/within"
188
+ Then I should see "Role" within ".table"
189
+ And I should see "Permissions" within a table
190
+ But I should not see "Nonsense" within ".table"
191
+ And I should not see "Nonsense" within a table
192
+
193
+
194
+ Scenario: /^(?:|I )should see \/([^\/]*)\/$/
195
+ When I go to "/static_pages/within"
196
+ Then I should see /Shared Text/
197
+ And I should see /Unique Text/
198
+ And I should see /http://example.com/
199
+ And I should see /\^Will this text with special Regex characters match\.\.\?\$/
200
+ But I should not see /Nonsense/
201
+ And I should not see /http://other-domain.com/
202
+
203
+
204
+ Scenario: /^(?:|I )should see \/([^\/]*)\/ within (.*[^:])$/
205
+ When I go to "/static_pages/within"
206
+ Then I should see /Shared Text/ within ".scoped-element"
207
+ And I should see /Shared Text/ within ".unrelated-element"
208
+ And I should see /Unique Text/ within ".scoped-element"
209
+ And I should see /http://example.com/ within ".hardly-matchable-texts"
210
+ And I should see /\^Will this text with special Regex characters match\.\.\?\$/ within ".hardly-matchable-texts"
211
+ But I should not see /Unique Text/ within ".unrelated-element"
212
+ And I should not see /http://other-domain.com/ within ".unrelated-element"
213
+
214
+
215
+ Scenario: /^(.*) within (.*[^:])$/ with a Capybara::Node::Element
216
+ When I go to "/static_pages/within"
217
+ Then I should see "All" within the table row containing "Admin"
218
+
219
+
220
+ Scenario: the /^(.*) within (.*[^:])$/ step should not be invoked when the word "within" is used in an argument for another step
221
+ When I go to "/static_pages/within"
222
+ Then I should see "He lives within a few miles of Augsburg"
223
+
224
+
225
+ Scenario: /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/
226
+ When I go to "/authenticated/page"
227
+ Then I should see "Access denied"
228
+ When I perform basic authentication as "user/password" and go to "/authenticated/page"
229
+ Then I should see "Action reached"
230
+
231
+
232
+ @javascript
233
+ Scenario: /^I perform basic authentication as "([^\"]*)\/([^\"]*)" and go to (.*)$/ with Javascript
234
+ When I perform basic authentication as "user/password" and go to "/authenticated/page"
235
+ Then I should see "Action reached"
236
+
237
+
238
+ @javascript
239
+ Scenario: /^show me the page$/
240
+ When I am on "/static_pages/home"
241
+ Then 'show me the page' should open the page or take a screenshot
242
+
243
+
244
+ Scenario: /^I should get a download with filename "([^\"]*)"$/
245
+ When I go to "/downloads/spreadsheet"
246
+ Then I should get a download with filename "test.ods"
247
+
248
+
249
+ Scenario: /^I should( not)? see a link labeled "([^"]*)"$/
250
+ When I am on "/static_pages/links"
251
+ Then I should see a link labeled "First visible link"
252
+ And I should see a link labeled "First visible link" within ".nested-link"
253
+ And I should see a link labeled "Also matches via the title attribute"
254
+ But I should not see a link labeled "Nonexistent Link"
255
+ And I should not see a link labeled "First visible link" within ".unrelated-element"
256
+
257
+
258
+ Scenario: /^I should( not)? see the (?:number|amount) ([\-\d,\.]+)(?: (.*?))?$/
259
+ When I am on "/static_pages/numbers"
260
+ Then I should see the number 1
261
+ And I should see the number 2.3
262
+ And I should see the number 4,5
263
+ And I should see the amount -60,72 €
264
+ And I should see the amount 13 €
265
+ And I should see the amount -10,000.99 EUR within ".nested-number"
266
+ But I should not see the number 2,3
267
+ And I should not see the number 4.5
268
+ And I should not see the number 60,72
269
+ And I should not see the amount -60,7 €
270
+ And I should not see the amount -10,000.99 EUR within ".unrelated-element"
271
+
272
+
273
+ Scenario: /^the "([^\"]*)" button should( not)? be disabled$/
274
+ When I go to "/forms/disabled_elements"
275
+ # buttons
276
+ Then the "Disabled button #1" button should be disabled
277
+ And the "Disabled button #2" button should be disabled
278
+ And the "Disabled button #3" button should be disabled
279
+ And the "Disabled button #4" button should be disabled
280
+ But the "Enabled button #1" button should not be disabled
281
+ And the "Enabled button #2" button should not be disabled
282
+
283
+ # checkboxes
284
+ And the "Disabled checkbox #1" checkbox should be disabled
285
+ And the "Disabled checkbox #2" checkbox should be disabled
286
+ And the "Disabled checkbox #3" checkbox should be disabled
287
+ But the "Enabled checkbox #1" checkbox should not be disabled
288
+ And the "Enabled checkbox #2" checkbox should not be disabled
289
+
290
+ # fields
291
+ And the "Disabled field #1" field should be disabled
292
+ And the "Disabled field #2" field should be disabled
293
+ And the "Disabled field #3" field should be disabled
294
+ But the "Enabled field #1" field should not be disabled
295
+ And the "Enabled field #2" field should not be disabled