selenium-cucumber 0.1.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/bin/generate.rb +20 -20
  3. data/bin/helper.rb +50 -50
  4. data/bin/selenium-cucumber +30 -29
  5. data/doc/canned_steps.md +8 -0
  6. data/doc/installation.md +16 -16
  7. data/doc/selenium-cucumber-help.md +18 -18
  8. data/example/Gemfile +5 -0
  9. data/example/Gemfile.lock +36 -0
  10. data/{Example/image_difference → example/features/actual_images}/test.png +0 -0
  11. data/{Example → example}/features/assertion_steps_Ex.feature +22 -10
  12. data/{Example → example}/features/click_steps_Ex.feature +0 -0
  13. data/{Example → example}/features/configuration_step_Ex.feature +1 -2
  14. data/example/features/expected_images/logo-PNG.png +0 -0
  15. data/example/features/expected_images/original_image.jpg +0 -0
  16. data/{Example/screenshots → example/features/image_difference}/test.png +0 -0
  17. data/{Example → example}/features/input_steps_Ex.feature +0 -0
  18. data/{Example → example}/features/javascript_steps_Ex.feature +0 -0
  19. data/{Example → example}/features/navigation_steps_Ex.feature +3 -3
  20. data/{Example → example}/features/progress_step_Ex.feature +0 -0
  21. data/{Example → example}/features/screenshot_step_Ex.feature +5 -1
  22. data/example/features/screenshots/test.png +0 -0
  23. data/{Example → example}/features/step_definitions/custom_steps.rb +0 -0
  24. data/{Example → example}/features/support/env.rb +0 -1
  25. data/{Example → example}/features/support/hooks.rb +0 -0
  26. data/example/run_features.rb +42 -0
  27. data/example/test_page.html +218 -0
  28. data/features-skeleton/actual_images/test.png +0 -0
  29. data/features-skeleton/my_first.feature +5 -5
  30. data/features-skeleton/step_definitions/custom_steps.rb +4 -4
  31. data/features-skeleton/support/env.rb +38 -38
  32. data/features-skeleton/support/hooks.rb +37 -33
  33. data/lib/selenium-cucumber.rb +2 -2
  34. data/lib/selenium-cucumber/assertion_steps.rb +25 -27
  35. data/lib/selenium-cucumber/click_elements_steps.rb +9 -12
  36. data/lib/selenium-cucumber/configuration_steps.rb +3 -4
  37. data/lib/selenium-cucumber/input_steps.rb +26 -26
  38. data/lib/selenium-cucumber/javascript_handling_steps.rb +3 -3
  39. data/lib/selenium-cucumber/methods/assertion_methods.rb +197 -160
  40. data/lib/selenium-cucumber/methods/click_elements_methods.rb +8 -8
  41. data/lib/selenium-cucumber/methods/configuration_methods.rb +10 -5
  42. data/lib/selenium-cucumber/methods/input_methods.rb +32 -45
  43. data/lib/selenium-cucumber/methods/javascript_handling_methods.rb +7 -7
  44. data/lib/selenium-cucumber/methods/misc_methods.rb +6 -6
  45. data/lib/selenium-cucumber/methods/navigate_methods.rb +37 -41
  46. data/lib/selenium-cucumber/methods/progress_methods.rb +8 -8
  47. data/lib/selenium-cucumber/methods/required_files.rb +1 -1
  48. data/lib/selenium-cucumber/methods/screenshot_methods.rb +3 -3
  49. data/lib/selenium-cucumber/navigation_steps.rb +20 -22
  50. data/lib/selenium-cucumber/progress_steps.rb +5 -8
  51. data/lib/selenium-cucumber/screenshot_steps.rb +2 -2
  52. data/lib/selenium-cucumber/version.rb +1 -1
  53. metadata +23 -27
  54. data/Example/expected_images/flower.png +0 -0
  55. data/Example/expected_images/flower1.png +0 -0
  56. data/Example/features/new.feature +0 -7
  57. data/Example/image_difference/difference_20140814210820942.png +0 -0
  58. data/Example/image_difference/difference_20140815095331224.png +0 -0
  59. data/Example/image_difference/difference_20140815100021133.png +0 -0
  60. data/Example/image_difference/difference_20140815100348774.png +0 -0
  61. data/Example/run_features.rb +0 -42
  62. data/Example/screenshots/screenshot20140815095553337.png +0 -0
  63. data/Example/screenshots/screenshot20140815100120197.png +0 -0
  64. data/Example/screenshots/screenshot20140815100446914.png +0 -0
  65. data/Example/test_page.html +0 -206
@@ -2,20 +2,17 @@ require_relative 'methods/progress_methods'
2
2
 
