itms_automation 2.6.7 → 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/my_first.feature +19 -10
- data/features-skeleton/step_definitions/input_steps.rb +3 -3
- data/features-skeleton/step_definitions/my_first_steps.rb +14 -0
- data/features-skeleton/step_definitions/repositories/project_object.yml +1 -1
- data/features-skeleton/support/env.rb +29 -101
- data/lib/itms_automation/input_steps.rb +1 -1
- data/lib/itms_automation/methods/misc_methods.rb +0 -1
- data/lib/itms_automation/version.rb +1 -1
- metadata +17 -39
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 152915e55093128d7fc658318c8b62d5125cd56933a7a99153aa1db6417212cc
|
4
|
+
data.tar.gz: dc2329818b77297eb021962d60e03b14134375d46b281cf2c153b5003c0e52df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95685084ff2886f18defefdadb15212eca6a1ac1679982f122d706f0ead93a581838046dd70935c616e5fe52082d80b2af41f8d1bccb1b7ef44eac297f1077ed
|
7
|
+
data.tar.gz: 5e0d573679aafffa4a59e3a30821dc5915c90ef965cff47e1c756b287ca5ff664cefb9ba3cc8d12253ccb3359ee37ab263403936938157125094d6d7a40794d3
|
data/doc/installation.md
CHANGED
@@ -2,7 +2,7 @@ Installation
|
|
2
2
|
============
|
3
3
|
### Prerequisites
|
4
4
|
You need to have Ruby installed.
|
5
|
-
Verify your installation by running ruby -v in a terminal - it should print "ruby
|
5
|
+
Verify your installation by running ruby -v in a terminal - it should print "ruby 2.0.0" (or higher).
|
6
6
|
|
7
7
|
You need to have DevKit installed.
|
8
8
|
|
@@ -1,10 +1,19 @@
|
|
1
|
-
# Feature:
|
2
|
-
#
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
#
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
1
|
+
# Feature: Login Functionality
|
2
|
+
# In order to ensure login functionality works,
|
3
|
+
# I want to run the cucumber test to verify it is working
|
4
|
+
|
5
|
+
# Background:
|
6
|
+
# Given the login page is opened successfully
|
7
|
+
|
8
|
+
# Scenario: Login Valid
|
9
|
+
# When user input username "tomsmith" and password "SuperSecretPassword!"
|
10
|
+
# Then the message "You logged into a secure area!×" should be displayed
|
11
|
+
|
12
|
+
# Scenario Outline: Login Invalid
|
13
|
+
# When user input username "<username>" and password "<password>"
|
14
|
+
# Then the message "<messsage>" should be displayed
|
15
|
+
|
16
|
+
# Examples:
|
17
|
+
# | username | password | messsage |
|
18
|
+
# | anhpham | SuperSecretPassword! | Your username is invalid!× |
|
19
|
+
# | tomsmith | wrong_password | Your password is invalid!× |
|
@@ -4,12 +4,12 @@
|
|
4
4
|
|
5
5
|
# # enter text into input field steps
|
6
6
|
# Then(/^I enter "([^\"]*)" into element "(.*?)"$/) do |text, element|
|
7
|
-
# enter_text(
|
7
|
+
# enter_text(element, text)
|
8
8
|
# end
|
9
9
|
|
10
10
|
# # clear input field steps
|
11
|
-
# Then(/^I clear input element "(.*?)"$/) do |
|
12
|
-
# clear_text(
|
11
|
+
# Then(/^I clear input element "(.*?)"$/) do |element|
|
12
|
+
# clear_text(element)
|
13
13
|
# end
|
14
14
|
|
15
15
|
# # select option by text/value from dropdown/multiselect
|
@@ -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
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
test_object: {id: 'username'}
|
@@ -1,110 +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 "
|
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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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)
|
72
|
-
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
|
-
if ENV['SERVER_URL'].nil? || ENV['REMOTE_BROWSER'].nil?
|
91
|
-
puts "\nMissing SERVER_URL : SERVER_URL=http//SERVER_URL:4444/wd/hub"
|
92
|
-
puts "\nMissing REMOTE_BROWSER: REMOTE_BROWSER=browser_name"
|
93
|
-
Process.exit(0)
|
94
|
-
else
|
95
|
-
caps = Selenium::WebDriver::Remote::Capabilities.new
|
96
|
-
caps["browserName"] = ENV["REMOTE_BROWSER"]
|
97
|
-
caps["enableVNC"] = true
|
98
|
-
caps["enableVideo"] = true
|
99
|
-
caps["resolution"] = ENV["resolution"] unless ENV["resolution"]
|
100
|
-
Selenium::WebDriver.for(:remote, :url => ENV["SERVER_URL"], :desired_capabilities => caps)
|
101
|
-
end
|
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)
|
102
24
|
else
|
103
|
-
Selenium::WebDriver.
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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)
|
31
|
+
end
|
32
|
+
else
|
33
|
+
Selenium::WebDriver.for(:firefox)
|
109
34
|
end
|
110
|
-
|
35
|
+
rescue Exception => e
|
36
|
+
puts e.message
|
37
|
+
Process.exit(0)
|
38
|
+
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.
|
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:
|
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:
|
19
|
+
version: 5.2.0
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
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:
|
29
|
+
version: 5.2.0
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 5.2.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
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:
|
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:
|
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
|
@@ -124,29 +124,6 @@ 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
|
@@ -158,6 +135,7 @@ files:
|
|
158
135
|
- features-skeleton/step_definitions/configuration_steps.rb
|
159
136
|
- features-skeleton/step_definitions/input_steps.rb
|
160
137
|
- features-skeleton/step_definitions/javascript_handling_steps.rb
|
138
|
+
- features-skeleton/step_definitions/my_first_steps.rb
|
161
139
|
- features-skeleton/step_definitions/navigation_steps.rb
|
162
140
|
- features-skeleton/step_definitions/progress_steps.rb
|
163
141
|
- features-skeleton/step_definitions/repositories/project_object.yml
|
@@ -196,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
174
|
requirements:
|
197
175
|
- - ">="
|
198
176
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
177
|
+
version: 2.0.0
|
200
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
179
|
requirements:
|
202
180
|
- - ">="
|
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
|