selenium-cucumber 0.0.8 → 0.0.9
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.
- data/bin/generate.rb +20 -20
- data/bin/helper.rb +50 -50
- data/bin/selenium-cucumber +26 -26
- data/doc/canned_steps.md +463 -361
- data/doc/installation.md +16 -13
- data/doc/selenium-cucumber-API.md +81 -78
- data/doc/selenium-cucumber-help.md +18 -18
- data/features-skeleton/my_first.feature +5 -5
- data/features-skeleton/step_definitions/custom_steps.rb +4 -4
- data/features-skeleton/support/env.rb +38 -38
- data/features-skeleton/support/hooks.rb +33 -33
- data/lib/selenium-cucumber.rb +2 -2
- data/lib/selenium-cucumber/assertion_steps.rb +11 -4
- data/lib/selenium-cucumber/input_steps.rb +20 -24
- data/lib/selenium-cucumber/methods/assertion_methods.rb +19 -0
- data/lib/selenium-cucumber/methods/input_methods.rb +11 -4
- data/lib/selenium-cucumber/methods/navigate_methods.rb +29 -8
- data/lib/selenium-cucumber/navigation_steps.rb +11 -1
- data/lib/selenium-cucumber/version.rb +1 -1
- metadata +2 -3
- data/doc/selenium-cucumber-help.txt +0 -16
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
|
data/bin/selenium-cucumber
CHANGED
@@ -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
|
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
|
18
|
-
Then I
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Then I zoom
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
Then I zoom out page till I see element having
|
29
|
-
Then I zoom out page till I see element having
|
30
|
-
Then I zoom out page till I see element having
|
31
|
-
Then I zoom out page till I see element having
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
Then I scroll to
|
41
|
-
Then I scroll to
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Then I
|
48
|
-
Then I
|
49
|
-
Then I
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
Then
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
Then element having
|
71
|
-
Then element having
|
72
|
-
Then element having
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
Then
|
78
|
-
Then
|
79
|
-
Then
|
80
|
-
Then
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
Then
|
87
|
-
Then
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
Then element having
|
93
|
-
Then element having
|
94
|
-
Then element having
|
95
|
-
Then element having
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
Then element having
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
Then element having
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
Then element having
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
Then element having
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
Then
|
125
|
-
Then
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
Then
|
133
|
-
Then
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
Then
|
141
|
-
Then
|
142
|
-
Then
|
143
|
-
Then
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
Then
|
149
|
-
Then
|
150
|
-
Then
|
151
|
-
Then
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
Then option "(.*?)" by text from
|
158
|
-
Then option "(.*?)" by text from
|
159
|
-
Then option "(.*?)" by text from
|
160
|
-
Then option "(.*?)" by text from
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
Then option "(.*?)" by value from
|
166
|
-
Then option "(.*?)" by value from
|
167
|
-
Then option "(.*?)" by value from
|
168
|
-
Then option "(.*?)" by value from
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
Then option "(.*?)" by text from
|
174
|
-
Then option "(.*?)" by text from
|
175
|
-
Then option "(.*?)" by text from
|
176
|
-
Then option "(.*?)" by text from
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
Then option "(.*?)" by value from
|
182
|
-
Then option "(.*?)" by value from
|
183
|
-
Then option "(.*?)" by value from
|
184
|
-
Then option "(.*?)" by value from
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
Then
|
192
|
-
Then
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
Then
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
Then
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
Then
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
Then
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
Then
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
Then
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
Then
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
Then
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
Then
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
Then
|
247
|
-
Then
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
Then I
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
Then I
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
Then I
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
Then I
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
Then I
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
Then I select "(.*?)" option by text from
|
285
|
-
Then I select "(.*?)" option by text from
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
Then I select
|
293
|
-
Then I select
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
Then I
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
Then I
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
Then I
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
Then I
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
Then I
|
327
|
-
Then I
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
Then I
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
Then I
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
Then I
|
340
|
-
Then I
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
Then I
|
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
|