itms_automation 2.6.2 → 2.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/doc/installation.md +1 -1
  3. data/features-skeleton/README.md +128 -66
  4. data/features-skeleton/my_first.feature +19 -10
  5. data/features-skeleton/step_definitions/assertion_steps.rb +69 -0
  6. data/features-skeleton/step_definitions/click_elements_steps.rb +25 -0
  7. data/features-skeleton/step_definitions/configuration_steps.rb +8 -0
  8. data/features-skeleton/step_definitions/input_steps.rb +60 -0
  9. data/features-skeleton/step_definitions/javascript_handling_steps.rb +11 -0
  10. data/features-skeleton/step_definitions/my_first_steps.rb +14 -0
  11. data/features-skeleton/step_definitions/navigation_steps.rb +80 -0
  12. data/features-skeleton/step_definitions/progress_steps.rb +18 -0
  13. data/features-skeleton/step_definitions/repositories/project_object.yml +1 -1
  14. data/features-skeleton/support/env.rb +29 -96
  15. data/lib/itms_automation/input_steps.rb +1 -1
  16. data/lib/itms_automation/methods/assertion_methods.rb +2 -2
  17. data/lib/itms_automation/methods/misc_methods.rb +2 -1
  18. data/lib/itms_automation/methods/navigate_methods.rb +2 -4
  19. data/lib/itms_automation/version.rb +1 -1
  20. metadata +28 -44
  21. data/example/android/android_app/android_app_calculator.zip +0 -0
  22. data/example/android/android_app/android_app_calculator/AndroidCalculator.apk +0 -0
  23. data/example/android/android_app/android_app_calculator/features/calculator.feature +0 -36
  24. data/example/android/android_app/android_app_calculator/features/my_first.feature +0 -13
  25. data/example/android/android_app/android_app_calculator/features/screenshots/test.png +0 -0
  26. data/example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb +0 -5
  27. data/example/android/android_app/android_app_calculator/features/support/env.rb +0 -52
  28. data/example/android/android_app/android_app_calculator/features/support/hooks.rb +0 -26
  29. data/example/android/android_web/android_web_gmail_login.zip +0 -0
  30. data/example/android/android_web/android_web_gmail_login/features/gmail_login.feature +0 -12
  31. data/example/android/android_web/android_web_gmail_login/features/my_first.feature +0 -1
  32. data/example/android/android_web/android_web_gmail_login/features/screenshots/test.png +0 -0
  33. data/example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb +0 -5
  34. data/example/android/android_web/android_web_gmail_login/features/support/env.rb +0 -51
  35. data/example/android/android_web/android_web_gmail_login/features/support/hooks.rb +0 -27
  36. data/example/desktop web/desktop_web_gmail_login.zip +0 -0
  37. data/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +0 -9
  38. data/example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature +0 -21
  39. data/example/desktop web/desktop_web_gmail_login/features/my_first.feature +0 -1
  40. data/example/desktop web/desktop_web_gmail_login/features/screenshots/test.png +0 -0
  41. data/example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb +0 -5
  42. data/example/desktop web/desktop_web_gmail_login/features/support/env.rb +0 -106
  43. data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +0 -38
  44. data/features-skeleton/step_definitions/custom_steps.rb +0 -5
