selenium-cucumber 1.1.2 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/doc/canned_steps.md +17 -0
  3. data/features-skeleton/support/env.rb +42 -29
  4. data/lib/selenium-cucumber.rb +0 -1
  5. data/lib/selenium-cucumber/assertion_steps.rb +6 -2
  6. data/lib/selenium-cucumber/click_elements_steps.rb +10 -0
  7. data/lib/selenium-cucumber/methods/assertion_methods.rb +78 -8
  8. data/lib/selenium-cucumber/methods/click_elements_methods.rb +8 -0
  9. data/lib/selenium-cucumber/methods/configuration_methods.rb +23 -2
  10. data/lib/selenium-cucumber/methods/error_handling_methods.rb +87 -0
  11. data/lib/selenium-cucumber/methods/misc_methods.rb +9 -0
  12. data/lib/selenium-cucumber/methods/navigate_methods.rb +5 -0
  13. data/lib/selenium-cucumber/methods/required_files.rb +2 -0
  14. data/lib/selenium-cucumber/navigation_steps.rb +4 -0
  15. data/lib/selenium-cucumber/version.rb +1 -1
  16. metadata +68 -51
  17. data/example/Gemfile +0 -5
  18. data/example/Gemfile.lock +0 -36
  19. data/example/features/actual_images/test.png +0 -0
  20. data/example/features/assertion_steps_Ex.feature +0 -149
  21. data/example/features/click_steps_Ex.feature +0 -28
  22. data/example/features/configuration_step_Ex.feature +0 -8
  23. data/example/features/expected_images/logo-PNG.png +0 -0
  24. data/example/features/expected_images/original_image.jpg +0 -0
  25. data/example/features/image_difference/test.png +0 -0
  26. data/example/features/input_steps_Ex.feature +0 -87
  27. data/example/features/javascript_steps_Ex.feature +0 -19
  28. data/example/features/navigation_steps_Ex.feature +0 -45
  29. data/example/features/new.feature +0 -17
  30. data/example/features/progress_step_Ex.feature +0 -18
  31. data/example/features/screenshot_step_Ex.feature +0 -12
  32. data/example/features/screenshots/test.png +0 -0
  33. data/example/features/step_definitions/custom_steps.rb +0 -14
  34. data/example/features/support/env.rb +0 -37
  35. data/example/features/support/hooks.rb +0 -34
  36. data/example/run_features.rb +0 -42
  37. data/example/test_page.html +0 -224
@@ -23,3 +23,12 @@ end
23
23
  def validate_option_by option_by
24
24
  raise "Invalid option by - #{option_by}" unless valid_option_by? option_by
25
25
  end
26
+
27
+ # Return android device name and android version using adb command
28
+ def get_device_info
29
+ IO.popen('adb shell getprop ro.product.brand') { |f| $device = f.gets.chomp.upcase}
30
+ $device += ' '
31
+ IO.popen('adb shell getprop ro.product.model') { |f| $device += f.gets.chomp.upcase}
32
+ IO.popen('adb shell getprop ro.build.version.release') { |f| $os_version = f.gets.chomp.upcase}
33
+ return $device, $os_version
34
+ end
@@ -95,6 +95,11 @@ def switch_to_old_window
95
95
  $driver.switch_to.window($old_win)
96
96
  end
97
97
 
98
+ # Method to close new window
99
+ def close_new_window
100
+ $driver.close
101
+ end
102
+
98
103
  =begin
99
104
  def switch_to_new_window
100
105
  win_handles = $driver.window_handles
@@ -3,6 +3,8 @@ require 'selenium-webdriver'
3
3
  require 'chunky_png'
4
4
  require 'open-uri'
5
5
  require 'rbconfig'
6
+ require 'appium_lib'
6
7
  include RbConfig
7
8
 
8
9
  require_relative 'misc_methods'
10
+ require_relative 'error_handling_methods'
@@ -39,6 +39,10 @@ Then(/^I switch to previous window$/) do
39
39
  switch_to_old_window
40
40
  end
41
41
 
42
+ Then(/^I close new window$/) do
43
+ close_new_window
44
+ end
45
+
42
46
  # steps to scroll to element
43
47
  Then(/^I scroll to element having (.+) "(.*?)"$/) do |type, access_name|
44
48
  validate_locator type
@@ -1,5 +1,5 @@
1
1
  module Selenium
2
2
  module Cucumber
