selenium-cucumber 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/bin/generate.rb CHANGED
@@ -1,20 +1,20 @@
1
-
2
- def selenium_cucumber_scaffold
3
- if File.exists?(@features_dir)
4
- puts "A features directory already exists. Stopping..."
5
- exit 1
6
- end
7
- msg("Question") do
8
- puts "I'm about to create a subdirectory called features."
9
- puts "features will contain all your project tests."
10
- puts "Please hit return to confirm that's what you want."
11
- end
12
- exit 2 unless STDIN.gets.chomp == ''
13
-
14
- FileUtils.cp_r(@source_dir, @features_dir)
15
-
16
- msg("Info") do
17
- puts "features subdirectory created. \n"
18
- end
19
-
20
- end
1
+
2
+ def selenium_cucumber_scaffold
3
+ if File.exists?(@features_dir)
4
+ puts "A features directory already exists. Stopping..."
5
+ exit 1
6
+ end
7
+ msg("Question") do
8
+ puts "I'm about to create a subdirectory called features."
9
+ puts "features will contain all your project tests."
10
+ puts "Please hit return to confirm that's what you want."
11
+ end
12
+ exit 2 unless STDIN.gets.chomp == ''
13
+
14
+ FileUtils.cp_r(@source_dir, @features_dir)
15
+
16
+ msg("Info") do
17
+ puts "features subdirectory created. \n"
18
+ end
19
+
20
+ end
data/bin/helper.rb CHANGED
@@ -1,51 +1,51 @@
1
- require 'tempfile'
2
- require 'json'
3
- require "rubygems"
4
-
5
- def msg(title, &block)
6
- puts "\n" + "-"*10 + title + "-"*10
7
- block.call
8
- puts "-"*10 + "-------" + "-"*10 + "\n"
9
- end
10
-
11
- def print_usage
12
- puts <<EOF
13
-
14
- Usage: selenium-cucumber <command-name> [parameters] [options]
15
-
16
- <command-name> can be one of
17
- help
18
- prints more detailed help information.
19
- gen
20
- generate a features folder structure.
21
- version
22
- prints the gem version
23
-
24
- <options> can be
25
- -v, --verbose Turns on verbose logging
26
- EOF
27
- end
28
-
29
- def print_help
30
- puts <<EOF
31
-
32
- Usage: selenium-cucumber <command-name> [parameters] [options]
33
-
34
- <command-name> can be one of
35
- help
36
- gen
37
- version
38
-
39
- Commands:
40
- help : prints more detailed help information.
41
-
42
- gen : creates a skeleton features dir. This is usually used once when
43
- setting up selnium-cucumber to ensure that the features folder contains
44
- the right step definitions and environment to run with cucumber.
45
-
46
- version : prints the gem version
47
-
48
- <Options>
49
- -v, --verbose Turns on verbose logging
50
- EOF
1
+ require 'tempfile'
2
+ require 'json'
3
+ require "rubygems"
4
+
5
+ def msg(title, &block)
6
+ puts "\n" + "-"*10 + title + "-"*10
7
+ block.call
8
+ puts "-"*10 + "-------" + "-"*10 + "\n"
9
+ end
10
+
11
+ def print_usage
12
+ puts <<EOF
13
+
14
+ Usage: selenium-cucumber <command-name> [parameters] [options]
15
+
16
+ <command-name> can be one of
17
+ help
18
+ prints more detailed help information.
19
+ gen
20
+ generate a features folder structure.
21
+ version
22
+ prints the gem version
23
+
24
+ <options> can be
25
+ -v, --verbose Turns on verbose logging
26
+ EOF
27
+ end
28
+
29
+ def print_help
30
+ puts <<EOF
31
+
32
+ Usage: selenium-cucumber <command-name> [parameters] [options]
33
+
34
+ <command-name> can be one of
35
+ help
36
+ gen
37
+ version
38
+
39
+ Commands:
40
+ help : prints more detailed help information.
41
+
42
+ gen : creates a skeleton features dir. This is usually used once when
43
+ setting up selnium-cucumber to ensure that the features folder contains
44
+ the right step definitions and environment to run with cucumber.
45
+
46
+ version : prints the gem version
47
+
48
+ <Options>
49
+ -v, --verbose Turns on verbose logging
50
+ EOF
51
51
  end