@@ -0,0 +1,11 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # Then(/^I accept alert$/) do
6
+ # handle_alert('accept')
7
+ # end
8
+
9
+ # Then(/^I dismiss alert$/) do
10
+ # handle_alert('dismiss')
11
+ # end
@@ -0,0 +1,14 @@
1
+ # Given('the login page is opened successfully') do
2
+ # $driver.get("http://the-internet.herokuapp.com/login")
3
+ # end
4
+
5
+ # When('user input username {string} and password {string}') do |string, string2|
6
+ # $driver.find_element(:id, 'username').send_keys(string)
7
+ # $driver.find_element(:id, 'password').send_keys(string2)
8
+ # $driver.find_element(:css, '[class="fa fa-2x fa-sign-in"]').click
9
+ # end
10
+
11
+ # Then('the message {string} should be displayed') do |string|
12
+ # message = $driver.find_element(:css, '#flash').text.delete("\n")
13
+ # expect(message).to eql(string)
14
+ # end
@@ -0,0 +1,80 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # Then(/^I navigate to "([^\"]*)"$/)do |link|
6
+ # navigate_to(link)
7
+ # end
8
+
9
+ # Then(/^I navigate forward/) do
10
+ # navigate('forward')
11
+ # end
12
+
13
+ # Then(/^I navigate back/) do
14
+ # navigate('back')
15
+ # end
16
+
17
+ # Then(/^I close browser$/) do
18
+ # close_driver
19
+ # end
20
+
21
+ # # step to resize browser
22
+ # Then(/^I resize browser window size to width (\d+) and height (\d+)$/) do |width, heigth|
23
+ # resize_browser(width, heigth)
24
+ # end
25
+
26
+ # # step to maximize browser
27
+ # Then(/^I maximize browser window$/) do
28
+ # maximize_browser
29
+ # end
30
+
31
+ # # steps to refresh page
32
+ # Then(/^I refresh page$/) do
33
+ # refresh_page
34
+ # end
35
+
36
+ # Then(/^I switch to new window$/) do
37
+ # switch_to_new_window
38
+ # end
39
+
40
+ # Then(/^I switch to previous window$/) do
41
+ # switch_to_old_window
42
+ # end
43
+
44
+ # Then(/^I close new window$/) do
45
+ # close_new_window
46
+ # end
47
+
48
+ # # steps to scroll to element
49
+ # Then(/^I scroll to element "(.*?)"$/) do |type, element|
50
+ # scroll_to_element(type, element)
51
+ # end
52
+
53
+ # # steps to scroll web page to top or end
54
+ # Then(/^I scroll to (top|end) of page$/) do |to|
55
+ # scroll_page(to)
56
+ # end
57
+
58
+ # # step to hover over a element Note: Doesn't work on Windows firefox
59
+ # When(/^I hover over element having (.+) "(.*?)"$/) do |type, element|
60
+ # hover_over_element(type, element)
61
+ # end
62
+
63
+ # # steps to zoom in page
64
+ # Then(/^I zoom in page$/) do
65
+ # zoom_in_out('add')
66
+ # end
67
+
68
+ # # steps to zoom out page
69
+ # Then(/^I zoom out page$/) do
70
+ # zoom_in_out('subtract')
71
+ # end
72
+
73
+ # # steps to zoom out till element displays
74
+ # Then(/^I zoom out page till I see element "(.*?)"$/) do |type, element|
75
+ # zoom_in_out_till_element_display(type, 'subtract', element)
76
+ # end
77
+
78
+ # Then(/^I reset page view$/) do
79
+ # zoom_in_out('numpad0')
80
+ # end
@@ -0,0 +1,18 @@
1
+ # Do Not Remove This File
2
+ # Please adjust the below steps as your needed
3
+ # $driver is instance of webdriver use this instance to write your custom code
4
+
5
+ # # wait for specific period of time
6
+ # Then(/^I wait for (\d+) sec$/) do |time|
7
+ # wait(time)
8
+ # end
9
+
10
+ # # wait for specific element to display for specific period of time
11
+ # Then(/^I wait (\d+) seconds for element "(.*?)" to display$/) do |duration, element|
12
+ # wait_for_element_to_display(element, duration)
13
+ # end
14
+
15
+ # # wait for specific element to enable for specific period of time
16
+ # Then(/^I wait (\d+) seconds for element "(.*?)" to enable$/) do |duration, element|
17
+ # wait_for_element_to_enable(element, duration)
18
+ # end
@@ -1 +1 @@
1
- button: { id: 'submit' }
1
+ test_object: {id: 'username'}
@@ -1,105 +1,38 @@
1
1
  require "rubygems"
2
2
  require "itms_automation"
3
3
  require "httparty"
4
- require "cucumber"
5
4
  require "report_builder"
6
- require "selenium-webdriver"
5
+ require "webdrivers"
7
6
 
8
7
  $browser_type = ENV["BROWSER"] || "firefox"