3
- VERSION = '1.1.2'
3
+ VERSION = '2.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,66 +1,119 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.1.2
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-11-04 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
17
20
  - - '>='
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 1.3.18
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.3'
24
30
  - - '>='
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 1.3.18
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: selenium-webdriver
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: 2.44.0
31
40
  - - '>='
32
41
  - !ruby/object:Gem::Version
33
- version: '0'
42
+ version: 2.41.0
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: 2.44.0
38
50
  - - '>='
39
51
  - !ruby/object:Gem::Version
40
- version: '0'
52
+ version: 2.41.0
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: chunky_png
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ version: 1.3.3
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 1.3.0
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 1.3.3
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 1.3.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: appium_lib
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: 4.1.0
45
80
  - - '>='
46
81
  - !ruby/object:Gem::Version
47
- version: '0'
82
+ version: 4.0.0
48
83
  type: :runtime
49
84
  prerelease: false
50
85
  version_requirements: !ruby/object:Gem::Requirement
51
86
  requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 4.1.0
52
90
  - - '>='
53
91
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: |-
56
- Behavior driven development (BDD) approach to write automation test script to test web applications.
57
- It enables you to write and execute automated acceptance tests of web apps.
92
+ version: 4.0.0
93
+ description: Behavior driven development (BDD) approach to write automation test script
94
+ to test Web and Android applications.
58
95
  email: sameersawant1992@gmail.com
59
96
  executables:
60
97
  - selenium-cucumber
61
98
  extensions: []
62
99
  extra_rdoc_files: []
63
100
  files:
101
+ - bin/generate.rb
102
+ - bin/helper.rb
103
+ - bin/selenium-cucumber
104
+ - doc/canned_steps.md
105
+ - doc/installation.md
106
+ - doc/selenium-cucumber-API.md
107
+ - doc/selenium-cucumber-help.md
108
+ - features-skeleton/actual_images/test.png
109
+ - features-skeleton/expected_images/test.png
110
+ - features-skeleton/image_difference/test.png
111
+ - features-skeleton/my_first.feature
112
+ - features-skeleton/screenshots/test.png
113
+ - features-skeleton/step_definitions/custom_steps.rb
114
+ - features-skeleton/support/env.rb
115
+ - features-skeleton/support/hooks.rb
116
+ - lib/selenium-cucumber.rb
64
117
  - lib/selenium-cucumber/assertion_steps.rb
65
118
  - lib/selenium-cucumber/click_elements_steps.rb
66
119
  - lib/selenium-cucumber/configuration_steps.rb
@@ -69,6 +122,7 @@ files:
69
122
  - lib/selenium-cucumber/methods/assertion_methods.rb
70
123
  - lib/selenium-cucumber/methods/click_elements_methods.rb
71
124
  - lib/selenium-cucumber/methods/configuration_methods.rb
125
+ - lib/selenium-cucumber/methods/error_handling_methods.rb
72
126
  - lib/selenium-cucumber/methods/input_methods.rb
73
127
  - lib/selenium-cucumber/methods/javascript_handling_methods.rb
74
128
  - lib/selenium-cucumber/methods/misc_methods.rb
@@ -80,48 +134,11 @@ files:
80
134
  - lib/selenium-cucumber/progress_steps.rb
81
135
  - lib/selenium-cucumber/screenshot_steps.rb
82
136
  - lib/selenium-cucumber/version.rb
83
- - lib/selenium-cucumber.rb
84
- - bin/generate.rb
85
- - bin/helper.rb
86
- - bin/selenium-cucumber
87
- - doc/canned_steps.md
88
- - doc/installation.md
89
- - doc/selenium-cucumber-API.md
90
- - doc/selenium-cucumber-help.md
91
- - features-skeleton/actual_images/test.png
92
- - features-skeleton/expected_images/test.png
93
- - features-skeleton/image_difference/test.png
94
- - features-skeleton/my_first.feature
95
- - features-skeleton/screenshots/test.png
96
- - features-skeleton/step_definitions/custom_steps.rb
97
- - features-skeleton/support/env.rb
98
- - features-skeleton/support/hooks.rb
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/new.feature
110
- - example/features/progress_step_Ex.feature
111
- - example/features/screenshots/test.png
112
- - example/features/screenshot_step_Ex.feature
113
- - example/features/step_definitions/custom_steps.rb
114
- - example/features/support/env.rb
115
- - example/features/support/hooks.rb
116
- - example/Gemfile
117
- - example/Gemfile.lock
118
- - example/run_features.rb
119
- - example/test_page.html
120
137
  homepage: http://seleniumcucumber.info/
