itms_automation 2.1 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/generate.rb +3 -37
- data/bin/helper.rb +23 -10
- data/bin/itms_automation +18 -23
- data/doc/installation.md +16 -0
- data/doc/itms-automation-API.md +103 -0
- data/doc/itms-automation-help.md +18 -0
- data/example/android/android_app/android_app_calculator.zip +0 -0
- data/example/android/android_app/android_app_calculator/AndroidCalculator.apk +0 -0
- data/example/android/android_app/android_app_calculator/features/calculator.feature +36 -0
- data/example/android/android_app/android_app_calculator/features/my_first.feature +13 -0
- data/example/android/android_app/android_app_calculator/features/screenshots/test.png +0 -0
- data/example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb +5 -0
- data/example/android/android_app/android_app_calculator/features/support/env.rb +52 -0
- data/example/android/android_app/android_app_calculator/features/support/hooks.rb +26 -0
- data/example/android/android_web/android_web_gmail_login.zip +0 -0
- data/example/android/android_web/android_web_gmail_login/features/gmail_login.feature +12 -0
- data/example/android/android_web/android_web_gmail_login/features/my_first.feature +1 -0
- data/example/android/android_web/android_web_gmail_login/features/screenshots/test.png +0 -0
- data/example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb +5 -0
- data/example/android/android_web/android_web_gmail_login/features/support/env.rb +51 -0
- data/example/android/android_web/android_web_gmail_login/features/support/hooks.rb +27 -0
- data/example/desktop web/desktop_web_gmail_login.zip +0 -0
- data/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +9 -0
- data/example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature +21 -0
- data/example/desktop web/desktop_web_gmail_login/features/my_first.feature +1 -0
- data/example/desktop web/desktop_web_gmail_login/features/screenshots/test.png +0 -0
- data/example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb +5 -0
- data/example/desktop web/desktop_web_gmail_login/features/support/env.rb +51 -0
- data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +26 -0
- data/features-skeleton/my_first.feature +5 -0
- data/features-skeleton/screenshots/test.png +0 -0
- data/features-skeleton/step_definitions/custom_steps.rb +5 -0
- data/features-skeleton/support/env.rb +104 -0
- data/features-skeleton/support/hooks.rb +74 -0
- data/lib/itms_automation.rb +1 -3
- data/lib/itms_automation/assertion_steps.rb +68 -0
- data/lib/itms_automation/click_elements_steps.rb +24 -0
- data/lib/itms_automation/configuration_steps.rb +7 -0
- data/lib/itms_automation/input_steps.rb +59 -0
- data/lib/itms_automation/javascript_handling_steps.rb +10 -0
- data/lib/itms_automation/methods/assertion_methods.rb +344 -0
- data/lib/itms_automation/methods/click_elements_methods.rb +23 -0
- data/lib/itms_automation/methods/configuration_methods.rb +35 -0
- data/lib/itms_automation/methods/error_handling_methods.rb +87 -0
- data/lib/itms_automation/methods/input_methods.rb +69 -0
- data/lib/itms_automation/methods/javascript_handling_methods.rb +9 -0
- data/lib/itms_automation/methods/misc_methods.rb +47 -0
- data/lib/itms_automation/methods/navigate_methods.rb +123 -0
- data/lib/itms_automation/methods/progress_methods.rb +15 -0
- data/lib/itms_automation/methods/required_files.rb +9 -0
- data/lib/itms_automation/methods/screenshot_methods.rb +6 -0
- data/lib/itms_automation/navigation_steps.rb +79 -0
- data/lib/itms_automation/progress_steps.rb +17 -0
- data/lib/itms_automation/screenshot_steps.rb +6 -0
- data/lib/itms_automation/version.rb +5 -3
- metadata +84 -102
- data/bin/console +0 -14
- data/bin/documentation_generator.rb +0 -119
- data/bin/setup +0 -8
- data/lib/itms_automation/all_steps.rb +0 -8
- data/lib/itms_automation/assertion_helper.rb +0 -29
- data/lib/itms_automation/auto_util.rb +0 -694
- data/lib/itms_automation/database_steps_helper.rb +0 -125
- data/lib/itms_automation/web_steps_helper.rb +0 -606
- data/project/Gemfile +0 -3
- data/project/Gemfile.lock +0 -92
- data/project/README.md +0 -34
- data/project/Rakefile +0 -24
- data/project/config/chrome_headless_options.yaml +0 -1
- data/project/config/chrome_options.yaml +0 -6
- data/project/config/firefox_headless_options.yaml +0 -1
- data/project/config/firefox_options.yaml +0 -1
- data/project/config/ie_options.yaml +0 -1
- data/project/config/remote_options.yaml +0 -6
- data/project/config/safari_options.yaml +0 -1
- data/project/cucumber.yml +0 -4
- data/project/features/TestSuite/WebGUI.feature +0 -5
- data/project/features/step_definitions/lib_steps/steps_definition.rb +0 -46
- data/project/features/step_definitions/repositories/project_object.yml +0 -26
- data/project/features/support/env.rb +0 -9
- data/project/features/support/hooks.rb +0 -130
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
|
+
# method to print configuration
|
4
|
+
def print_congifugartion
|
5
|
+
puts ''
|
6
|
+
puts "Date : #{Time.now.strftime("%d-%B-%Y")}"
|
7
|
+
puts "Time : #{Time.now.strftime("%I:%M:%S:%p")}"
|
8
|
+
|
9
|
+
if $platform == 'android' or $platform == 'ios'
|
10
|
+
print_mobile_configuration
|
11
|
+
else
|
12
|
+
print_desktop_configuration
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
# method to print desktop configuration
|
17
|
+
def print_desktop_configuration
|
18
|
+
puts 'Platform : ' + Selenium::WebDriver::Platform.os.to_s.upcase
|
19
|
+
puts 'Browser : ' + $driver.capabilities.browser_name.to_s.upcase + " " + $driver.capabilities.version.to_s
|
20
|
+
puts ''
|
21
|
+
end
|
22
|
+
|
23
|
+
# method to print mobile configuration
|
24
|
+
def print_mobile_configuration
|
25
|
+
puts "Platform : #{$platform.upcase}"
|
26
|
+
puts "OS version : #{$os_version}"
|
27
|
+
puts "Device : #{$device_name}"
|
28
|
+
|
29
|
+
if $app_path.nil?
|
30
|
+
puts 'Browser : ' + $driver.capabilities.browser_name.to_s.upcase + " " + $driver.capabilities.version.to_s
|
31
|
+
else
|
32
|
+
puts "App Tested : #{$app_path}"
|
33
|
+
end
|
34
|
+
puts ''
|
35
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# Error handling methods
|
2
|
+
|
3
|
+
# Method to check browser type
|
4
|
+
def validate_parameters(platform, browser_type, app_path)
|
5
|
+
if platform == 'desktop'
|
6
|
+
if !%w(firefox internet_explorer chrome safari opera chrome_headless remote).include? browser_type
|
7
|
+
print_error_desktop
|
8
|
+
end
|
9
|
+
elsif platform == 'android'
|
10
|
+
print_error_android browser_type, app_path
|
11
|
+
elsif platform == 'iOS'
|
12
|
+
puts "Not Implemented..."
|
13
|
+
# print_error_ios browser_type, app_path
|
14
|
+
else
|
15
|
+
print_invalid_platform
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# print error for desktop
|
20
|
+
def print_error_desktop
|
21
|
+
puts "\nInappropraite desktop browser : \"#{ENV['BROWSER']}\""
|
22
|
+
puts "\nUsage : cucumber BROWSER=browser_name"
|
23
|
+
puts "\nBrowser Supported :\n"
|
24
|
+
puts "\n1.internet_explorer\n2.chrome\n3.firefox\n4.safari\n5.opera\n6.chrome_headless\n7.remote"
|
25
|
+
Process.exit(0)
|
26
|
+
end
|
27
|
+
|
28
|
+
# print error for android
|
29
|
+
def print_error_android(browser_type, app_path)
|
30
|
+
if browser_type=='firefox' and app_path==nil
|
31
|
+
puts "\nOops... not mentioned \"Browser\" or \"App path\""
|
32
|
+
print_error_android_app
|
33
|
+
print_error_android_web
|
34
|
+
Process.exit(0)
|
35
|
+
elsif browser_type!='firefox' and !%w(native chrome).include? browser_type
|
36
|
+
puts "\nOops... not supported browser"
|
37
|
+
print_error_android_web
|
38
|
+
Process.exit(0)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# print error for android app
|
43
|
+
def print_error_android_app
|
44
|
+
puts "\nTo run test on android app"
|
45
|
+
puts "\n Usage : cucumber PLATFORM=android APP_PATH=path/to/app"
|
46
|
+
end
|
47
|
+
|
48
|
+
# print error for android web
|
49
|
+
def print_error_android_web
|
50
|
+
puts "\nTo run test on android mobile web"
|
51
|
+
puts "\n Usage : cucumber PLATFORM=android BROWSER=browser_name"
|
52
|
+
puts "\n Supported browsers are \"chrome\" and \"native\""
|
53
|
+
end
|
54
|
+
|
55
|
+
# print error for ios
|
56
|
+
def print_error_ios
|
57
|
+
if browser_type=='firefox' and app_path==nil
|
58
|
+
puts "\nOops... not mentioned \"Browser\" or \"App path\""
|
59
|
+
print_error_ios_app
|
60
|
+
print_error_ios_web
|
61
|
+
Process.exit(0)
|
62
|
+
elsif browser_type!='safari'
|
63
|
+
puts "\nOops... not supported browser"
|
64
|
+
print_error_ios_app_web
|
65
|
+
Process.exit(0)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# print error for ios app
|
70
|
+
def print_error_ios_app
|
71
|
+
puts "\nTo run test on iOS App"
|
72
|
+
puts "\n Usage : cucumber PLATFORM=iOS APP_PATH=path/to/app"
|
73
|
+
end
|
74
|
+
|
75
|
+
# print error for ios web
|
76
|
+
def print_error_ios_web
|
77
|
+
puts "\nTo run test on iOS mobile web"
|
78
|
+
puts "\n Usage : cucumber PLATFORM=iOS BROWSER=safari"
|
79
|
+
end
|
80
|
+
|
81
|
+
# print error if invalid platform
|
82
|
+
def print_invalid_platform
|
83
|
+
puts "\nOops... Invalid Platform"
|
84
|
+
puts "\nSupported platform are \"android\" and \"iOS\"."
|
85
|
+
puts "\nTo run on Desktop no need to mention platform."
|
86
|
+
Process.exit(0)
|
87
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
|
+
# method to enter text into textfield
|
4
|
+
def enter_text(element, text)
|
5
|
+
foundElement = find_object(element)
|
6
|
+
WAIT.until { foundElement }.send_keys(text)
|
7
|
+
end
|
8
|
+
|
9
|
+
# method to clear text from textfield
|
10
|
+
def clear_text(element)
|
11
|
+
foundElement = find_object(element)
|
12
|
+
WAIT.until { foundElement }.clear
|
13
|
+
end
|
14
|
+
|
15
|
+
# method to select option from dropdwon list
|
16
|
+
def select_option_from_dropdown(element, by, option)
|
17
|
+
dropdown = WAIT.until { find_object(element) }
|
18
|
+
select_list = Selenium::WebDriver::Support::Select.new(dropdown)
|
19
|
+
select_list.select_by(:"#{by}", "#{option}")
|
20
|
+
end
|
21
|
+
|
22
|
+
# method to select all option from dropdwon list
|
23
|
+
def select_all_option_from_multiselect_dropdown(element)
|
24
|
+
dropdown = WAIT.until { find_object(element) }
|
25
|
+
select_list = Selenium::WebDriver::Support::Select.new(dropdown)
|
26
|
+
select_list.select_all
|
27
|
+
end
|
28
|
+
|
29
|
+
# method to unselect all option from dropdwon list
|
30
|
+
def unselect_all_option_from_multiselect_dropdown(element)
|
31
|
+
dropdown = WAIT.until { find_object(element) }
|
32
|
+
select_list = Selenium::WebDriver::Support::Select.new(dropdown)
|
33
|
+
select_list.deselect_all
|
34
|
+
end
|
35
|
+
|
36
|
+
# method to check checkbox
|
37
|
+
def check_checkbox(element)
|
38
|
+
checkbox = WAIT.until { find_object(element) }
|
39
|
+
checkbox.click unless checkbox.selected?
|
40
|
+
end
|
41
|
+
|
42
|
+
# method to uncheck checkbox
|
43
|
+
def uncheck_checkbox(element)
|
44
|
+
checkbox = WAIT.until { find_object(element) }
|
45
|
+
|
46
|
+
if checkbox.selected?
|
47
|
+
checkbox.click
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# method to select radio button
|
52
|
+
def toggle_checkbox(element)
|
53
|
+
WAIT.until { find_object(element) }.click
|
54
|
+
end
|
55
|
+
|
56
|
+
# method to select radio button
|
57
|
+
def select_radio_button(element)
|
58
|
+
radio_button = WAIT.until { find_object(element) }
|
59
|
+
radio_button.click unless radio_button.selected?
|
60
|
+
end
|
61
|
+
|
62
|
+
# method to select option from radio button group
|
63
|
+
def select_option_from_radio_button_group(element, by, option)
|
64
|
+
radio_button_group = WAIT.until { find_object(element) }
|
65
|
+
|
66
|
+
getter = ->(rb, by) { by == 'value' ? rb.attribute('value') : rb.text }
|
67
|
+
ele = radio_button_group.find { |rb| getter.call(rb, by) == option }
|
68
|
+
ele.click unless ele.selected?
|
69
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
|
2
|
+
# custome exception class
|
3
|
+
class TestCaseFailed < Exception
|
4
|
+
end
|
5
|
+
|
6
|
+
# WAIT instance for explicit wait
|
7
|
+
WAIT = Selenium::WebDriver::Wait.new(:timeout => 30)
|
8
|
+
|
9
|
+
# method to validate locator
|
10
|
+
def valid_locator_type? type
|
11
|
+
%w(id class css name xpath).include? type
|
12
|
+
end
|
13
|
+
|
14
|
+
def validate_locator type
|
15
|
+
raise "Invalid locator type - #{type}" unless valid_locator_type? type
|
16
|
+
end
|
17
|
+
|
18
|
+
# method to validate dropdown selector
|
19
|
+
def valid_option_by? option_by
|
20
|
+
%w(text value index).include? option_by
|
21
|
+
end
|
22
|
+
|
23
|
+
def validate_option_by option_by
|
24
|
+
raise "Invalid option by - #{option_by}" unless valid_option_by? option_by
|
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
|
35
|
+
|
36
|
+
def find_object(string_object)
|
37
|
+
string_object = string_object.gsub(/"/, "'")
|
38
|
+
hash_object = $OBJECT[string_object]
|
39
|
+
if hash_object == nil
|
40
|
+
raise "Object not found - Object: #{string_object} is not found in Object Repository."
|
41
|
+
end
|
42
|
+
locator_type = hash_object.keys.first.to_s
|
43
|
+
locator_value = hash_object[locator_type]
|
44
|
+
validate_locator(locator_type)
|
45
|
+
$driver.find_element(:"#{locator_type}" => "#{locator_value}")
|
46
|
+
end
|
47
|
+
|
@@ -0,0 +1,123 @@
|
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
|
+
# method to open link
|
4
|
+
def navigate_to(link)
|
5
|
+
$driver.get link
|
6
|
+
end
|
7
|
+
|
8
|
+
# method to navigate back & forword
|
9
|
+
def navigate(direction)
|
10
|
+
if direction == 'back'
|
11
|
+
$driver.navigate.back
|
12
|
+
else
|
13
|
+
$driver.navigate.forward
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# method to quite webdriver instance
|
18
|
+
def close_driver
|
19
|
+
$driver.quit
|
20
|
+
end
|
21
|
+
|
22
|
+
# method to return key by os wise
|
23
|
+
def get_key
|
24
|
+
os = Selenium::WebDriver::Platform.os
|
25
|
+
if os.to_s == 'windows'
|
26
|
+
return 'control'
|
27
|
+
elsif os.to_s == 'macosx'
|
28
|
+
return 'command'
|
29
|
+
else
|
30
|
+
raise 'Invalid OS'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Method to zoom in/out page
|
35
|
+
def zoom_in_out(in_out)
|
36
|
+
$driver.action.key_down(:"#{get_key}").send_keys(:"#{in_out}").key_up(:"#{get_key}").perform
|
37
|
+
end
|
38
|
+
|
39
|
+
# Method to zoom in/out web page until web element displyas
|
40
|
+
def zoom_in_out_till_element_display(element, in_out)
|
41
|
+
while true
|
42
|
+
if WAIT.until { find_object(element) }.displayed?
|
43
|
+
break
|
44
|
+
else
|
45
|
+
$driver.action.key_down(:"#{get_key}").send_keys(:"#{in_out}").key_up(:"#{get_key}").perform
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Method to resize browser
|
51
|
+
def resize_browser(width, heigth)
|
52
|
+
$driver.manage.window.resize_to(width, heigth)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Method to maximize browser
|
56
|
+
def maximize_browser
|
57
|
+
$driver.manage.window.maximize
|
58
|
+
end
|
59
|
+
|
60
|
+
# Method to refresh page
|
61
|
+
def refresh_page
|
62
|
+
$driver.navigate.refresh
|
63
|
+
end
|
64
|
+
|
65
|
+
# Method to hover on element
|
66
|
+
def hover_over_element(element)
|
67
|
+
element = WAIT.until { find_object(element) }
|
68
|
+
$driver.action.move_to(element).perform
|
69
|
+
end
|
70
|
+
|
71
|
+
# Method to scroll page to perticular element
|
72
|
+
def scroll_to_element(element)
|
73
|
+
ele_scroll = WAIT.until { find_object(element) }
|
74
|
+
ele_scroll.location_once_scrolled_into_view
|
75
|
+
end
|
76
|
+
|
77
|
+
# method to scroll page to top or end
|
78
|
+
def scroll_page(to)
|
79
|
+
if to == 'end'
|
80
|
+
$driver.execute_script('window.scrollTo(0,Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.clientHeight));')
|
81
|
+
elsif to == 'top'
|
82
|
+
$driver.execute_script('window.scrollTo(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,document.documentElement.clientHeight),0);')
|
83
|
+
else
|
84
|
+
raise "Exception : Invalid Direction (only scroll \"top\" or \"end\")"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
$old_win = nil
|
89
|
+
|
90
|
+
# Method to switch to new window
|
91
|
+
|
92
|
+
def switch_to_new_window
|
93
|
+
$old_win = $driver.window_handle
|
94
|
+
$driver.switch_to.window($driver.window_handles[1])
|
95
|
+
end
|
96
|
+
|
97
|
+
|
98
|
+
# Method to switch to old window
|
99
|
+
def switch_to_old_window
|
100
|
+
$driver.switch_to.window($old_win)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Method to close new window
|
104
|
+
def close_new_window
|
105
|
+
$driver.close
|
106
|
+
end
|
107
|
+
|
108
|
+
=begin
|
109
|
+
def switch_to_new_window
|
110
|
+
win_handles = $driver.window_handles
|
111
|
+
|
112
|
+
puts $driver.title
|
113
|
+
puts win_handles.length
|
114
|
+
|
115
|
+
$driver.switch_to.window($driver.window_handles[1])
|
116
|
+
puts $driver.window_handles[1]
|
117
|
+
puts $driver.title
|
118
|
+
|
119
|
+
$driver.switch_to.window($driver.window_handles[2])
|
120
|
+
puts $driver.window_handles[2]
|
121
|
+
puts $driver.title
|
122
|
+
end
|
123
|
+
=end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require_relative 'required_files'
|
2
|
+
|
3
|
+
def wait(time)
|
4
|
+
sleep time.to_i
|
5
|
+
end
|
6
|
+
|
7
|
+
def wait_for_element_to_display(element, duration)
|
8
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => duration.to_i) # seconds
|
9
|
+
wait.until { find_object(element).displayed? }
|
10
|
+
end
|
11
|
+
|
12
|
+
def wait_for_element_to_enable(element, duration)
|
13
|
+
wait = Selenium::WebDriver::Wait.new(:timeout => duration.to_i) # seconds
|
14
|
+
wait.until { find_object(element).enabled? }
|
15
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# require 'cucumber'
|
2
|
+
# require_relative 'methods/navigate_methods'
|
3
|
+
|
4
|
+
# Then(/^I navigate to "([^\"]*)"$/)do |link|
|
5
|
+
# navigate_to(link)
|
6
|
+
# end
|
7
|
+
|
8
|
+
# Then(/^I navigate forward/) do
|
9
|
+
# navigate('forward')
|
10
|
+
# end
|
11
|
+
|
12
|
+
# Then(/^I navigate back/) do
|
13
|
+
# navigate('back')
|
14
|
+
# end
|
15
|
+
|
16
|
+
# Then(/^I close browser$/) do
|
17
|
+
# close_driver
|
18
|
+
# end
|
19
|
+
|
20
|
+
# # step to resize browser
|
21
|
+
# Then(/^I resize browser window size to width (\d+) and height (\d+)$/) do |width, heigth|
|
22
|
+
# resize_browser(width, heigth)
|
23
|
+
# end
|
24
|
+
|
25
|
+
# # step to maximize browser
|
26
|
+
# Then(/^I maximize browser window$/) do
|
27
|
+
# maximize_browser
|
28
|
+
# end
|
29
|
+
|
30
|
+
# # steps to refresh page
|
31
|
+
# Then(/^I refresh page$/) do
|
32
|
+
# refresh_page
|
33
|
+
# end
|
34
|
+
|
35
|
+
# Then(/^I switch to new window$/) do
|
36
|
+
# switch_to_new_window
|
37
|
+
# end
|
38
|
+
|
39
|
+
# Then(/^I switch to previous window$/) do
|
40
|
+
# switch_to_old_window
|
41
|
+
# end
|
42
|
+
|
43
|
+
# Then(/^I close new window$/) do
|
44
|
+
# close_new_window
|
45
|
+
# end
|
46
|
+
|
47
|
+
# # steps to scroll to element
|
48
|
+
# Then(/^I scroll to element "(.*?)"$/) do |type, element|
|
49
|
+
# scroll_to_element(type, element)
|
50
|
+
# end
|
51
|
+
|
52
|
+
# # steps to scroll web page to top or end
|
53
|
+
# Then(/^I scroll to (top|end) of page$/) do |to|
|
54
|
+
# scroll_page(to)
|
55
|
+
# end
|
56
|
+
|
57
|
+
# # step to hover over a element Note: Doesn't work on Windows firefox
|
58
|
+
# When(/^I hover over element having (.+) "(.*?)"$/) do |type, element|
|
59
|
+
# hover_over_element(type, element)
|
60
|
+
# end
|
61
|
+
|
62
|
+
# # steps to zoom in page
|
63
|
+
# Then(/^I zoom in page$/) do
|
64
|
+
# zoom_in_out('add')
|
65
|
+
# end
|
66
|
+
|
67
|
+
# # steps to zoom out page
|
68
|
+
# Then(/^I zoom out page$/) do
|
69
|
+
# zoom_in_out('subtract')
|
70
|
+
# end
|
71
|
+
|
72
|
+
# # steps to zoom out till element displays
|
73
|
+
# Then(/^I zoom out page till I see element "(.*?)"$/) do |type, element|
|
74
|
+
# zoom_in_out_till_element_display(type, 'subtract', element)
|
75
|
+
# end
|
76
|
+
|
77
|
+
# Then(/^I reset page view$/) do
|
78
|
+
# zoom_in_out('numpad0')
|
79
|
+
# end
|