@@ -1,26 +1,26 @@
1
- #!/usr/bin/env ruby
2
-
3
- require_relative 'helper.rb'
4
- require_relative 'generate.rb'
5
- require 'selenium-cucumber/version'
6
-
7
- @features_dir = File.join(FileUtils.pwd, "features")
8
- @support_dir = File.join(@features_dir, "support")
9
- @source_dir = File.join(File.dirname(__FILE__), '..', 'features-skeleton')
10
-
11
- if (ARGV.length == 0)
12
- print_usage
13
- else
14
- cmd = ARGV.shift
15
-
16
- if cmd == "help"
17
- print_help
18
- elsif cmd == "gen"
19
- selenium_cucumber_scaffold
20
- elsif cmd == "version"
21
- puts Selenium::Cucumber::VERSION
22
- else
23
- print_usage
24
- end
25
- end
26
-
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative 'helper.rb'
4
+ require_relative 'generate.rb'
5
+ require 'selenium-cucumber/version'
6
+
7
+ @features_dir = File.join(FileUtils.pwd, "features")
8
+ @support_dir = File.join(@features_dir, "support")
9
+ @source_dir = File.join(File.dirname(__FILE__), '..', 'features-skeleton')
10
+
11
+ if (ARGV.length == 0)
12
+ print_usage
13
+ else
14
+ cmd = ARGV.shift
15
+
16
+ if cmd == "help"
17
+ print_help
18
+ elsif cmd == "gen"
19
+ selenium_cucumber_scaffold
20
+ elsif cmd == "version"
21
+ puts Selenium::Cucumber::VERSION
22
+ else
23
+ print_usage
24
+ end
25
+ end
26
+
data/doc/canned_steps.md CHANGED
@@ -1,361 +1,463 @@
1
- Canned Steps
2
- ============
3
- selenium-cucumber comes having the following set of predefined steps.
4
- You can add your own steps or change the ones you see here.
5
-
6
- Navigation Steps
7
- ----------------
8
- To open/close URL and to navigate between pages use following steps
9
-
10
- Then I navigate to "([^\"]*)"
11
- Then I navigate forward
12
- Then I navigate back
13
- Then I refresh page
14
-
15
- To interact with browser use following steps
16
-
17
- Then I resize browser window size to width (\d+) and heigth (\d+)
18
- Then I close browser
19
-
20
- To zoom in/out webpage use following steps
21
-
22
- Then I zoom in page
23
- Then I zoom out page
24
-
25
- To zoom out webpage till necessary element displays use following steps
26
-
27
- Then I zoom out page till I see element having id "(.*?)"
28
- Then I zoom out page till I see element having name "(.*?)"
29
- Then I zoom out page till I see element having class "(.*?)"
30
- Then I zoom out page till I see element having xpath "(.*?)"
31
- Then I zoom out page till I see element having css "(.*?)"
32
-
33
- To reset webpage view use following step
34
-
35
- Then I reset page view
36
-
37
- To scroll webpage use following step
38
-
39
- Then I scroll to element having id "(.*?)"
40
- Then I scroll to element having name "(.*?)"
41
- Then I scroll to element having class "(.*?)"
42
- Then I scroll to element having xpath "(.*?)"
43
- Then I scroll to element having css "(.*?)"
44
-
45
- To hover over a element use following step
46
-
47
- Then I hover over element having id "(.*?)"
48
- Then I hover over element having name "(.*?)"
49
- Then I hover over element having class "(.*?)"
50
- Then I hover over element having xpath "(.*?)"
51
- Then I hover over element having css "(.*?)"
52
-
53
-
54
- Assertion Steps
55
- ---------------
56
- To assert that page title can be found use following step.
57
-
58
- Then I should see page title as "(.*?)"
59
-
60
- To assert element text use any of the following steps.
61
-
62
- Then element having id "([^\"]*)" should have text as "(.*?)"
63
- Then element having name "([^\"]*)" should have text as "(.*?)"
64
- Then element having class "([^\"]*)" should have text as "(.*?)"
65
- Then element having xpath "([^\"]*)" should have text as "(.*?)"
66
- Then element having css "([^\"]*)" should have text as "(.*?)"
67
-
68
- Then element having id "([^\"]*)" should not have text as "(.*?)"
69
- Then element having name "([^\"]*)" should not have text as "(.*?)"
70
- Then element having class "([^\"]*)" should not have text as "(.*?)"
71
- Then element having xpath "([^\"]*)" should not have text as "(.*?)"
72
- Then element having css "([^\"]*)" should not have text as "(.*?)"
73
-
74
-
75
- To assert element attribute use any of the following steps.
76
-
77
- Then I should see attribute "(.*?)" having value "(.*?)" for element having id "(.*?)"
78
- Then I should see attribute "(.*?)" having value "(.*?)" for element having class "(.*?)"
79
- Then I should see attribute "(.*?)" having value "(.*?)" for element having name "(.*?)"
80
- Then I should see attribute "(.*?)" having value "(.*?)" for element having xpath "(.*?)"
81
- Then I should see attribute "(.*?)" having value "(.*?)" for element having css "(.*?)"
82
-
83
- Then I should not see attribute "(.*?)" having value "(.*?)" for element having id "(.*?)"
84
- Then I should not see attribute "(.*?)" having value "(.*?)" for element having class "(.*?)"
85
- Then I should not see attribute "(.*?)" having value "(.*?)" for element having name "(.*?)"
86
- Then I should not see attribute "(.*?)" having value "(.*?)" for element having xpath "(.*?)"
87
- Then I should not see attribute "(.*?)" having value "(.*?)" for element having css "(.*?)"
88
-
89
- To assert that element is enabled use any of the following steps.
90
-
91
- Then element having id "([^\"]*)" should be enabled
92
- Then element having name "([^\"]*)" should be enabled
93
- Then element having class "([^\"]*)" should be enabled
94
- Then element having xpath "([^\"]*)" should be enabled
95
- Then element having css "([^\"]*)" should be enabled
96
-
97
- To assert that element is disabled use any of the following steps.
98
-
99
- Then element having id "([^\"]*)" should be disabled
100
- Then element having name "([^\"]*)" should be disabled
101
- Then element having class "([^\"]*)" should be disabled
102
- Then element having xpath "([^\"]*)" should be disabled
103
- Then element having css "([^\"]*)" should be disabled
104
-
105
- To assert that element is present use any of the following steps.
106
-
107
- Then element having id "([^\"]*)" should be present
108
- Then element having name "([^\"]*)" should be present
109
- Then element having class "([^\"]*)" should be present
110
- Then element having xpath "([^\"]*)" should be present
111
- Then element having css "([^\"]*)" should be present
112
-
113
- To assert that element is not present use any of the following steps.
114
-
115
- Then element having id "([^\"]*)" should not be present
116
- Then element having name "([^\"]*)" should not be present
117
- Then element having class "([^\"]*)" should not be present
118
- Then element having xpath "([^\"]*)" should not be present
119
- Then element having css "([^\"]*)" should not be present
120
-
121
-
122
- To assert that checkbox is checked use any of the following steps.
123
-
124
- Then checkbox having id "(.*?)" should be checked
125
- Then checkbox having name "(.*?)" should be checked
126
- Then checkbox having class "(.*?)" should be checked
127
- Then checkbox having xpath "(.*?)" should be checked
128
- Then checkbox having css "(.*?)" should be checked
129
-
130
- To assert that checkbox is unchecked use any of the following steps.
131
-
132
- Then checkbox having id "(.*?)" should be unchecked
133
- Then checkbox having name "(.*?)" should be unchecked
134
- Then checkbox having class "(.*?)" should be unchecked
135
- Then checkbox having xpath "(.*?)" should be unchecked
136
- Then checkbox having css "(.*?)" should be unchecked
137
-
138
- To assert that radio button selected use any of the following steps.
139
-
140
- Then radio button having id "(.*?)" should be selected
141
- Then radio button having name "(.*?)" should be selected
142
- Then radio button having class "(.*?)" should be selected
143
- Then radio button having xpath "(.*?)" should be selected
144
- Then radio button having css "(.*?)" should be selected
145
-
146
- To assert that radio button not selected use any of the following steps.
147
-
148
- Then radio button having id "(.*?)" should be unselected
149
- Then radio button having name "(.*?)" should be unselected
150
- Then radio button having class "(.*?)" should be unselected
151
- Then radio button having xpath "(.*?)" should be unselected
152
- Then radio button having css "(.*?)" should be unselected
153
-
154
- To assert that radio button group selected by text use any of the following steps.
155
-
156
- Then option "(.*?)" by text from radio button group having id "(.*?)" should be selected
157
- Then option "(.*?)" by text from radio button group having name "(.*?)" should be selected
158
- Then option "(.*?)" by text from radio button group having class "(.*?)" should be selected
159
- Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be selected
160
- Then option "(.*?)" by text from radio button group having css "(.*?)" should be selected
161
-
162
- To assert that radio button group selected by value use any of the following steps.
163
-
164
- Then option "(.*?)" by value from radio button group having id "(.*?)" should be selected
165
- Then option "(.*?)" by value from radio button group having name "(.*?)" should be selected
166
- Then option "(.*?)" by value from radio button group having class "(.*?)" should be selected
167
- Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be selected
168
- Then option "(.*?)" by value from radio button group having css "(.*?)" should be selected
169
-
170
- To assert that radio button group not selected by text use any of the following steps.
171
-
172
- Then option "(.*?)" by text from radio button group having id "(.*?)" should be unselected
173
- Then option "(.*?)" by text from radio button group having name "(.*?)" should be unselected
174
- Then option "(.*?)" by text from radio button group having class "(.*?)" should be unselected
175
- Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be unselected
176
- Then option "(.*?)" by text from radio button group having css "(.*?)" should be unselected
177
-
178
- To assert that radio button group not selected by value use any of the following steps.
179
-
180
- Then option "(.*?)" by value from radio button group having id "(.*?)" should be unselected
181
- Then option "(.*?)" by value from radio button group having name "(.*?)" should be unselected
182
- Then option "(.*?)" by value from radio button group having class "(.*?)" should be unselected
183
- Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be unselected
184
- Then option "(.*?)" by value from radio button group having css "(.*?)" should be unselected
185
-
186
- To assert that link is present use following steps
187
-
188
- Then link having text "(.*?)" should be present
189
- Then link having partial text "(.*?)" should be present
190
-
191
- Then link having text "(.*?)" should not be present
192
- Then link having partial text "(.*?)" should not be present
193
-
194
- To assert text on javascipt pop-up alert
195
-
196
- Then I should see alert text as "(.*?)"
197
-
198
-
199
- Input Steps
200
- -----------
201
- To enter text into input field use following steps
202
-
203
- Then I enter "([^\"]*)" into input field having id "([^\"]*)
204
- Then I enter "([^\"]*)" into input field having name "([^\"]*)
205
- Then I enter "([^\"]*)" into input field having class "([^\"]*)
206
- Then I enter "([^\"]*)" into input field having xpath "([^\"]*)
207
- Then I enter "([^\"]*)" into input field having css "([^\"]*)
208
-
209
- To clear input field use following steps
210
-
211
- Then I clear input field having id "([^\"]*)
212
- Then I clear input field having name "([^\"]*)
213
- Then I clear input field having class "([^\"]*)
214
- Then I clear input field having xpath "([^\"]*)
215
- Then I clear input field having css "([^\"]*)
216
-
217
- To select option by text from dropdown/multiselect use following steps
218
-
219
- Then I select "(.*?)" option by text from dropdown having id "(.*?)"
220
- Then I select "(.*?)" option by text from dropdown having name "(.*?)"
221
- Then I select "(.*?)" option by text from dropdown having class "(.*?)"
222
- Then I select "(.*?)" option by text from dropdown having xpath "(.*?)"
223
- Then I select "(.*?)" option by text from dropdown having css "(.*?)"
224
-
225
- To select option by index from dropdown/multiselect use following steps
226
-
227
- Then I select (\d+) option by index from dropdown having id "(.*?)"
228
- Then I select (\d+) option by index from dropdown having name "(.*?)"
229
- Then I select (\d+) option by index from dropdown having class "(.*?)"
230
- Then I select (\d+) option by index from dropdown having xpath "(.*?)"
231
- Then I select (\d+) option by index from dropdown having css "(.*?)"
232
-
233
- To select option by value from dropdown/multiselect use following steps
234
-
235
- Then I select "(.*?)" option by value from dropdown having id "(.*?)"
236
- Then I select "(.*?)" option by value from dropdown having name "(.*?)"
237
- Then I select "(.*?)" option by value from dropdown having class "(.*?)"
238
- Then I select "(.*?)" option by value from dropdown having xpath "(.*?)"
239
- Then I select "(.*?)" option by value from dropdown having css "(.*?)"
240
-
241
- To unselect all option from dropdown/multiselect use following steps
242
-
243
- Then I unselect options from dropdown having id "(.*?)"
244
- Then I unselect options from dropdown having name "(.*?)"
245
- Then I unselect options from dropdown having class "(.*?)"
246
- Then I unselect options from dropdown having xpath "(.*?)"
247
- Then I unselect options from dropdown having css "(.*?)"
248
-
249
- To check checkbox use following steps
250
-
251
- Then I check checkbox having id "(.*?)"
252
- Then I check checkbox having name "(.*?)"
253
- Then I check checkbox having class "(.*?)"
254
- Then I check checkbox having xpath "(.*?)"
255
- Then I check checkbox having css "(.*?)"
256
-
257
- To uncheck checkbox use following steps
258
-
259
- Then I uncheck checkbox having id "(.*?)"
260
- Then I uncheck checkbox having name "(.*?)"
261
- Then I uncheck checkbox having class "(.*?)"
262
- Then I uncheck checkbox having xpath "(.*?)"
263
- Then I uncheck checkbox having css "(.*?)"
264
-
265
- To toggle checkbox use following steps
266
-
267
- Then I toggle checkbox having id "(.*?)"
268
- Then I toggle checkbox having name "(.*?)"
269
- Then I toggle checkbox having class "(.*?)"
270
- Then I toggle checkbox having xpath "(.*?)"
271
- Then I toggle checkbox having css "(.*?)"
272
-
273
- To select radio button use following steps
274
-
275
- Then I select radio button having id "(.*?)"
276
- Then I select radio button having name "(.*?)"
277
- Then I select radio button having class "(.*?)"
278
- Then I select radio button having xpath "(.*?)"
279
- Then I select radio button having css "(.*?)"
280
-
281
-
282
- To select one radio button by text from radio button group use following steps
283
-
284
- Then I select "(.*?)" option by text from radio button group having id "(.*?)"
285
- Then I select "(.*?)" option by text from radio button group having name "(.*?)"
286
- Then I select "(.*?)" option by text from radio button group having class "(.*?)"
287
- Then I select "(.*?)" option by text from radio button group having xpath "(.*?)"
288
- Then I select "(.*?)" option by text from radio button group having css "(.*?)"
289
-
290
- To select one radio button by value from radio button group use following steps
291
-
292
- Then I select "(.*?)" option by value from radio button group having id "(.*?)"
293
- Then I select "(.*?)" option by value from radio button group having name "(.*?)"
294
- Then I select "(.*?)" option by value from radio button group having class "(.*?)"
295
- Then I select "(.*?)" option by value from radio button group having xpath "(.*?)"
296
- Then I select "(.*?)" option by value from radio button group having css "(.*?)"
297
-
298
-
299
- Click Steps
300
- -----------
301
- To click on web element use following steps
302
-
303
- Then I click on element having id "(.*?)"
304
- Then I click on element having name "(.*?)"
305
- Then I click on element having class "(.*?)"
306
- Then I click on element having xpath "(.*?)"
307
- Then I click on element having css "(.*?)"
308
-
309
- To forcefully click on web element use following steps (if above steps not worked)
310
-
311
- Then I forcefully click on element having id "(.*?)"
312
- Then I forcefully click on element having name "(.*?)"
313
- Then I forcefully click on element having class "(.*?)"
314
- Then I forcefully click on element having xpath "(.*?)"
315
- Then I forcefully click on element having css "(.*?)"
316
-
317
- To click on links use following steps
318
-
319
- Then I click on link having text "(.*?)"
320
- Then I click on link having partial text "(.*?)"
321
-
322
- Progress Steps
323
- --------------
324
- To wait for specific time and for specific element to display use following steps
325
-
326
- Then I wait for (\d+) sec
327
- Then I wait "(.*?)" seconds for element to display having id "(.*?)"
328
- Then I wait "(.*?)" seconds for element to display having name "(.*?)"
329
- Then I wait "(.*?)" seconds for element to display having class "(.*?)"
330
- Then I wait "(.*?)" seconds for element to display having xpath "(.*?)"
331
- Then I wait "(.*?)" seconds for element to display having css "(.*?)"
332
-
333
- To wait for specific time and for specific element to enable use following steps
334
-
335
- Then I wait for (\d+) sec
336
- Then I wait "(.*?)" seconds for element to enable having id "(.*?)"
337
- Then I wait "(.*?)" seconds for element to enable having name "(.*?)"
338
- Then I wait "(.*?)" seconds for element to enable having class "(.*?)"
339
- Then I wait "(.*?)" seconds for element to enable having xpath "(.*?)"
340
- Then I wait "(.*?)" seconds for element to enable having css "(.*?)"
341
-
342
- Javascript Handling Steps
343
- -------------------------
344
- To handle javascript pop-up use following steps
345
-
346
- Then I accept alert
347
- Then I dismiss alert
348
-
349
-
350
- Screenshot Steps
351
- ----------------
352
- To take screenshot use following step
353
-
354
- Then I take screenshot
355
-
356
-
357
- Configuration Steps
358
- -------------------
359
- To print testing configuration use following step
360
-
361
- Then I print configuration
1
+ # Canned Steps
2
+
3
+ selenium-cucumber comes with the following set of predefined steps.
4
+ You can add your own steps or change the ones you see here.
5
+
6
+ ## Navigation Steps
7
+
8
+ To open/close URL and to navigate between pages use following steps :
9
+
10
+ Then I navigate to "([^\"]*)"
11
+ Then I navigate forward
12
+ Then I navigate back
13
+ Then I refresh page
14
+
15
+ To interact with browser use following steps :
16
+
17
+ Then I resize browser window size to width (\d+) and height (\d+)
18
+ Then I maximize browser window
19
+ Then I close browser
20
+
21
+ To zoom in/out webpage use following steps :
22
+
23
+ Then I zoom in page
24
+ Then I zoom out page
25
+
26
+ To zoom out webpage till necessary element displays use following steps :
27
+
28
+ Then I zoom out page till I see element having id "(.*?)"
29
+ Then I zoom out page till I see element having name "(.*?)"
30
+ Then I zoom out page till I see element having class "(.*?)"
31
+ Then I zoom out page till I see element having xpath "(.*?)"
32
+ Then I zoom out page till I see element having css "(.*?)"
33
+
34
+ To reset webpage view use following step :
35
+
36
+ Then I reset page view
37
+
38
+ To scroll webpage use following steps :
39
+
40
+ Then I scroll to top of page
41
+ Then I scroll to end of page
42
+
43
+ To scroll webpage to specific element use following steps :
44
+
45
+ Then I scroll to element having id "(.*?)"
46
+ Then I scroll to element having name "(.*?)"
47
+ Then I scroll to element having class "(.*?)"
48
+ Then I scroll to element having xpath "(.*?)"
49
+ Then I scroll to element having css "(.*?)"
50
+
51
+ To hover over a element use following steps :
52
+
53
+ Then I hover over element having id "(.*?)"
54
+ Then I hover over element having name "(.*?)"
55
+ Then I hover over element having class "(.*?)"
56
+ Then I hover over element having xpath "(.*?)"
57
+ Then I hover over element having css "(.*?)"
58
+
59
+
60
+ Assertion Steps
61
+ ---------------
62
+ To assert that page title can be found use following step :
63
+
64
+ Then I should see page title as "(.*?)"
65
+
66
+ #### Steps For Asserting Element Text
67
+
68
+ To assert element text use any of the following steps :
69
+
70
+ Then element having id "([^\"]*)" should have text as "(.*?)"
71
+ Then element having name "([^\"]*)" should have text as "(.*?)"
72
+ Then element having class "([^\"]*)" should have text as "(.*?)"
73
+ Then element having xpath "([^\"]*)" should have text as "(.*?)"
74
+ Then element having css "([^\"]*)" should have text as "(.*?)"
75
+
76
+ Then element having id "([^\"]*)" should not have text as "(.*?)"
77
+ Then element having name "([^\"]*)" should not have text as "(.*?)"
78
+ Then element having class "([^\"]*)" should not have text as "(.*?)"
79
+ Then element having xpath "([^\"]*)" should not have text as "(.*?)"
80
+ Then element having css "([^\"]*)" should not have text as "(.*?)"
81
+
82
+ #### Steps For Asserting Element Attribute
83
+
84
+ To assert element attribute use any of the following steps :
85
+
86
+ Then element having id "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
87
+ Then element having name "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
88
+ Then element having class "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
89
+ Then element having xpath "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
90
+ Then element having css "([^\"]*)" should have attribute "(.*?)" with value "(.*?)"
91
+
92
+ Then element having id "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
93
+ Then element having name "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
94
+ Then element having class "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
95
+ Then element having xpath "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
96
+ Then element having css "([^\"]*)" should not have attribute "(.*?)" with value "(.*?)"
97
+
98
+
99
+ #### Steps For Asserting Element Accesibility
100
+
101
+ To assert that element is enabled use any of the following steps :
102
+
103
+ Then element having id "([^\"]*)" should be enabled
104
+ Then element having name "([^\"]*)" should be enabled
105
+ Then element having class "([^\"]*)" should be enabled
106
+ Then element having xpath "([^\"]*)" should be enabled
107
+ Then element having css "([^\"]*)" should be enabled
108
+
109
+ To assert that element is disabled use any of the following steps :
110
+
111
+ Then element having id "([^\"]*)" should be disabled
112
+ Then element having name "([^\"]*)" should be disabled
113
+ Then element having class "([^\"]*)" should be disabled
114
+ Then element having xpath "([^\"]*)" should be disabled
115
+ Then element having css "([^\"]*)" should be disabled
116
+
117
+ #### Steps For Asserting Element Visibility
118
+
119
+ To assert that element is present use any of the following steps :
120
+
121
+ Then element having id "([^\"]*)" should be present
122
+ Then element having name "([^\"]*)" should be present
123
+ Then element having class "([^\"]*)" should be present
124
+ Then element having xpath "([^\"]*)" should be present
125
+ Then element having css "([^\"]*)" should be present
126
+
127
+ To assert that element is not present use any of the following steps:
128
+
129
+ Then element having id "([^\"]*)" should not be present
130
+ Then element having name "([^\"]*)" should not be present
131
+ Then element having class "([^\"]*)" should not be present
132
+ Then element having xpath "([^\"]*)" should not be present
133
+ Then element having css "([^\"]*)" should not be present
134
+
135
+ #### Steps For Asserting Checkbox
136
+
137
+ To assert that checkbox is checked use any of the following steps :
138
+
139
+ Then checkbox having id "(.*?)" should be checked
140
+ Then checkbox having name "(.*?)" should be checked
141
+ Then checkbox having class "(.*?)" should be checked
142
+ Then checkbox having xpath "(.*?)" should be checked
143
+ Then checkbox having css "(.*?)" should be checked
144
+
145
+ To assert that checkbox is unchecked use any of the following steps :
146
+
147
+ Then checkbox having id "(.*?)" should be unchecked
148
+ Then checkbox having name "(.*?)" should be unchecked
149
+ Then checkbox having class "(.*?)" should be unchecked
150
+ Then checkbox having xpath "(.*?)" should be unchecked
151
+ Then checkbox having css "(.*?)" should be unchecked
152
+
153
+ #### Steps For Asserting Dropdown List
154
+
155
+ To assert that option by text from dropdown list selected use following steps :
156
+
157
+ Then option "(.*?)" by text from dropdown having id "(.*?)" should be selected
158
+ Then option "(.*?)" by text from dropdown having name "(.*?)" should be selected
159
+ Then option "(.*?)" by text from dropdown having class "(.*?)" should be selected
160
+ Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be selected
161
+ Then option "(.*?)" by text from dropdown having css "(.*?)" should be selected
162
+
163
+ To assert that option by value from dropdown list selected use following steps :
164
+
165
+ Then option "(.*?)" by value from dropdown having id "(.*?)" should be selected
166
+ Then option "(.*?)" by value from dropdown having name "(.*?)" should be selected
167
+ Then option "(.*?)" by value from dropdown having class "(.*?)" should be selected
168
+ Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be selected
169
+ Then option "(.*?)" by value from dropdown having css "(.*?)" should be selected
170
+
171
+ To assert that option by text from dropdown list unselected use following steps :
172
+
173
+ Then option "(.*?)" by text from dropdown having id "(.*?)" should be unselected
174
+ Then option "(.*?)" by text from dropdown having name "(.*?)" should be unselected
175
+ Then option "(.*?)" by text from dropdown having class "(.*?)" should be unselected
176
+ Then option "(.*?)" by text from dropdown having xpath "(.*?)" should be unselected
177
+ Then option "(.*?)" by text from dropdown having css "(.*?)" should be unselected
178
+
179
+ To assert that option by value from dropdown list unselected use following steps :
180
+
181
+ Then option "(.*?)" by value from dropdown having id "(.*?)" should be unselected
182
+ Then option "(.*?)" by value from dropdown having name "(.*?)" should be unselected
183
+ Then option "(.*?)" by value from dropdown having class "(.*?)" should be unselected
184
+ Then option "(.*?)" by value from dropdown having xpath "(.*?)" should be unselected
185
+ Then option "(.*?)" by value from dropdown having css "(.*?)" should be unselected
186
+
187
+ #### Steps For Asserting Radio Button
188
+
189
+ To assert that radio button selected use any of the following steps :
190
+
191
+ Then radio button having id "(.*?)" should be selected
192
+ Then radio button having name "(.*?)" should be selected
193
+ Then radio button having class "(.*?)" should be selected
194
+ Then radio button having xpath "(.*?)" should be selected
195
+ Then radio button having css "(.*?)" should be selected
196
+
197
+ To assert that radio button not selected use any of the following steps :
198
+
199
+ Then radio button having id "(.*?)" should be unselected
200
+ Then radio button having name "(.*?)" should be unselected
201
+ Then radio button having class "(.*?)" should be unselected
202
+ Then radio button having xpath "(.*?)" should be unselected
203
+ Then radio button having css "(.*?)" should be unselected
204
+
205
+ To assert that radio button group selected by text use any of the following steps :
206
+
207
+ Then option "(.*?)" by text from radio button group having id "(.*?)" should be selected
208
+ Then option "(.*?)" by text from radio button group having name "(.*?)" should be selected
209
+ Then option "(.*?)" by text from radio button group having class "(.*?)" should be selected
210
+ Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be selected
211
+ Then option "(.*?)" by text from radio button group having css "(.*?)" should be selected
212
+
213
+ To assert that radio button group selected by value use any of the following steps :
214
+
215
+ Then option "(.*?)" by value from radio button group having id "(.*?)" should be selected
216
+ Then option "(.*?)" by value from radio button group having name "(.*?)" should be selected
217
+ Then option "(.*?)" by value from radio button group having class "(.*?)" should be selected
218
+ Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be selected
219
+ Then option "(.*?)" by value from radio button group having css "(.*?)" should be selected
220
+
221
+ To assert that radio button group not selected by text use any of the following steps :
222
+
223
+ Then option "(.*?)" by text from radio button group having id "(.*?)" should be unselected
224
+ Then option "(.*?)" by text from radio button group having name "(.*?)" should be unselected
225
+ Then option "(.*?)" by text from radio button group having class "(.*?)" should be unselected
226
+ Then option "(.*?)" by text from radio button group having xpath "(.*?)" should be unselected
227
+ Then option "(.*?)" by text from radio button group having css "(.*?)" should be unselected
228
+
229
+ To assert that radio button group not selected by value use any of the following steps :
230
+
231
+ Then option "(.*?)" by value from radio button group having id "(.*?)" should be unselected
232
+ Then option "(.*?)" by value from radio button group having name "(.*?)" should be unselected
233
+ Then option "(.*?)" by value from radio button group having class "(.*?)" should be unselected
234
+ Then option "(.*?)" by value from radio button group having xpath "(.*?)" should be unselected
235
+ Then option "(.*?)" by value from radio button group having css "(.*?)" should be unselected
236
+
237
+ #### Steps For Asserting Links
238
+
239
+ To assert that link is present use following steps :
240
+
241
+ Then link having text "(.*?)" should be present
242
+ Then link having partial text "(.*?)" should be present
243
+
244
+ To assert that link is not present use following steps :
245
+
246
+ Then link having text "(.*?)" should not be present
247
+ Then link having partial text "(.*?)" should not be present
248
+
249
+ #### Steps For Asserting Javascript Pop-Up Alert
250
+
251
+ To assert text on javascipt pop-up alert use following step :
252
+
253
+ Then I should see alert text as "(.*?)"
254
+
255
+
256
+ Input Steps
257
+ -----------
258
+
259
+ #### Steps For TextFields
260
+
261
+ To enter text into input field use following steps :
262
+
263
+ Then I enter "([^\"]*)" into input field having id "([^\"]*)"
264
+ Then I enter "([^\"]*)" into input field having name "([^\"]*)"
265
+ Then I enter "([^\"]*)" into input field having class "([^\"]*)"
266
+ Then I enter "([^\"]*)" into input field having xpath "([^\"]*)"
267
+ Then I enter "([^\"]*)" into input field having css "([^\"]*)"
268
+
269
+ To clear input field use following steps :
270
+
271
+ Then I clear input field having id "([^\"]*)"
272
+ Then I clear input field having name "([^\"]*)"
273
+ Then I clear input field having class "([^\"]*)"
274
+ Then I clear input field having xpath "([^\"]*)"
275
+ Then I clear input field having css "([^\"]*)"
276
+
277
+ #### Steps For Dropdown List
278
+
279
+ To select option by text from dropdown use following steps :
280
+
281
+ Then I select "(.*?)" option by text from dropdown having id "(.*?)"
282
+ Then I select "(.*?)" option by text from dropdown having name "(.*?)"
283
+ Then I select "(.*?)" option by text from dropdown having class "(.*?)"
284
+ Then I select "(.*?)" option by text from dropdown having xpath "(.*?)"
285
+ Then I select "(.*?)" option by text from dropdown having css "(.*?)"
286
+
287
+ To select option by index from dropdown use following steps :
288
+
289
+ Then I select (\d+) option by index from dropdown having id "(.*?)"
290
+ Then I select (\d+) option by index from dropdown having name "(.*?)"
291
+ Then I select (\d+) option by index from dropdown having class "(.*?)"
292
+ Then I select (\d+) option by index from dropdown having xpath "(.*?)"
293
+ Then I select (\d+) option by index from dropdown having css "(.*?)"
294
+
295
+ To select option by value from dropdown use following steps :
296
+
297
+ Then I select "(.*?)" option by value from dropdown having id "(.*?)"
298
+ Then I select "(.*?)" option by value from dropdown having name "(.*?)"
299
+ Then I select "(.*?)" option by value from dropdown having class "(.*?)"
300
+ Then I select "(.*?)" option by value from dropdown having xpath "(.*?)"
301
+ Then I select "(.*?)" option by value from dropdown having css "(.*?)"
302
+
303
+ #### Steps For Multiselect List
304
+
305
+ To select option by text from multiselect dropdown use following steps :
306
+
307
+ Then I select "(.*?)" option by text from multiselect dropdown having id "(.*?)"
308
+ Then I select "(.*?)" option by text from multiselect dropdown having name "(.*?)"
309
+ Then I select "(.*?)" option by text from multiselect dropdown having class "(.*?)"
310
+ Then I select "(.*?)" option by text from multiselect dropdown having xpath "(.*?)"
311
+ Then I select "(.*?)" option by text from multiselect dropdown having css "(.*?)"
312
+
313
+ To select option by index from multiselect dropdown use following steps :
314
+
315
+ Then I select (\d+) option by index from multiselect dropdown having id "(.*?)"
316
+ Then I select (\d+) option by index from multiselect dropdown having name "(.*?)"
317
+ Then I select (\d+) option by index from multiselect dropdown having class "(.*?)"
318
+ Then I select (\d+) option by index from multiselect dropdown having xpath "(.*?)"
319
+ Then I select (\d+) option by index from multiselect dropdown having css "(.*?)"
320
+
321
+ To select option by value from multiselect dropdown use following steps :
322
+
323
+ Then I select "(.*?)" option by value from multiselect dropdown having id "(.*?)"
324
+ Then I select "(.*?)" option by value from multiselect dropdown having name "(.*?)"
325
+ Then I select "(.*?)" option by value from multiselect dropdown having class "(.*?)"
326
+ Then I select "(.*?)" option by value from multiselect dropdown having xpath "(.*?)"
327
+ Then I select "(.*?)" option by value from multiselect dropdown having css "(.*?)"
328
+
329
+ To select all options from multiselect use following steps :
330
+
331
+ Then I select all options from multiselect dropdown having id "(.*?)"
332
+ Then I select all options from multiselect dropdown having name "(.*?)"
333
+ Then I select all options from multiselect dropdown having class "(.*?)"
334
+ Then I select all options from multiselect dropdown having xpath "(.*?)"
335
+ Then I select all options from multiselect dropdown having css "(.*?)"
336
+
337
+ To unselect all options from multiselect use following steps :
338
+
339
+ Then I unselect all options from mutliselect dropdown having id "(.*?)"
340
+ Then I unselect all options from mutliselect dropdown having name "(.*?)"
341
+ Then I unselect all options from mutliselect dropdown having class "(.*?)"
342
+ Then I unselect all options from mutliselect dropdown having xpath "(.*?)"
343
+ Then I unselect all options from mutliselect dropdown having css "(.*?)"
344
+
345
+ #### Steps For Checkboxes
346
+
347
+ To check the checkbox use following steps :
348
+
349
+ Then I check the checkbox having id "(.*?)"
350
+ Then I check the checkbox having name "(.*?)"
351
+ Then I check the checkbox having class "(.*?)"
352
+ Then I check the checkbox having xpath "(.*?)"
353
+ Then I check the checkbox having css "(.*?)"
354
+
355
+ To uncheck the checkbox use following steps :
356
+
357
+ Then I uncheck the checkbox having id "(.*?)"
358
+ Then I uncheck the checkbox having name "(.*?)"
359
+ Then I uncheck the checkbox having class "(.*?)"
360
+ Then I uncheck the checkbox having xpath "(.*?)"
361
+ Then I uncheck the checkbox having css "(.*?)"
362
+
363
+ To toggle checkbox use following steps
364
+
365
+ Then I toggle checkbox having id "(.*?)"
366
+ Then I toggle checkbox having name "(.*?)"
367
+ Then I toggle checkbox having class "(.*?)"
368
+ Then I toggle checkbox having xpath "(.*?)"
369
+ Then I toggle checkbox having css "(.*?)"
370
+
371
+ #### Steps For Radio Buttons
372
+
373
+ To select radio button use following steps :
374
+
375
+ Then I select radio button having id "(.*?)"
376
+ Then I select radio button having name "(.*?)"
377
+ Then I select radio button having class "(.*?)"
378
+ Then I select radio button having xpath "(.*?)"
379
+ Then I select radio button having css "(.*?)"
380
+
381
+
382
+ To select one radio button by text from radio button group use following steps :
383
+
384
+ Then I select "(.*?)" option by text from radio button group having id "(.*?)"
385
+ Then I select "(.*?)" option by text from radio button group having name "(.*?)"
386
+ Then I select "(.*?)" option by text from radio button group having class "(.*?)"
387
+ Then I select "(.*?)" option by text from radio button group having xpath "(.*?)"
388
+ Then I select "(.*?)" option by text from radio button group having css "(.*?)"
389
+
390
+ To select one radio button by value from radio button group use following steps :
391
+
392
+ Then I select "(.*?)" option by value from radio button group having id "(.*?)"
393
+ Then I select "(.*?)" option by value from radio button group having name "(.*?)"
394
+ Then I select "(.*?)" option by value from radio button group having class "(.*?)"
395
+ Then I select "(.*?)" option by value from radio button group having xpath "(.*?)"
396
+ Then I select "(.*?)" option by value from radio button group having css "(.*?)"
397
+
398
+
399
+ Click Steps
400
+ -----------
401
+ To click on web element use following steps :
402
+
403
+ Then I click on element having id "(.*?)"
404
+ Then I click on element having name "(.*?)"
405
+ Then I click on element having class "(.*?)"
406
+ Then I click on element having xpath "(.*?)"
407
+ Then I click on element having css "(.*?)"
408
+
409
+ To forcefully click on web element use following steps (if above steps do not work) :
410
+
411
+ Then I forcefully click on element having id "(.*?)"
412
+ Then I forcefully click on element having name "(.*?)"
413
+ Then I forcefully click on element having class "(.*?)"
414
+ Then I forcefully click on element having xpath "(.*?)"
415
+ Then I forcefully click on element having css "(.*?)"
416
+
417
+ To click on links use following steps :
418
+
419
+ Then I click on link having text "(.*?)"
420
+ Then I click on link having partial text "(.*?)"
421
+
422
+ Progress Steps
423
+ --------------
424
+ To wait for specific time use following step :
425
+
426
+ Then I wait for (\d+) sec
427
+
428
+ To wait for specific element to display use following steps :
429
+
430
+ Then I wait (\d+) seconds for element to display having id "(.*?)"
431
+ Then I wait (\d+) seconds for element to display having name "(.*?)"
432
+ Then I wait (\d+) seconds for element to display having class "(.*?)"
433
+ Then I wait (\d+) seconds for element to display having xpath "(.*?)"
434
+ Then I wait (\d+) seconds for element to display having css "(.*?)"
435
+
436
+ To wait for specific element to enable use following steps :
437
+
438
+ Then I wait (\d+) seconds for element to enable having id "(.*?)"
439
+ Then I wait (\d+) seconds for element to enable having name "(.*?)"
440
+ Then I wait (\d+) seconds for element to enable having class "(.*?)"
441
+ Then I wait (\d+) seconds for element to enable having xpath "(.*?)"
442
+ Then I wait (\d+) seconds for element to enable having css "(.*?)"
443
+
444
+ Javascript Handling Steps
445
+ -------------------------
446
+ To handle javascript pop-up use following steps :
447
+
448
+ Then I accept alert
449
+ Then I dismiss alert
450
+
451
+
452
+ Screenshot Steps
453
+ ----------------
454
+ To take screenshot use following step :
455
+
456
+ Then I take screenshot
457
+
458
+
459
+ Configuration Steps
460
+ -------------------
461
+ To print testing configuration use following step :
462
+
463
+ Then I print configuration