121
138
  licenses:
122
139
  - MIT
123
140
  metadata: {}
124
- post_install_message: Thanks for installing selenium-cucumber gem.
141
+ post_install_message: Thank you for installing selenium-cucumber gem.
125
142
  rdoc_options: []
126
143
  require_paths:
127
144
  - lib
@@ -129,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
146
  requirements:
130
147
  - - '>='
131
148
  - !ruby/object:Gem::Version
132
- version: '0'
149
+ version: 1.9.3
133
150
  required_rubygems_version: !ruby/object:Gem::Requirement
134
151
  requirements:
135
152
  - - '>='
@@ -137,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
154
  version: '0'
138
155
  requirements: []
139
156
  rubyforge_project:
140
- rubygems_version: 2.0.14
157
+ rubygems_version: 2.4.5
141
158
  signing_key:
142
159
  specification_version: 4
143
160
  summary: SELENIUM WEBDRIVER WITH RUBY & CUCUMBER
@@ -1,5 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'selenium-cucumber'
4
- # To run locally
5
- # gem 'selenium-cucumber', path: 'your local repo path'
@@ -1,36 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- builder (3.2.2)
5
- childprocess (0.5.3)
6
- ffi (~> 1.0, >= 1.0.11)
7
- chunky_png (1.3.1)
8
- cucumber (1.3.16)
9
- builder (>= 2.1.2)
10
- diff-lcs (>= 1.1.3)
11
- gherkin (~> 2.12)
12
- multi_json (>= 1.7.5, < 2.0)
13
- multi_test (>= 0.1.1)
14
- diff-lcs (1.2.5)
15
- ffi (1.9.3)
16
- gherkin (2.12.2)
17
- multi_json (~> 1.3)
18
- multi_json (1.10.1)
19
- multi_test (0.1.1)
20
- rubyzip (1.1.6)
21
- selenium-cucumber (0.1.1)
22
- chunky_png
23
- cucumber
24
- selenium-webdriver
25
- selenium-webdriver (2.42.0)
26
- childprocess (>= 0.5.0)
27
- multi_json (~> 1.0)
28
- rubyzip (~> 1.0)
29
- websocket (~> 1.0.4)
30
- websocket (1.0.7)
31
-
32
- PLATFORMS
33
- ruby
34
-
35
- DEPENDENCIES
36
- selenium-cucumber
@@ -1,149 +0,0 @@
1
-
2
- Feature: Assertion Steps
3
- As a user I should able to verify using assert steps
4
-
5
- Scenario: Open test page
6
- Given I open test page
7
-
8
- Scenario: verify page title
9
- Then I should see page title as "Test Page for selenium-cucumber"
10
-
11
-
12
- Scenario: verify element text
13
-
14
- Then I scroll to end of page
15
- Then element having id "dbClick" should have text as "Double-click this paragraph to trigger a function."
16
- Then element having name "javascript_alert_msg" should have text as "Click the button to display a confirm box."
17
- Then element having class "form_name" should have text as "Simple sample form with input elements"
18
- Then element having xpath ".//*[@id='frm']/fieldset/p[1]/label" should have text as "Text input (first name)"
19
-
20
- Scenario: verify element should not text
21
-
22
- Then element having id "dbClick" should not have text as "Double-click this"
23
- Then element having name "javascript_alert_msg" should not have text as "Click the button"
24
- Then element having class "form_name" should not have text as "Simple sample"
25
- Then element having xpath ".//*[@id='frm']/fieldset/p[3]/label" should not have text as "xyz"
26
-
27
- Scenario: verify element text - negative test 1
28
-
29
- Then element having id "dbClick" should have text as "Double-click this"
30
-
31
- Scenario: verify element text - negative test 2
32
-
33
- Then element having name "javascript_alert_msg" should not have text as "Click the button to display a confirm box."
34
-
35
- Scenario: Partial text present
36
- Then element having id "frm" should have partial text as "last"
37
-
38
- Scenario: Partial text present - negative test
39
- Then element having id "frm" should have partial text as "selenium"
40
-
41
- Scenario: Partial text not present
42
- Then element having id "frm" should not have partial text as "selenium"
43
-
44
- Scenario: Partial text not present - negative test
45
- Then element having id "frm" should not have partial text as "last"
46
-
47
- Scenario: verify element accesibility
48
-
49
- Then element having id "submit" should be enabled
50
- Then element having name "btn_reset" should be enabled
51
- Then element having class "cls_pwd" should be enabled
52
- Then element having xpath ".//*[@id='try_it']" should be enabled
53
-
54
- Then element having id "disabledBt_id" should be disabled
55
- Then element having name "disabledBt_name" should be disabled
56
- Then element having class "df_class" should be disabled
57
- Then element having xpath ".//*[@id='df_id']" should be disabled
58
-
59
- Scenario: verify element accesibility - negative test 1
60
-
61
- Then element having id "submit" should be disabled
62
-
63
- Scenario: verify element accesibility - negative test 2
64
-
65
- Then element having id "disabledBt_id" should be enabled
66
-
67
- Scenario: verify element visibility
68
-
69
- Then element having id "hiddenElement" should not be present
70
- Then element having name "he_name" should not be present
71
- Then element having class "he_class" should not be present
72
- Then element having xpath ".//*[@id='hiddenElement']" should not be present
73
-
74
- And I wait for 10 sec
75
-
76
- Then element having id "hiddenElement" should be present
77
- Then element having name "he_name" should be present
78
- Then element having class "he_class" should be present
79
- Then element having xpath ".//*[@id='hiddenElement']" should be present
80
-
81
- Scenario: verify checkbox checked or not
82
-
83
- Then checkbox having id "chk1" should be checked
84
- Then checkbox having name "chk5_name" should be checked
85
- Then checkbox having xpath ".//*[@id='chk1']" should be checked
86
- Then checkbox having class "chk5_class" should be checked
87
-
88
- Then checkbox having id "chk2" should be unchecked
89
- Then checkbox having name "chk3_name" should be unchecked
90
- Then checkbox having class "chk4_class" should be unchecked
91
-
92
- Scenario: verify checkbox checked or not - negative test 1
93
-
94
- Then checkbox having class "chk3_class" should be checked
95
-
96
- Scenario: verify checkbox checked or not - negative test 2
97
-
98
- Then checkbox having class "chk5_class" should be unchecked
99
-
100
- Scenario: verify radio button selected or not
101
-
102
- Then radio button having id "rdb1" should be selected
103
- Then radio button having id "rdb2" should be unselected
104
-
105
- Scenario: verify radio button selected or not - negative test 1
106
-
107
- Then radio button having id "rdb2" should be selected
108
-
109
- Scenario: verify radio button selected or not - negative test 2
110
-
111
- Then radio button having id "rdb1" should be unselected
112
-
113
- Scenario: verify link present or not
114
-
115
- Then link having text "selenium-cucumber gem" should be present
116
- Then link having text "xyz" should not be present
117
-
118
- Scenario: verify pop-up alert text
119
-
120
- When I click on element having id "try_it"
121
- Then I should see alert text as "Press a button!"
122
- Then I accept alert
123
-
124
- Scenario: verify image by id and id - jpg image
125
- Then actual image having id "img1" and expected image having id "img1" should be similar
126
-
127
- Scenario: verify image by id and image_name - jpg image
128
- Then actual image having id "img1" and expected image having image_name "original_image.jpg" should be similar
129
-
130
- Scenario: verify image by url and image_name - jpg image
131
- Then actual image having url "http://s27.postimg.org/xlqzpviyr/original_image.jpg" and expected image having image_name "original_image.jpg" should be similar
132
-
133
- Scenario: verify image by id and image_name - jpg image - negative test
134
- Then actual image having id "img1_incorrect" and expected image having image_name "original_image.jpg" should be similar
135
-
136
- Scenario: verify image by id and id - png image
137
- Then actual image having id "img2" and expected image having id "img2" should be similar
138
-
139
- Scenario: verify image by xpath and xpath - png image
140
- Then actual image having xpath ".//*[@id='img2']" and expected image having xpath ".//*[@id='img2']" should be similar
141
-
142
- Scenario: verify image by id and image_name - png image
143
- Then actual image having id "img2" and expected image having image_name "logo-PNG.png" should be similar
144
-
145
- Scenario: verify image by url and image_name - png image
146
- Then actual image having url "http://s26.postimg.org/itpfqlcop/logo1.png" and expected image having image_name "logo-PNG.png" should be similar
147
-
148
- Scenario: verify image by id and image_name - png image - negative test
149
- Then actual image having id "img2_incorrect" and expected image having image_name "logo-PNG.png" should be similar