9
- $platform = ENV["PLATFORM"] || "desktop"
10
- $os_version = ENV["OS_VERSION"]
11
- $device_name = ENV["DEVICE_NAME"]
12
- $udid = ENV["UDID"]
13
- $app_path = ENV["APP_PATH"]
14
8
 
15
- # check for valid parameters
16
- validate_parameters $platform, $browser_type, $app_path
17
-
18
- # If platform is android or ios create driver instance for mobile browser
19
- if $platform == "android" or $platform == "iOS"
20
- if $browser_type == "native"
21
- $browser_type = "Browser"
22
- end
23
-
24
- if $platform == "android"
25
- $device_name, $os_version = get_device_info
26
- end
27
-
28
- # desired_caps = {
29
- # caps: {
30
- # platformName: $platform,
31
- # browserName: $browser_type,
32
- # versionNumber: $os_version,
33
- # deviceName: $device_name,
34
- # udid: $udid,
35
- # app: ".//#{$app_path}"
36
- # }
37
- # }
38
- # appium_url = 'http://localhost:4723/wd/hub'
39
- # opts = {
40
- # desired_capabilities: { # or { caps: {....} }
41
- # platformName: :android,
42
- # deviceName: 'Android Simulator',
43
- # app: "WikipediaSample.apk"
44
- # },
45
- # appium_lib: {
46
- # wait: 30
47
- # }
48
- # }
49
-
50
- opts = {
51
- desired_capabilities: { # or { caps: {....} }
52
- platformName: $platform,
53
- browserName: $browser_type,
54
- deviceName: $device_name,
55
- versionNumber: $os_version,
56
- app: "WikipediaSample.apk",
57
- },
58
- appium_lib: {
59
- wait: 30,
60
- },
61
- }
62
-
63
- begin
64
- # $driver = Appium::Driver.new(desired_caps, url: appium_url).start_driver
65
-
66
- # $driver = Selenium::WebDriver.for(:remote, :url => appium_url, :desired_capabilities => desired_caps)
67
- @core = Appium::Core.for(opts) # create a core driver with `opts`
68
- $driver = @core.start_driver
69
- rescue Exception => e
70
- puts e.message
71
- Process.exit(0)
9
+ begin
10
+ $driver = case $browser_type
11
+ when "chrome"
12
+ Selenium::WebDriver.for(:chrome)
13
+ when "safari"
14
+ Selenium::WebDriver.for(:safari)
15
+ when "internet_explorer"
16
+ Selenium::WebDriver.for(:internet_explorer)
17
+ when "chrome_headless"
18
+ Selenium::WebDriver.for(:chrome, :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: %w(headless) }))
19
+ when "remote"
20
+ if ENV['SERVER_URL'].nil? || ENV['REMOTE_BROWSER'].nil?
21
+ puts "\nMissing SERVER_URL : SERVER_URL=http//SERVER_URL:4444/wd/hub"
22
+ puts "\nMissing REMOTE_BROWSER: REMOTE_BROWSER=browser_name"
23
+ Process.exit(0)
24
+ else
25
+ caps = Selenium::WebDriver::Remote::Capabilities.new
26
+ caps["browserName"] = ENV["REMOTE_BROWSER"]
27
+ caps["enableVNC"] = false
28
+ caps["enableVideo"] = false
29
+ caps["resolution"] = ENV["resolution"] unless ENV["resolution"]
30
+ Selenium::WebDriver.for(:remote, :url => ENV["SERVER_URL"], :desired_capabilities => caps)
72
31
  end