3
3
  # wait for specific period of time
4
4
  Then(/^I wait for (\d+) sec$/) do |time|
5
- wait(time)
5
+ wait(time)
6
6
  end
7
7
 
8
8
  # wait for specific element to display for specific period of time
9
-
10
9
  Then(/^I wait (\d+) seconds for element having (.+) "(.*?)" to display$/) do |duration, type, access_name|
11
- validate_locator type
12
- wait_for_element_to_display(type,access_name,duration)
10
+ validate_locator type
11
+ wait_for_element_to_display(type, access_name, duration)
13
12
  end
14
13
 
15
14
  # wait for specific element to enable for specific period of time
16
-
17
15
  Then(/^I wait (\d+) seconds for element having (.+) "(.*?)" to enable$/) do |duration, type, access_name|
18
- validate_locator type
19
- wait_for_element_to_enable(type,access_name,duration)
16
+ validate_locator type
17
+ wait_for_element_to_enable(type, access_name, duration)
20
18
  end
21
-
@@ -1,5 +1,5 @@
1
1
  require_relative 'methods/screenshot_methods'
2
2
 
3
3
  Then(/^I take screenshot$/) do
4
- take_screenshot
5
- end
4
+ take_screenshot
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Selenium
2
2
  module Cucumber
3
- VERSION = "0.1.1"
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sameer Sawant
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-18 00:00:00.000000000 Z
11
+ date: 2014-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -88,6 +88,7 @@ files:
88
88
  - doc/installation.md
89
89
  - doc/selenium-cucumber-API.md
90
90
  - doc/selenium-cucumber-help.md
91
+ - features-skeleton/actual_images/test.png
91
92
  - features-skeleton/expected_images/test.png
92
93
  - features-skeleton/image_difference/test.png
93
94
  - features-skeleton/my_first.feature
@@ -95,31 +96,26 @@ files:
95
96
  - features-skeleton/step_definitions/custom_steps.rb
96
97
  - features-skeleton/support/env.rb
97
98
  - features-skeleton/support/hooks.rb
98
- - Example/expected_images/flower.png
99
- - Example/expected_images/flower1.png
100
- - Example/features/assertion_steps_Ex.feature
101
- - Example/features/click_steps_Ex.feature
102
- - Example/features/configuration_step_Ex.feature
103
- - Example/features/input_steps_Ex.feature
104
- - Example/features/javascript_steps_Ex.feature
105
- - Example/features/navigation_steps_Ex.feature
106
- - Example/features/new.feature
107
- - Example/features/progress_step_Ex.feature
108
- - Example/features/screenshot_step_Ex.feature
109
- - Example/features/step_definitions/custom_steps.rb
110
- - Example/features/support/env.rb
111
- - Example/features/support/hooks.rb
112
- - Example/image_difference/difference_20140814210820942.png
113
- - Example/image_difference/difference_20140815095331224.png
114
- - Example/image_difference/difference_20140815100021133.png
115
- - Example/image_difference/difference_20140815100348774.png
116
- - Example/image_difference/test.png
117
- - Example/run_features.rb
118
- - Example/screenshots/screenshot20140815095553337.png
119
- - Example/screenshots/screenshot20140815100120197.png
120
- - Example/screenshots/screenshot20140815100446914.png
121
- - Example/screenshots/test.png
122
- - Example/test_page.html
99
+ - example/features/actual_images/test.png
100
+ - example/features/assertion_steps_Ex.feature
101
+ - example/features/click_steps_Ex.feature
102
+ - example/features/configuration_step_Ex.feature
103
+ - example/features/expected_images/logo-PNG.png
104
+ - example/features/expected_images/original_image.jpg
105
+ - example/features/image_difference/test.png
106
+ - example/features/input_steps_Ex.feature
107
+ - example/features/javascript_steps_Ex.feature
108
+ - example/features/navigation_steps_Ex.feature
109
+ - example/features/progress_step_Ex.feature
110
+ - example/features/screenshots/test.png
111
+ - example/features/screenshot_step_Ex.feature
112
+ - example/features/step_definitions/custom_steps.rb
113
+ - example/features/support/env.rb
114
+ - example/features/support/hooks.rb
115
+ - example/Gemfile
116
+ - example/Gemfile.lock
117
+ - example/run_features.rb
118
+ - example/test_page.html
123
119
  homepage: http://seleniumcucumber.wordpress.com/
124
120
  licenses:
125
121
  - MIT
