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.
- checksums.yaml +4 -4
- data/doc/installation.md +1 -1
- data/features-skeleton/README.md +128 -66
- data/features-skeleton/my_first.feature +19 -10
- data/features-skeleton/step_definitions/assertion_steps.rb +69 -0
- data/features-skeleton/step_definitions/click_elements_steps.rb +25 -0
- data/features-skeleton/step_definitions/configuration_steps.rb +8 -0
- data/features-skeleton/step_definitions/input_steps.rb +60 -0
- data/features-skeleton/step_definitions/javascript_handling_steps.rb +11 -0
- data/features-skeleton/step_definitions/my_first_steps.rb +14 -0
- data/features-skeleton/step_definitions/navigation_steps.rb +80 -0
- data/features-skeleton/step_definitions/progress_steps.rb +18 -0
- data/features-skeleton/step_definitions/repositories/project_object.yml +1 -1
- data/features-skeleton/support/env.rb +29 -96
- data/lib/itms_automation/input_steps.rb +1 -1
- data/lib/itms_automation/methods/assertion_methods.rb +2 -2
- data/lib/itms_automation/methods/misc_methods.rb +2 -1
- data/lib/itms_automation/methods/navigate_methods.rb +2 -4
- data/lib/itms_automation/version.rb +1 -1
- metadata +28 -44
- 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 +0 -36
- data/example/android/android_app/android_app_calculator/features/my_first.feature +0 -13
- 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 +0 -5
- data/example/android/android_app/android_app_calculator/features/support/env.rb +0 -52
- data/example/android/android_app/android_app_calculator/features/support/hooks.rb +0 -26
- 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 +0 -12
- data/example/android/android_web/android_web_gmail_login/features/my_first.feature +0 -1
- 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 +0 -5
- data/example/android/android_web/android_web_gmail_login/features/support/env.rb +0 -51
- data/example/android/android_web/android_web_gmail_login/features/support/hooks.rb +0 -27
- data/example/desktop web/desktop_web_gmail_login.zip +0 -0
- data/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +0 -9
- data/example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature +0 -21
- data/example/desktop web/desktop_web_gmail_login/features/my_first.feature +0 -1
- 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 +0 -5
- data/example/desktop web/desktop_web_gmail_login/features/support/env.rb +0 -106
- data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +0 -38
- data/features-skeleton/step_definitions/custom_steps.rb +0 -5
Binary file
|
Binary file
|
@@ -1,36 +0,0 @@
|
|
1
|
-
Feature: Verify Calculator functionalities
|
2
|
-
|
3
|
-
Scenario: Click on OK button
|
4
|
-
Then I click on element having id "com.android2.calculator3:id/cling_dismiss"
|
5
|
-
|
6
|
-
Scenario: Addirion
|
7
|
-
Then I click on element having id "com.android2.calculator3:id/digit5"
|
8
|
-
Then I click on element having id "com.android2.calculator3:id/plus"
|
9
|
-
Then I click on element having id "com.android2.calculator3:id/digit9"
|
10
|
-
When I click on element having id "com.android2.calculator3:id/equal"
|
11
|
-
Then element having xpath "//android.widget.EditText[@index=0]" should have text as "14"
|
12
|
-
|
13
|
-
|
14
|
-
Scenario: Substraction
|
15
|
-
Then I click on element having id "com.android2.calculator3:id/digit9"
|
16
|
-
Then I click on element having id "com.android2.calculator3:id/minus"
|
17
|
-
Then I click on element having id "com.android2.calculator3:id/digit5"
|
18
|
-
When I click on element having id "com.android2.calculator3:id/equal"
|
19
|
-
Then element having xpath "//android.widget.EditText[@index=0]" should have text as "4"
|
20
|
-
|
21
|
-
Scenario: Multiplication
|
22
|
-
Then I click on element having id "com.android2.calculator3:id/digit9"
|
23
|
-
Then I click on element having id "com.android2.calculator3:id/mul"
|
24
|
-
Then I click on element having id "com.android2.calculator3:id/digit5"
|
25
|
-
When I click on element having id "com.android2.calculator3:id/equal"
|
26
|
-
Then element having xpath "//android.widget.EditText[@index=0]" should have text as "45"
|
27
|
-
|
28
|
-
Scenario: Division
|
29
|
-
Then I click on element having id "com.android2.calculator3:id/digit8"
|
30
|
-
Then I click on element having id "com.android2.calculator3:id/div"
|
31
|
-
Then I click on element having id "com.android2.calculator3:id/digit2"
|
32
|
-
When I click on element having id "com.android2.calculator3:id/equal"
|
33
|
-
Then element having xpath "//android.widget.EditText[@index=0]" should have text as "4"
|
34
|
-
|
35
|
-
Scenario: Clear output
|
36
|
-
Then I click on element having id "com.android2.calculator3:id/clear"
|
@@ -1,13 +0,0 @@
|
|
1
|
-
#Scenario: Division
|
2
|
-
# Then I click on element having id "com.android2.calculator3:id/digit8"
|
3
|
-
# Then I click on element having id "com.android2.calculator3:id/div"
|
4
|
-
# Then I click on element having id "com.android2.calculator3:id/digit4"
|
5
|
-
# When I click on element having id "com.android2.calculator3:id/equal"
|
6
|
-
# Then element having xpath "//android.widget.EditText[@index=0]" should have text as "2"
|
7
|
-
|
8
|
-
# Scenario: Multiplication
|
9
|
-
# Then I click on element having id "com.android2.calculator3:id/digit6"
|
10
|
-
# Then I click on element having id "com.android2.calculator3:id/mul"
|
11
|
-
# Then I click on element having id "com.android2.calculator3:id/digit5"
|
12
|
-
# When I click on element having id "com.android2.calculator3:id/equal"
|
13
|
-
# Then element having xpath "//android.widget.EditText[@index=0]" should have text as "30"
|
Binary file
|
@@ -1,52 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'itms_automation'
|
3
|
-
|
4
|
-
# Store command line arguments
|
5
|
-
$browser_type = ENV['BROWSER'] || 'ff'
|
6
|
-
$platform = ENV['PLATFORM'] || 'desktop'
|
7
|
-
$os_version = ENV['OS_VERSION']
|
8
|
-
$device_name = ENV['DEVICE_NAME']
|
9
|
-
$udid = ENV['UDID']
|
10
|
-
$app_path = ENV['APP_PATH']
|
11
|
-
|
12
|
-
# check for valid parameters
|
13
|
-
validate_parameters $platform, $browser_type, $app_path
|
14
|
-
|
15
|
-
# If platform is android or ios create driver instance for mobile browser
|
16
|
-
if $platform == 'android' or $platform == 'iOS'
|
17
|
-
|
18
|
-
if $browser_type == 'native'
|
19
|
-
$browser_type = "Browser"
|
20
|
-
end
|
21
|
-
|
22
|
-
if $platform == 'android'
|
23
|
-
$device_name, $os_version = get_device_info
|
24
|
-
end
|
25
|
-
|
26
|
-
desired_caps = {
|
27
|
-
caps: {
|
28
|
-
platformName: $platform,
|
29
|
-
browserName: $browser_type,
|
30
|
-
versionNumber: $os_version,
|
31
|
-
deviceName: $device_name,
|
32
|
-
udid: $udid,
|
33
|
-
app: ".//#{$app_path}"
|
34
|
-
},
|
35
|
-
appium_lib: { server_url: 'http://localhost:4723/wd/hub' }
|
36
|
-
}
|
37
|
-
|
38
|
-
begin
|
39
|
-
$driver = Appium::Driver.new(desired_caps).start_driver
|
40
|
-
rescue Exception => e
|
41
|
-
puts e.message
|
42
|
-
Process.exit(0)
|
43
|
-
end
|
44
|
-
else # else create driver instance for desktop browser
|
45
|
-
begin
|
46
|
-
$driver = Selenium::WebDriver.for(:"#{$browser_type}")
|
47
|
-
$driver.manage().window().maximize()
|
48
|
-
rescue Exception => e
|
49
|
-
puts e.message
|
50
|
-
Process.exit(0)
|
51
|
-
end
|
52
|
-
end
|
@@ -1,26 +0,0 @@
|
|
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
|
14
|
-
# Do something after each scenario.
|
15
|
-
end
|
16
|
-
|
17
|
-
After do |scenario|
|
18
|
-
# Do something after each scenario.
|
19
|
-
# The +scenario+ argument is optional, but
|
20
|
-
# if you use it, you can inspect status with
|
21
|
-
# the #failed?, #passed? and #exception methods.
|
22
|
-
|
23
|
-
if(scenario.failed?)
|
24
|
-
#Do something if scenario fails.
|
25
|
-
end
|
26
|
-
end
|
Binary file
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Feature: Gmail Login mobile web
|
2
|
-
|
3
|
-
Scenario: valid credentials login
|
4
|
-
Given I navigate to "http://www.gmail.com"
|
5
|
-
Then I wait for 5 sec
|
6
|
-
Then I enter "your_email" into input field having id "Email"
|
7
|
-
Then I enter "your_password" into input field having id "Passwd"
|
8
|
-
When I click on element having id "signIn"
|
9
|
-
And I wait for 10 sec
|
10
|
-
Then element having xpath "//*[@id='tltbt']/div[3]/div/div" should be present
|
11
|
-
And I wait for 5 sec
|
12
|
-
Then I close browser
|
@@ -1 +0,0 @@
|
|
1
|
-
|
Binary file
|
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'itms_automation'
|
3
|
-
|
4
|
-
# Store command line arguments
|
5
|
-
$browser_type = ENV['BROWSER'] || 'ff'
|
6
|
-
$platform = ENV['PLATFORM'] || 'desktop'
|
7
|
-
$os_version = ENV['OS_VERSION']
|
8
|
-
$device_name = ENV['DEVICE_NAME']
|
9
|
-
$udid = ENV['UDID']
|
10
|
-
$app_path = ENV['APP_PATH']
|
11
|
-
|
12
|
-
# check for valid parameters
|
13
|
-
validate_parameters $platform, $browser_type, $app_path
|
14
|
-
|
15
|
-
# If platform is android or ios create driver instance for mobile browser
|
16
|
-
if $platform == 'android' or $platform == 'iOS'
|
17
|
-
|
18
|
-
if $browser_type == 'native'
|
19
|
-
$browser_type = "Browser"
|
20
|
-
end
|
21
|
-
|
22
|
-
if $platform == 'android'
|
23
|
-
$device_name, $os_version = get_device_info
|
24
|
-
end
|
25
|
-
|
26
|
-
desired_caps = {
|
27
|
-
caps: {
|
28
|
-
platformName: $platform,
|
29
|
-
browserName: $browser_type,
|
30
|
-
versionNumber: $os_version,
|
31
|
-
deviceName: $device_name,
|
32
|
-
udid: $udid,
|
33
|
-
app: ".//#{$app_path}"
|
34
|
-
},
|
35
|
-
}
|
36
|
-
|
37
|
-
begin
|
38
|
-
$driver = Appium::Driver.new(desired_caps).start_driver
|
39
|
-
rescue Exception => e
|
40
|
-
puts e.message
|
41
|
-
Process.exit(0)
|
42
|
-
end
|
43
|
-
else # else create driver instance for desktop browser
|
44
|
-
begin
|
45
|
-
$driver = Selenium::WebDriver.for(:"#{$browser_type}")
|
46
|
-
$driver.manage().window().maximize()
|
47
|
-
rescue Exception => e
|
48
|
-
puts e.message
|
49
|
-
Process.exit(0)
|
50
|
-
end
|
51
|
-
end
|
@@ -1,27 +0,0 @@
|
|
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
|
14
|
-
# Do something after each scenario.
|
15
|
-
end
|
16
|
-
|
17
|
-
After do |scenario|
|
18
|
-
# Do something after each scenario.
|
19
|
-
# The +scenario+ argument is optional, but
|
20
|
-
# if you use it, you can inspect status with
|
21
|
-
# the #failed?, #passed? and #exception methods.
|
22
|
-
|
23
|
-
if(scenario.failed?)
|
24
|
-
#Do something if scenario fails.
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
Binary file
|
@@ -1,9 +0,0 @@
|
|
1
|
-
Feature: Gmail_login
|
2
|
-
|
3
|
-
Scenario: Valid_gmail_login
|
4
|
-
Given I navigate to "http://www.gmail.com"
|
5
|
-
And I enter "abc@gmail.com" into input field having id "Email"
|
6
|
-
And I enter "!password*" into input field having id "Passwd"
|
7
|
-
When I click on element having id "signIn"
|
8
|
-
And I wait for 10 sec
|
9
|
-
Then I close browser
|
@@ -1,21 +0,0 @@
|
|
1
|
-
Feature: Gmail_login
|
2
|
-
|
3
|
-
Scenario: Open gmail
|
4
|
-
Given I navigate to "http://www.gmail.com"
|
5
|
-
|
6
|
-
Scenario Outline: In-valid Login
|
7
|
-
Then I clear input field having id "Email"
|
8
|
-
And I enter <username> into input field having id "Email"
|
9
|
-
Then I clear input field having id "Passwd"
|
10
|
-
And I enter <password> into input field having id "Passwd"
|
11
|
-
When I click on element having id "signIn"
|
12
|
-
Then element having id "errormsg_0_Passwd" should be present
|
13
|
-
|
14
|
-
Examples:
|
15
|
-
| username | password |
|
16
|
-
|"test1" |"password1" |
|
17
|
-
|"test2" |"password2" |
|
18
|
-
|"test3" |"password3" |
|
19
|
-
|
20
|
-
Scenario: close gmail
|
21
|
-
Then I close browser
|
@@ -1 +0,0 @@
|
|
1
|
-
|
Binary file
|
@@ -1,106 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
# require 'itms_automation'
|
3
|
-
require_relative '../../../lib/itms_automation.rb'
|
4
|
-
# require 'appium_lib'
|
5
|
-
require 'appium_lib_core'
|
6
|
-
# Store command line arguments
|
7
|
-
$browser_type = ENV['BROWSER'] || 'firefox'
|
8
|
-
$platform = ENV['PLATFORM'] || 'desktop'
|
9
|
-
$os_version = ENV['OS_VERSION']
|
10
|
-
$device_name = ENV['DEVICE_NAME']
|
11
|
-
$udid = ENV['UDID']
|
12
|
-
$app_path = ENV['APP_PATH']
|
13
|
-
|
14
|
-
# check for valid parameters
|
15
|
-
validate_parameters $platform, $browser_type, $app_path
|
16
|
-
|
17
|
-
# If platform is android or ios create driver instance for mobile browser
|
18
|
-
if $platform == 'android' or $platform == 'iOS'
|
19
|
-
|
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
|
-
|
70
|
-
rescue Exception => e
|
71
|
-
puts e.message
|
72
|
-
Process.exit(0)
|
73
|
-
end
|
74
|
-
else # else create driver instance for desktop browser
|
75
|
-
begin
|
76
|
-
$driver = case $browser_type
|
77
|
-
when "chrome"
|
78
|
-
Selenium::WebDriver.for(:chrome)
|
79
|
-
when "safari"
|
80
|
-
Selenium::WebDriver.for(:safari)
|
81
|
-
when "internet_explorer"
|
82
|
-
Selenium::WebDriver.for(:internet_explorer)
|
83
|
-
when "chrome_headless"
|
84
|
-
Selenium::WebDriver.for(:chrome, :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: { args: %w(headless) }))
|
85
|
-
when "remote"
|
86
|
-
if ENV['SERVER_URL'].nil? || ENV['REMOTE_BROWSER'].nil?
|
87
|
-
puts "\nMissing SERVER_URL : SERVER_URL=http//SERVER_URL:4444/wd/hub"
|
88
|
-
puts "\nMissing REMOTE_BROWSER: REMOTE_BROWSER=browser_name"
|
89
|
-
Process.exit(0)
|
90
|
-
else
|
91
|
-
caps = Selenium::WebDriver::Remote::Capabilities.new
|
92
|
-
caps["browserName"] = ENV['REMOTE_BROWSER']
|
93
|
-
Selenium::WebDriver.for(:remote, :url => ENV['SERVER_URL'], :desired_capabilities => caps)
|
94
|
-
end
|
95
|
-
|
96
|
-
else
|
97
|
-
Selenium::WebDriver.for(:firefox)
|
98
|
-
end
|
99
|
-
$driver.manage().window().maximize()
|
100
|
-
p "session_id: #{$driver.session_id}"
|
101
|
-
rescue Exception => e
|
102
|
-
puts e.message
|
103
|
-
Process.exit(0)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
def validate_params_exist
|
2
|
-
raise "❌ ERROR: Missing param SERVER_URL." if ENV['SERVER_URL'].nil?
|
3
|
-
raise "❌ ERROR: Missing param BROWSER." if ENV['BROWSER'].nil?
|
4
|
-
if ENV['REPORT']
|
5
|
-
raise "❌ ERROR: Missing param TESTSUITE." if ENV['TESTSUITE'].nil?
|
6
|
-
raise "❌ ERROR: Missing param TESTCASE_REPORT_NAME." if ENV['TESTCASE_REPORT_NAME'].nil?
|
7
|
-
$report_path = "Reports/#{ENV['TESTSUITE']}"
|
8
|
-
$testcase_report_name = ENV['TESTCASE_REPORT_NAME']
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
at_exit do
|
13
|
-
# quite driver
|
14
|
-
$driver.close()
|
15
|
-
if ENV['REPORT']
|
16
|
-
begin
|
17
|
-
# validateReport
|
18
|
-
time = Time.now.getutc
|
19
|
-
ReportBuilder.configure do |config|
|
20
|
-
config.report_path = "#{$report_path}/#{$testcase_report_name}"
|
21
|
-
config.input_path = "#{$report_path}/#{$testcase_report_name}.json"
|
22
|
-
config.report_types = [:json, :html]
|
23
|
-
config.color = 'blue'
|
24
|
-
config.additional_info = {
|
25
|
-
'Browser' => $browser_type,
|
26
|
-
'Platform' => $platform ,
|
27
|
-
'OS Version' => $os_version,
|
28
|
-
'Report Generated' => time
|
29
|
-
}
|
30
|
-
end
|
31
|
-
options = { report_title: "INFODation - Test Management System" }
|
32
|
-
ReportBuilder.build_report options
|
33
|
-
rescue Exception => e
|
34
|
-
puts e.message
|
35
|
-
Process.exit( 0 )
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|