73
- else # else create driver instance for desktop browser
74
- begin
75
- $driver = case $browser_type
76
- when "chrome"
77
- Selenium::WebDriver.for(:chrome)
78
- when "safari"
79
- Selenium::WebDriver.for(:safari)
80
- when "internet_explorer"
81
- Selenium::WebDriver.for(:internet_explorer)
82
- when "chrome_headless"
83
- Selenium::WebDriver.for(:chrome, :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: %w(headless) }))
84
- when "remote"
85
- if ENV["SERVER_URL"].nil? || ENV["REMOTE_BROWSER"].nil?
86
- puts "\nMissing SERVER_URL : SERVER_URL=http://SERVER_URL:4444/wd/hub"
87
- puts "\nMissing REMOTE_BROWSER: REMOTE_BROWSER=browser_name"
88
- Process.exit(0)
89
- else
90
- caps = Selenium::WebDriver::Remote::Capabilities.new
91
- caps["browserName"] = ENV["REMOTE_BROWSER"]
92
- caps["enableVNC"] = ENV["ENABLE_VNC"] if ENV["ENABLE_VNC"].present?
93
- caps["enableVideo"] = ENV["ENABLE_VIDEO"] if ENV["ENABLE_VIDEO"].present?
94
- caps["screenResolution"] = ENV["SCREEN_RESOLUTION"] if ENV["SCREEN_RESOLUTION"].present?
95
- Selenium::WebDriver.for(:remote, :url => ENV["SERVER_URL"], :desired_capabilities => caps)
96
- end
97
- else
98
- Selenium::WebDriver.for(:firefox)
99
- end
100
- $driver.manage().window().maximize()
101
- rescue Exception => e
102
- puts e.message
103
- Process.exit(0)
32
+ else
33
+ Selenium::WebDriver.for(:firefox)
104
34
  end
105
- end
35
+ rescue Exception => e
36
+ puts e.message
37
+ Process.exit(0)
38
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  # # enter text into input field steps
5
5
  # Then(/^I enter "([^\"]*)" into element "(.*?)"$/) do |text, element|
6
- # enter_text(type, element)
6
+ # enter_text(element, text)
7
7
  # end
8
8
 
9
9
  # # clear input field steps
@@ -82,13 +82,13 @@ def check_element_partial_text(element, expected_value, test_case)
82
82
  end
83
83
  end
84
84
 
85
- # Method to return element status - enabled?
85
+ # method to return element status - enabled?
86
86
  # param : String : Element
87
87
  def is_element_enabled(element)
88
88
  WAIT.until{ find_object(element) }.enabled?
89
89
  end
90
90
 
91
- # Element enabled checking
91
+ # method to check element status - enabled?
92
92
  # param 1 : String : Element
93
93
  # param 2 : Boolean : test case [true or flase]
94
94
  def check_element_enable(element, test_case)
@@ -1,3 +1,4 @@
1
+ require 'selenium-webdriver'
1
2
 
2
3
  # custome exception class
3
4
  class TestCaseFailed < Exception
@@ -8,7 +9,7 @@ WAIT = Selenium::WebDriver::Wait.new(:timeout => 30)
8
9
 
9
10
  # method to validate locator
10
11
  def valid_locator_type? type
11
- %w(id class css name xpath).include? type
12
+ %w(id class css name xpath class_name link link_text partial_link_text).include? type
12
13
  end
13
14
 
14
15
  def validate_locator type
@@ -5,7 +5,7 @@ def navigate_to(link)
5
5
  $driver.get link
6
6
  end
7
7
 
8
- # method to navigate back & forword
8
+ # method to navigate back & forward
9
9
  def navigate(direction)
10
10
  if direction == 'back'
11
11
  $driver.navigate.back
@@ -36,7 +36,7 @@ def zoom_in_out(in_out)
36
36
  $driver.action.key_down(:"#{get_key}").send_keys(:"#{in_out}").key_up(:"#{get_key}").perform
37
37
  end
38
38
 
39
- # Method to zoom in/out web page until web element displyas
39
+ # Method to zoom in/out web page until web element dislays
40
40
  def zoom_in_out_till_element_display(element, in_out)
41
41
  while true
42
42
  if WAIT.until { find_object(element) }.displayed?
@@ -88,13 +88,11 @@ end
88
88
  $old_win = nil
89
89
 
90
90
  # Method to switch to new window
91
-
92
91
  def switch_to_new_window
93
92
  $old_win = $driver.window_handle
94
93
  $driver.switch_to.window($driver.window_handles[1])
95
94
  end
96
95
 
97
-
98
96
  # Method to switch to old window
99
97
  def switch_to_old_window
100
98
  $driver.switch_to.window($old_win)
@@ -1,5 +1,5 @@
1
1
  module ITMS
2
2
  module Automation