Binary file
Binary file
@@ -1,7 +0,0 @@
1
- Feature: Assertion Steps
2
- As a user I should able to verify using assert steps
3
-
4
- Scenario: Open test page
5
- Given I open test page
6
-
7
-
@@ -1,42 +0,0 @@
1
- require 'selenium-webdriver'
2
-
3
- puts ARGV[0]
4
-
5
- OS=Selenium::WebDriver::Platform.os
6
-
7
- if (ARGV.length == 0)
8
-
9
- puts "\n\n\t###### Running all features on firefox browser ######\n\n"
10
- system("cucumber")
11
-
12
- puts "\n\n\t###### Running all features on chrome browser ###### \n\n"
13
- system("cucumber BROWSER=chrome")
14
-
15
- if OS.to_s=="windows"
16
- puts "Running all features on internet explorer browser ###### \n\n"
17
- system("cucumber BROWSER=ie")
18
- else
19
- puts "Running all features on safari browser ###### \n\n"
20
- system("cucumber BROWSER=safari")
21
- end
22
-
23
- elsif ARGV.shift == "html"
24
-
25
- puts "\n\n\t###### Running all features on firefox browser ###### \n\n"
26
- puts "Output result stored in \"result_firefox.html\""
27
- system("cucumber -f html -o result_firefox.html")
28
-
29
- puts "\n\n\t###### Running all features on chrome browser ###### \n\n"
30
- puts "Output result stored in \"result_chrome.html\""
31
- system("cucumber BROWSER=chrome -f html -o result_chrome.html")
32
-
33
- if OS.to_s=="windows"
34
- puts "\n\n\t###### Running all features on internet explorer browser ###### \n\n"
35
- puts "Output result stored in \"result_ie.html\""
36
- system("cucumber BROWSER=ie -f html -o result_ie.html")
37
- else
38
- puts "\n\n\t###### Running all features on safari browser ###### \n\n"
39
- puts "Output result stored in \"result_safari.html\""
40
- system("cucumber BROWSER=safari -f html -o result_safari.html")
41
- end
42
- end
@@ -1,206 +0,0 @@
1
-
2
- <html lang="en">
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
- <title>Test Page for selenium-cucumber</title>
6
-
7
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
8
-
9
- <script type="text/javascript">
10
- $(function() {
11
- $("#hiddenElement").hide();
12
- setTimeout(function() { $("#hiddenElement").fadeIn(1500); }, 10000)
13
- setTimeout(function() { $("#disabledBt").removeAttr("disabled");}, 20000)
14
- })
15
-
16
- </script>
17
-
18
- <style>
19
- a:hover
20
- {
21
- background-color:yellow;
22
- }
23
- </style
24
- >
25
- </head>
26
- <body>
27
-
28
- <form id="frm" action="" method="post">
29
-
30
-
31
- <fieldset>
32
- <legend class="form_name">Simple sample form with input elements</legend>
33
-
34
- <p>
35
- <label for="dummy0">Text input (first name)</label><br>
36
- <input type="text" class="fname_class" name="fname_name" id="f_name" value="">
37
- </p>
38
-
39
- <p>
40
- <label for="dummy1">Text input (last name)</label><br>
41
- <input type="text" class="lname_class" id="l_name" name="lname_name" value="">
42
- </p>
43
-
44
- <p>
45
- <label for="dummy1">Disabled field</label><br>
46
- <input type="text" class="df_class" id="df_id" name="df_name" value="" disabled>
47
- </p>
48
-
49
- <p>
50
- <label for="dummy2">Textarea (address)</label><br>
51
- <textarea name="dummy2" id="address" class="address_class" rows="3" cols="20" value=""></textarea>
52
- </p>
53
-
54
- <p>
55
- <label for="dummy3">A password field (password)</label><br>
56
- <input type="password" class="cls_pwd" id="pwd" name="nm_pwd" value="">
57
- </p>
58
-
59
- <p>
60
- <label for="dummy4">radio button group (Gender)</label><br>
61
- <input type="radio" name="radio_gender" value="M">Male</input>
62
- <input type="radio" name="radio_gender" value="F">Female</input>
63
- </p>
64
-
65
- <p>
66
- <input type="submit" value="Submit" id="submit" name="btn_submit" >
67
- <input type="reset" value="Reset" id="reset" name="btn_reset">
68
- <input type="button" value="disabledBt" id="disabledBt_id" name="disabledBt_name" disabled>
69
- </p>
70
-
71
- </fieldset>
72
- </form>
73
-
74
- </br>
75
-
76
- <fieldset>
77
- <legend>Multiselect dropdown</legend>
78
- <p>
79
- <select name="cars" multiple>
80
- <option value="volvo">Volvo</option>
81
- <option value="saab">Saab</option>
82
- <option value="opel">Opel</option>
83
- <option value="audi">Audi</option>
84
- </select>
85
- </p>
86
- </fieldset></br>
87
-
88
- <fieldset>
89
- <legend>Dropdown lists</legend>
90
- <p>
91
- <label for="dummy3">Select field</label><br>
92
- <select id="dropdownList1" name="name_select1" value="Please select your choice select">
93
- <option value="s1">Select_1</option>
94
- <option value="s2">Select_2</option>
95
- <option value="s3" selected>Select_3</option>
96
- <option value="s4">Select_4</option>
97
- <option value="s5">Select_5</option>
98
- </select>
99
- </p>
100
- </fieldset>
101
-
102
- </br>
103
-
104
- <fieldset>
105
- <legend>Radio Buttons </legend>
106
- <p>
107
- <input type="radio" id="rdb1" name="rdb1_name" class="rdb1_class" checked> Radio one<br>
108
- <input type="radio" id="rdb2" name="rdb2_name" class="rdb2_class"> Radio two<br>
109
- <input type="radio" id="rdb3" name="rdb3_name" class="rdb3_class"> Radio three<br>
110
- <input type="radio" id="rdb4" name="rdb4_name" class="rdb4_class"> Radio four<br>
111
- <input type="radio" id="rdb5" name="rdb5_name" class="rdb5_class" checked> Radio five<br>
112
- </p>
113
- </fieldset>
114
-
115
- </br>
116
-
117
- <fieldset>
118
- <legend>Checkbox </legend>
119
- <p>
120
- <input type="checkbox" id="chk1" name="chk1_name" class="chk1_class" checked> Check one<br>
121
- <input type="checkbox" id="chk2" name="chk2_name" class="chk2_class"> Check two<br>
122
- <input type="checkbox" id="chk3" name="chk3_name" class="chk3_class"> Check three<br>
123
- <input type="checkbox" id="chk4" name="chk4_name" class="chk4_class"> Check four<br>
124
- <input type="checkbox" id="chk5" name="chk5_name" class="chk5_class" checked> Check five<br>
125
- </p>
126
- </fieldset>
127
-
128
- </br>
129
-
130
-
131
- <fieldset>
132
- <legend>Display element after 10 sec</legend>
133
- <div id="hiddenElement" name="he_name" class="he_class">This showed after 10 sec</div>
134
- </fieldset>
135
-
136
- </br>
137
- <fieldset>
138
- <legend>Enable Button after 10 sec</legend>
139
- <input type="button" value="Button" id="disabledBt" onclick="showText()" disabled>
140
- <p id="msg"></p>
141
-
142
- <script>
143
- function showText()
144
- {
145
- document.getElementById("msg").innerHTML = "Now button is enabled";
146
- }
147
- </script>
148
- </fieldset>
149
-
150
- </br>
151
-
152
- <fieldset>
153
- <legend>Images</legend>
154
- <img id="img1" src="http://shared.ooyala.com.s3.amazonaws.com/dropshadow-flower-pink.png" alt="Image one" style="display:inline-block;">
155
- </fieldset>
156
-
157
- </br>
158
-
159
- <fieldset>
160
- <legend>Links</legend>
161
- <p>
162
- <a href="https://rubygems.org/gems/selenium-cucumber">selenium-cucumber gem</a> <br>
163
- <a href="http://seleniumcucumber.wordpress.com/" onclick="window.open('http://seleniumcucumber.wordpress.com/', 'newwindow', 'width=500, height=500'); return false;">selenium-cucumber website</a> <br>
164
- <a href="https://github.com/sameer49/selenium-cucumber/blob/master/doc/canned_steps.md">Predefined-steps</a>
165
- </p>
166
- </fieldset>
167
-
168
- </br>
169
-
170
- <fieldset>
171
- <legend>Javascript alert</legend>
172
- <p name="javascript_alert_msg">Click the button to display a confirm box.</p>
173
- <button id="try_it" onclick="callAlert()">Try it</button>
174
- <p id="demo">this is demo line</p>
175
-
176
- <script>
177
- function callAlert()
178
- {
179
- var x;
180
- if (confirm("Press a button!") == true)
181
- x = "You pressed OK!";
182
- else
183
- x = "You pressed Cancel!";
184
- document.getElementById("demo").innerHTML = x;
185
- }
186
- </script>
187
- </p>
188
- </fieldset>
189
-
190
- <fieldset>
191
- <legend>Double click here</legend>
192
- <p id="dbClick" ondblclick="doubleClick()">Double-click this paragraph to trigger a function.</p>
193
-
194
- <p id="demo2" name="demo2_name"></p>
195
-
196
- <script>
197
- function doubleClick() {
198
- document.getElementById("demo2").innerHTML = "Hello World";
199
- }
200
- </script>
201
- </p>
202
- </fieldset>
203
-
204
- </body>
205
- </html>
206
-