selenium-cucumber 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/selenium-cucumber +12 -9
- data/doc/canned_steps.md +13 -12
- data/doc/selenium-cucumber-API.md +77 -0
- data/doc/{selenium-cucumber-help.txt → selenium-cucumber-help.md} +2 -0
- data/features-skeleton/step_definitions/custom_steps.rb +2 -1
- data/features-skeleton/support/hooks.rb +34 -0
- data/lib/selenium-cucumber.rb +1 -1
- data/lib/selenium-cucumber/assertion_steps.rb +5 -5
- data/lib/selenium-cucumber/{press_button_steps.rb → click_elements_steps.rb} +1 -1
- data/lib/selenium-cucumber/methods/assertion_methods.rb +53 -29
- data/lib/selenium-cucumber/methods/click_elements_methods.rb +10 -0
- data/lib/selenium-cucumber/methods/configuration_methods.rb +1 -2
- data/lib/selenium-cucumber/methods/input_methods.rb +10 -11
- data/lib/selenium-cucumber/methods/javascript_handling_methods.rb +1 -2
- data/lib/selenium-cucumber/methods/navigate_methods.rb +8 -8
- data/lib/selenium-cucumber/methods/progress_methods.rb +1 -2
- data/lib/selenium-cucumber/methods/required_files.rb +6 -0
- data/lib/selenium-cucumber/methods/screenshot_methods.rb +1 -2
- data/lib/selenium-cucumber/navigation_steps.rb +0 -20
- data/lib/selenium-cucumber/version.rb +1 -1
- metadata +8 -5
- data/lib/selenium-cucumber/methods/press_button_methods.rb +0 -6
data/bin/selenium-cucumber
CHANGED
@@ -10,14 +10,17 @@ require 'selenium-cucumber/version'
|
|
10
10
|
|
11
11
|
if (ARGV.length == 0)
|
12
12
|
print_usage
|
13
|
-
|
13
|
+
else
|
14
|
+
cmd = ARGV.shift
|
14
15
|
|
15
|
-
cmd
|
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
|
16
26
|
|
17
|
-
if cmd == 'help'
|
18
|
-
print_help
|
19
|
-
elsif cmd == 'gen'
|
20
|
-
selenium_cucumber_scaffold
|
21
|
-
elsif cmd == 'version'
|
22
|
-
puts Selenium::Cucumber::VERSION
|
23
|
-
end
|
data/doc/canned_steps.md
CHANGED
@@ -22,13 +22,7 @@ To zoom in/out webpage use following steps
|
|
22
22
|
Then I zoom in page
|
23
23
|
Then I zoom out page
|
24
24
|
|
25
|
-
To zoom
|
26
|
-
|
27
|
-
Then I zoom in page till I see element having id "(.*?)"
|
28
|
-
Then I zoom in page till I see element having name "(.*?)"
|
29
|
-
Then I zoom in page till I see element having class "(.*?)"
|
30
|
-
Then I zoom in page till I see element having xpath "(.*?)"
|
31
|
-
Then I zoom in page till I see element having css "(.*?)"
|
25
|
+
To zoom out webpage till necessary element displays use following steps
|
32
26
|
|
33
27
|
Then I zoom out page till I see element having id "(.*?)"
|
34
28
|
Then I zoom out page till I see element having name "(.*?)"
|
@@ -40,6 +34,13 @@ To reset webpage view use following step
|
|
40
34
|
|
41
35
|
Then I reset page view
|
42
36
|
|
37
|
+
To scroll webpage use following step
|
38
|
+
|
39
|
+
Then I scroll to the element having id "(.*?)"
|
40
|
+
Then I scroll to the element having name "(.*?)"
|
41
|
+
Then I scroll to the element having class "(.*?)"
|
42
|
+
Then I scroll to the element having xpath "(.*?)"
|
43
|
+
Then I scroll to the element having css "(.*?)"
|
43
44
|
|
44
45
|
Assertion Steps
|
45
46
|
---------------
|
@@ -101,11 +102,11 @@ To assert that element is present use any of the following steps.
|
|
101
102
|
|
102
103
|
To assert that element is not present use any of the following steps.
|
103
104
|
|
104
|
-
Then I should
|
105
|
-
Then I should
|
106
|
-
Then I should
|
107
|
-
Then I should
|
108
|
-
Then I should
|
105
|
+
Then I should see element not present having id "(.*?)"
|
106
|
+
Then I should see element not present having name "(.*?)"
|
107
|
+
Then I should see element not present having class "(.*?)"
|
108
|
+
Then I should see element not present having xpath "(.*?)"
|
109
|
+
Then I should see element not present having css "(.*?)"
|
109
110
|
|
110
111
|
|
111
112
|
To assert that checkbox is checked use any of the following steps.
|
@@ -0,0 +1,77 @@
|
|
1
|
+
selenium-cucumber API
|
2
|
+
=====================
|
3
|
+
|
4
|
+
If you are writing code for your custom steps you can use following methods
|
5
|
+
|
6
|
+
|
7
|
+
Navigation API's
|
8
|
+
----------------
|
9
|
+
|
10
|
+
navigate_to(link)
|
11
|
+
|
12
|
+
navigate(direction) # direction=back or direction=forword
|
13
|
+
|
14
|
+
close_driver()
|
15
|
+
|
16
|
+
|
17
|
+
Browser Interaction API's
|
18
|
+
-------------------------
|
19
|
+
|
20
|
+
resize_browser(width,heigth)
|
21
|
+
|
22
|
+
scroll_to_element(by,access_value)
|
23
|
+
|
24
|
+
zoom_in_out(in_out)
|
25
|
+
|
26
|
+
zoom_in_out_till_element_display(by, in_out, access_value)
|
27
|
+
|
28
|
+
|
29
|
+
Input API's
|
30
|
+
------------
|
31
|
+
|
32
|
+
click(by,access_value)
|
33
|
+
|
34
|
+
submit(by,access_value)
|
35
|
+
|
36
|
+
enter_text(by,text,access_value)
|
37
|
+
|
38
|
+
clear_text(by,access_value)
|
39
|
+
|
40
|
+
check_checkbox(by, access_value)
|
41
|
+
|
42
|
+
uncheck_checkbox(by, access_value)
|
43
|
+
|
44
|
+
toggle_checkbox(by, access_value)
|
45
|
+
|
46
|
+
select_radio_button(by, access_value)
|
47
|
+
|
48
|
+
get_page_title()
|
49
|
+
|
50
|
+
get_element_text(by,access_value)
|
51
|
+
|
52
|
+
get_element_attribute(by,access_value,attribute)
|
53
|
+
|
54
|
+
is_element_enabled(by,access_value)
|
55
|
+
|
56
|
+
is_element_displayed(by,access_value)
|
57
|
+
|
58
|
+
|
59
|
+
Javascript Handling API
|
60
|
+
-----------------------
|
61
|
+
|
62
|
+
handle_alert(decesion) # accept or dismiss
|
63
|
+
|
64
|
+
|
65
|
+
Progress API's
|
66
|
+
--------------
|
67
|
+
|
68
|
+
wait(time_in_sec)
|
69
|
+
|
70
|
+
wait_for_element_to_display(by,access_value,duration)
|
71
|
+
|
72
|
+
wait_for_element_to_enable(by,access_value,duration)
|
73
|
+
|
74
|
+
|
75
|
+
Screenshot API
|
76
|
+
--------------
|
77
|
+
take_screenshots
|
@@ -0,0 +1,34 @@
|
|
1
|
+
#Cucumber provides a number of hooks which allow us to run blocks at various points in the Cucumber test cycle
|
2
|
+
|
3
|
+
Before do
|
4
|
+
# Do something before each scenario.
|
5
|
+
end
|
6
|
+
|
7
|
+
Before do |scenario|
|
8
|
+
# The +scenario+ argument is optional, but if you use it, you can get the title,
|
9
|
+
# description, or name (title + description) of the scenario that is about to be
|
10
|
+
# executed.
|
11
|
+
end
|
12
|
+
|
13
|
+
After do |scenario|
|
14
|
+
# Do something after each scenario.
|
15
|
+
# The +scenario+ argument is optional, but
|
16
|
+
# if you use it, you can inspect status with
|
17
|
+
# the #failed?, #passed? and #exception methods.
|
18
|
+
|
19
|
+
if(scenario.failed?)
|
20
|
+
#Do something if scenario fails.
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
#Tagged hooks
|
25
|
+
|
26
|
+
Before('@Ex_tag1, @Ex_tag2') do
|
27
|
+
# This will only run before scenarios tagged
|
28
|
+
# with @cucumis OR @sativus.
|
29
|
+
end
|
30
|
+
|
31
|
+
AfterStep('@Ex_tag1, @Ex_tag2') do
|
32
|
+
# This will only run after steps within scenarios tagged
|
33
|
+
# with @cucumis AND @sativus.
|
34
|
+
end
|
data/lib/selenium-cucumber.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'selenium-cucumber/assertion_steps'
|
3
3
|
require 'selenium-cucumber/input_steps'
|
4
4
|
require 'selenium-cucumber/navigation_steps'
|
5
|
-
require 'selenium-cucumber/
|
5
|
+
require 'selenium-cucumber/click_elements_steps'
|
6
6
|
require 'selenium-cucumber/progress_steps'
|
7
7
|
require 'selenium-cucumber/screenshot_steps'
|
8
8
|
require 'selenium-cucumber/configuration_steps'
|
@@ -189,23 +189,23 @@ end
|
|
189
189
|
|
190
190
|
#element presence - negative test
|
191
191
|
|
192
|
-
Then(/^I should
|
192
|
+
Then(/^I should see element not present having id "(.*?)"$/) do |access_name|
|
193
193
|
check_element_presence("id", access_name, false)
|
194
194
|
end
|
195
195
|
|
196
|
-
Then(/^I should
|
196
|
+
Then(/^I should see element not present having name "(.*?)"$/) do |access_name|
|
197
197
|
check_element_presence("name", access_name, false)
|
198
198
|
end
|
199
199
|
|
200
|
-
Then(/^I should
|
200
|
+
Then(/^I should see element not present having class "(.*?)"$/) do |access_name|
|
201
201
|
check_element_presence("class", access_name, false)
|
202
202
|
end
|
203
203
|
|
204
|
-
Then(/^I should
|
204
|
+
Then(/^I should see element not present having xpath "(.*?)"$/) do |access_name|
|
205
205
|
check_element_presence("xpath", access_name, false)
|
206
206
|
end
|
207
207
|
|
208
|
-
Then(/^I should
|
208
|
+
Then(/^I should see element not present having css "(.*?)"$/) do |access_name|
|
209
209
|
check_element_presence("css", access_name, false)
|
210
210
|
end
|
211
211
|
|
@@ -1,78 +1,102 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
3
|
|
4
4
|
#Page title checking
|
5
|
+
def get_page_title
|
6
|
+
return $driver.title
|
7
|
+
end
|
8
|
+
|
5
9
|
def check_title(title)
|
6
|
-
if(
|
10
|
+
if(get_page_title!=title)
|
7
11
|
raise "Page Title Not Matched"
|
8
12
|
end
|
9
13
|
end
|
10
14
|
|
15
|
+
#method to get element text
|
16
|
+
def get_element_text(access_type,access_name)
|
17
|
+
return WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.text
|
18
|
+
end
|
19
|
+
|
11
20
|
#Method to check element text
|
12
21
|
def check_element_text(access_type, actual_value, access_name, test_case)
|
13
|
-
|
22
|
+
element_text = get_element_text(access_type,access_name)
|
14
23
|
|
15
24
|
if test_case
|
16
|
-
if(
|
25
|
+
if(element_text!=actual_value)
|
17
26
|
raise "Text Not Matched"
|
18
27
|
end
|
19
28
|
else
|
20
|
-
if(
|
29
|
+
if(element_text==actual_value)
|
21
30
|
raise "Text Matched"
|
22
31
|
end
|
23
32
|
end
|
24
33
|
end
|
25
34
|
|
35
|
+
#method to return element status - enabled?
|
36
|
+
def is_element_enabled(access_type,access_name)
|
37
|
+
return WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}.enabled?
|
38
|
+
end
|
39
|
+
|
26
40
|
#Element enabled checking
|
27
41
|
def check_element_enable(access_type, access_name, test_case)
|
42
|
+
|
43
|
+
result=is_element_enabled(access_type,access_name)
|
44
|
+
|
28
45
|
if test_case
|
29
|
-
if(
|
46
|
+
if(!result)
|
30
47
|
raise "Element not enabled"
|
31
48
|
end
|
32
49
|
else
|
33
|
-
if(
|
50
|
+
if(result)
|
34
51
|
raise "Element enabled"
|
35
52
|
end
|
36
53
|
end
|
37
54
|
end
|
38
55
|
|
39
|
-
#
|
56
|
+
#method to get attribute value
|
57
|
+
def get_element_attribute(access_type,access_name,attribute_value)
|
58
|
+
return WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}.attribute("#{attribute_name}")
|
59
|
+
end
|
60
|
+
|
61
|
+
#method to check attribute value
|
40
62
|
def check_element_attribute(access_type, attribute_name , attribute_value, access_name, test_case)
|
41
|
-
|
63
|
+
|
64
|
+
attr_val=get_element_attribute(access_type,access_name,attribute_value)
|
65
|
+
|
42
66
|
if test_case
|
43
|
-
if(
|
67
|
+
if(attr_val!=attribute_value)
|
44
68
|
raise "Attribute Not Matched"
|
45
69
|
end
|
46
70
|
else
|
47
|
-
if(
|
71
|
+
if(attr_val==attribute_value)
|
48
72
|
raise "Attribute Matched"
|
49
73
|
end
|
50
74
|
end
|
51
75
|
end
|
52
76
|
|
77
|
+
#method to get element status - displayed?
|
78
|
+
def is_element_displayed(access_type,access_name)
|
79
|
+
WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}.displayed?
|
80
|
+
end
|
81
|
+
|
53
82
|
# method to check element presence
|
54
83
|
def check_element_presence(access_type, access_name, test_case)
|
84
|
+
result = is_element_displayed(access_type,access_name)
|
85
|
+
|
55
86
|
if test_case
|
56
|
-
if
|
57
|
-
raise "
|
58
|
-
else
|
59
|
-
puts $driver.find_element(:"#{access_type}" => "#{access_name}").text
|
87
|
+
if !result
|
88
|
+
raise "Exception : Element Not Present"
|
60
89
|
end
|
61
90
|
else
|
62
|
-
|
63
|
-
|
64
|
-
raise "present"
|
65
|
-
rescue Exception => e
|
66
|
-
if e.message=="present"
|
67
|
-
raise "Exception : Element Present"
|
68
|
-
end
|
91
|
+
if result
|
92
|
+
raise "Exception : Element Present"
|
69
93
|
end
|
70
94
|
end
|
71
95
|
end
|
72
96
|
|
73
97
|
#method to assert checkbox check
|
74
98
|
def is_checkbox_checked(access_type, access_name)
|
75
|
-
checkbox = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
99
|
+
checkbox = WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
76
100
|
|
77
101
|
if !checkbox.selected?
|
78
102
|
raise "Checkbox not checked"
|
@@ -81,7 +105,7 @@ end
|
|
81
105
|
|
82
106
|
#method to assert checkbox uncheck
|
83
107
|
def is_checkbox_unchecked(access_type, access_name)
|
84
|
-
checkbox = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
108
|
+
checkbox = WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
85
109
|
|
86
110
|
if checkbox.selected?
|
87
111
|
raise "Checkbox checked"
|
@@ -90,7 +114,7 @@ end
|
|
90
114
|
|
91
115
|
#method to assert checkbox check
|
92
116
|
def is_radio_button_selected(access_type, access_name)
|
93
|
-
radio_button = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
117
|
+
radio_button = WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
94
118
|
|
95
119
|
if !radio_button.selected?
|
96
120
|
raise "Radio button is not selected"
|
@@ -99,7 +123,7 @@ end
|
|
99
123
|
|
100
124
|
#method to assert checkbox uncheck
|
101
125
|
def is_radio_button_unselected(access_type, access_name)
|
102
|
-
radio_button = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
126
|
+
radio_button = WAIT.until{$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
103
127
|
|
104
128
|
if radio_button.selected?
|
105
129
|
raise "Radio button is not selected"
|
@@ -109,7 +133,7 @@ end
|
|
109
133
|
|
110
134
|
#method to assert option from radio button group is selected
|
111
135
|
def is_option_from_radio_button_group_selected(access_type, by, option, access_name)
|
112
|
-
radio_button_group = $driver.find_elements(:"#{access_type}" => "#{access_name}")
|
136
|
+
radio_button_group = WAIT.until{$driver.find_elements(:"#{access_type}" => "#{access_name}")}
|
113
137
|
|
114
138
|
i=0
|
115
139
|
|
@@ -138,7 +162,7 @@ end
|
|
138
162
|
|
139
163
|
#method to assert option from radio button group is not selected
|
140
164
|
def is_option_from_radio_button_group_not_selected(access_type, by, option, access_name)
|
141
|
-
radio_button_group = $driver.find_elements(:"#{access_type}" => "#{access_name}")
|
165
|
+
radio_button_group = WAIT.until{$driver.find_elements(:"#{access_type}" => "#{access_name}")}
|
142
166
|
|
143
167
|
i=0
|
144
168
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
|
+
|
4
|
+
def click(access_type,access_name)
|
5
|
+
element = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.click
|
6
|
+
end
|
7
|
+
|
8
|
+
def submit(access_type,access_name)
|
9
|
+
element = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.submit
|
10
|
+
end
|
@@ -1,33 +1,32 @@
|
|
1
|
-
|
2
|
-
require "selenium-webdriver"
|
1
|
+
require_relative 'required_files'
|
3
2
|
|
4
3
|
# method to enter text into textfield
|
5
4
|
def enter_text(access_type,text,access_name)
|
6
|
-
$driver.find_element(:"#{access_type}" => "#{access_name}").send_keys text
|
5
|
+
WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.send_keys text
|
7
6
|
end
|
8
7
|
|
9
8
|
# method to clear text from textfield
|
10
9
|
def clear_text(access_type,access_name)
|
11
|
-
$driver.find_element(:"#{access_type}" => "#{access_name}").clear
|
10
|
+
WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.clear
|
12
11
|
end
|
13
12
|
|
14
13
|
# method to select option from dropdwon list
|
15
14
|
def select_option_from_dropdown(access_type, by, option, access_name)
|
16
|
-
|
15
|
+
dropdown = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
17
16
|
select_list = Selenium::WebDriver::Support::Select.new(dropdown)
|
18
17
|
select_list.select_by(:"#{by}", "#{option}")
|
19
18
|
end
|
20
19
|
|
21
20
|
# method to unselect all option from dropdwon list
|
22
21
|
def unselect_option_from_dropdown(access_type, access_name)
|
23
|
-
|
22
|
+
dropdown = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
24
23
|
select_list = Selenium::WebDriver::Support::Select.new(dropdown)
|
25
24
|
select_list.deselect_all()
|
26
25
|
end
|
27
26
|
|
28
27
|
#method to check checkbox
|
29
28
|
def check_checkbox(access_type, access_name)
|
30
|
-
checkbox = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
29
|
+
checkbox = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
31
30
|
|
32
31
|
if !checkbox.selected?
|
33
32
|
checkbox.click
|
@@ -36,7 +35,7 @@ end
|
|
36
35
|
|
37
36
|
#method to uncheck checkbox
|
38
37
|
def uncheck_checkbox(access_type, access_name)
|
39
|
-
checkbox = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
38
|
+
checkbox = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
40
39
|
|
41
40
|
if checkbox.selected?
|
42
41
|
checkbox.click
|
@@ -45,12 +44,12 @@ end
|
|
45
44
|
|
46
45
|
#method to select radio button
|
47
46
|
def toggle_checkbox(access_type, access_name)
|
48
|
-
$driver.find_element(:"#{access_type}" => "#{access_name}").click
|
47
|
+
WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.click
|
49
48
|
end
|
50
49
|
|
51
50
|
#method to select radio button
|
52
51
|
def select_radio_button(access_type, access_name)
|
53
|
-
radio_button = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
52
|
+
radio_button = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
54
53
|
|
55
54
|
if !radio_button.selected?
|
56
55
|
radio_button.click
|
@@ -59,7 +58,7 @@ end
|
|
59
58
|
|
60
59
|
#method to select option from radio button group
|
61
60
|
def select_option_from_radio_button_group(access_type, by, option, access_name)
|
62
|
-
radio_button_group = $driver.find_elements(:"#{access_type}" => "#{access_name}")
|
61
|
+
radio_button_group = WAIT.until {$driver.find_elements(:"#{access_type}" => "#{access_name}")}
|
63
62
|
|
64
63
|
i=0
|
65
64
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
require "selenium-webdriver"
|
1
|
+
require_relative 'required_files'
|
3
2
|
|
4
3
|
|
5
4
|
def navigate_to(link)
|
@@ -15,8 +14,8 @@ def close_driver
|
|
15
14
|
end
|
16
15
|
|
17
16
|
def scroll_to_element(access_type,access_name)
|
18
|
-
ele_scroll = $driver.find_element(:"#{access_type}" => "#{access_name}")
|
19
|
-
|
17
|
+
ele_scroll = WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}
|
18
|
+
ele_scroll.location_once_scrolled_into_view
|
20
19
|
end
|
21
20
|
|
22
21
|
def zoom_in_out(in_out)
|
@@ -40,7 +39,7 @@ def zoom_in_out_till_element_display(access_type, in_out, access_name)
|
|
40
39
|
|
41
40
|
while true
|
42
41
|
|
43
|
-
if $driver.find_element(:"#{access_type}" => "#{access_name}").displayed?
|
42
|
+
if WAIT.until {$driver.find_element(:"#{access_type}" => "#{access_name}")}.displayed?
|
44
43
|
break
|
45
44
|
else
|
46
45
|
$driver.action.key_down(:"#{key}").send_keys(:"#{in_out}").key_up(:"#{key}").perform
|
@@ -49,6 +48,9 @@ def zoom_in_out_till_element_display(access_type, in_out, access_name)
|
|
49
48
|
|
50
49
|
end
|
51
50
|
|
51
|
+
def resize_browser(width,heigth)
|
52
|
+
$driver.manage.window.resize_to(width,heigth)
|
53
|
+
end
|
52
54
|
|
53
55
|
def get_os
|
54
56
|
case CONFIG['host_os']
|
@@ -70,6 +72,4 @@ def get_os
|
|
70
72
|
end
|
71
73
|
end
|
72
74
|
|
73
|
-
|
74
|
-
$driver.manage.window.resize_to(width,heigth)
|
75
|
-
end
|
75
|
+
|
@@ -57,26 +57,6 @@ Then(/^I zoom out page$/) do
|
|
57
57
|
zoom_in_out("subtract")
|
58
58
|
end
|
59
59
|
|
60
|
-
#steps to zoom in till element displays
|
61
|
-
Then(/^I zoom in page till I see element having id "(.*?)"$/) do |access_name|
|
62
|
-
zoom_in_out_till_element_display("id", "add", access_name)
|
63
|
-
end
|
64
|
-
|
65
|
-
Then(/^I zoom in page till I see element having name "(.*?)"$/) do |access_name|
|
66
|
-
zoom_in_out_till_element_display("name", "add", access_name)
|
67
|
-
end
|
68
|
-
|
69
|
-
Then(/^I zoom in page till I see element having class "(.*?)"$/) do |access_name|
|
70
|
-
zoom_in_out_till_element_display("class", "add", access_name)
|
71
|
-
end
|
72
|
-
|
73
|
-
Then(/^I zoom in page till I see element having xpath "(.*?)"$/) do |access_name|
|
74
|
-
zoom_in_out_till_element_display("xpath", "add", access_name)
|
75
|
-
end
|
76
|
-
|
77
|
-
Then(/^I zoom in page till I see element having css "(.*?)"$/) do |access_name|
|
78
|
-
zoom_in_out_till_element_display("css", "add", access_name)
|
79
|
-
end
|
80
60
|
|
81
61
|
#steps to zoom out till element displays
|
82
62
|
Then(/^I zoom out page till I see element having id "(.*?)"$/) do |access_name|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cucumber
|
@@ -54,30 +54,33 @@ extra_rdoc_files: []
|
|
54
54
|
files:
|
55
55
|
- lib/selenium-cucumber.rb
|
56
56
|
- lib/selenium-cucumber/assertion_steps.rb
|
57
|
+
- lib/selenium-cucumber/click_elements_steps.rb
|
57
58
|
- lib/selenium-cucumber/configuration_steps.rb
|
58
59
|
- lib/selenium-cucumber/input_steps.rb
|
59
60
|
- lib/selenium-cucumber/javascript_handling_steps.rb
|
60
61
|
- lib/selenium-cucumber/navigation_steps.rb
|
61
|
-
- lib/selenium-cucumber/press_button_steps.rb
|
62
62
|
- lib/selenium-cucumber/progress_steps.rb
|
63
63
|
- lib/selenium-cucumber/screenshot_steps.rb
|
64
64
|
- lib/selenium-cucumber/version.rb
|
65
65
|
- lib/selenium-cucumber/methods/assertion_methods.rb
|
66
|
+
- lib/selenium-cucumber/methods/click_elements_methods.rb
|
66
67
|
- lib/selenium-cucumber/methods/configuration_methods.rb
|
67
68
|
- lib/selenium-cucumber/methods/input_methods.rb
|
68
69
|
- lib/selenium-cucumber/methods/javascript_handling_methods.rb
|
69
70
|
- lib/selenium-cucumber/methods/navigate_methods.rb
|
70
|
-
- lib/selenium-cucumber/methods/press_button_methods.rb
|
71
71
|
- lib/selenium-cucumber/methods/progress_methods.rb
|
72
|
+
- lib/selenium-cucumber/methods/required_files.rb
|
72
73
|
- lib/selenium-cucumber/methods/screenshot_methods.rb
|
73
74
|
- bin/generate.rb
|
74
75
|
- bin/helper.rb
|
75
76
|
- features-skeleton/my_first.feature
|
76
77
|
- features-skeleton/step_definitions/custom_steps.rb
|
77
78
|
- features-skeleton/support/env.rb
|
79
|
+
- features-skeleton/support/hooks.rb
|
78
80
|
- doc/canned_steps.md
|
79
81
|
- doc/installation.md
|
80
|
-
- doc/selenium-cucumber-
|
82
|
+
- doc/selenium-cucumber-API.md
|
83
|
+
- doc/selenium-cucumber-help.md
|
81
84
|
- bin/selenium-cucumber
|
82
85
|
homepage: http://seleniumcucumber.wordpress.com/
|
83
86
|
licenses:
|