3
- VERSION = '2.6.2'
3
+ VERSION = '2.6.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itms_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - INFOdation
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-23 00:00:00.000000000 Z
11
+ date: 2021-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -16,40 +16,40 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.2
19
+ version: 5.2.0
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 3.1.2
22
+ version: 5.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 3.1.2
29
+ version: 5.2.0
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 3.1.2
32
+ version: 5.2.0
33
33
  - !ruby/object:Gem::Dependency
34
- name: selenium-webdriver
34
+ name: webdrivers
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '3.14'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- version: 3.14.1
39
+ version: 4.4.1
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: 4.4.1
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '3.14'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
- version: 3.14.1
49
+ version: 4.4.1
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: 4.4.1
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: appium_lib_core
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -76,20 +76,20 @@ dependencies:
76
76
  requirements:
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: 0.13.7
79
+ version: 0.18.1
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.13.7
82
+ version: 0.18.1
83
83
  type: :runtime
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.13.7
89
+ version: 0.18.1
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: 0.13.7
92
+ version: 0.18.1
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: report_builder
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -124,36 +124,20 @@ files:
124
124
  - doc/installation.md
125
125
  - doc/itms-automation-API.md
126
126
  - doc/itms-automation-help.md
127
- - example/android/android_app/android_app_calculator.zip
128
- - example/android/android_app/android_app_calculator/AndroidCalculator.apk
129
- - example/android/android_app/android_app_calculator/features/calculator.feature
130
- - example/android/android_app/android_app_calculator/features/my_first.feature
131
- - example/android/android_app/android_app_calculator/features/screenshots/test.png
132
- - example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb
133
- - example/android/android_app/android_app_calculator/features/support/env.rb
134
- - example/android/android_app/android_app_calculator/features/support/hooks.rb
135
- - example/android/android_web/android_web_gmail_login.zip
136
- - example/android/android_web/android_web_gmail_login/features/gmail_login.feature
137
- - example/android/android_web/android_web_gmail_login/features/my_first.feature
138
- - example/android/android_web/android_web_gmail_login/features/screenshots/test.png
139
- - example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb
140
- - example/android/android_web/android_web_gmail_login/features/support/env.rb
141
- - example/android/android_web/android_web_gmail_login/features/support/hooks.rb
142
- - example/desktop web/desktop_web_gmail_login.zip
143
- - example/desktop web/desktop_web_gmail_login/features/gmail_login.feature
144
- - example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature
145
- - example/desktop web/desktop_web_gmail_login/features/my_first.feature
146
- - example/desktop web/desktop_web_gmail_login/features/screenshots/test.png
147
- - example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb
148
- - example/desktop web/desktop_web_gmail_login/features/support/env.rb
149
- - example/desktop web/desktop_web_gmail_login/features/support/hooks.rb
150
127
  - features-skeleton/Gemfile
151
128
  - features-skeleton/Gemfile.lock
152
129
  - features-skeleton/README.md
153
130
  - features-skeleton/cucumber.yml
154
131
  - features-skeleton/my_first.feature
155
132
  - features-skeleton/screenshots/test.png
156
- - features-skeleton/step_definitions/custom_steps.rb
133
+ - features-skeleton/step_definitions/assertion_steps.rb
134
+ - features-skeleton/step_definitions/click_elements_steps.rb
135
+ - features-skeleton/step_definitions/configuration_steps.rb
136
+ - features-skeleton/step_definitions/input_steps.rb
137
+ - features-skeleton/step_definitions/javascript_handling_steps.rb
138
+ - features-skeleton/step_definitions/my_first_steps.rb
139
+ - features-skeleton/step_definitions/navigation_steps.rb
140
+ - features-skeleton/step_definitions/progress_steps.rb
157
141
  - features-skeleton/step_definitions/repositories/project_object.yml
158
142
  - features-skeleton/support/env.rb
159
143
  - features-skeleton/support/hooks.rb
@@ -190,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
190
174
  requirements:
191
175
  - - ">="
192
176
  - !ruby/object:Gem::Version
193
- version: 1.9.3
177
+ version: 2.0.0
194
178
  required_rubygems_version: !ruby/object:Gem::Requirement
195
179
  requirements:
196
180
  - - ">="