itms_automation 2.2 → 2.5.7
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 +106 -0
- data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +38 -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/step_definitions/repositories/project_object.yml +1 -0
- data/features-skeleton/support/env.rb +106 -0
- data/features-skeleton/support/hooks.rb +38 -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 +333 -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 +93 -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 +63 -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 +78 -94
- 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 -699
- data/lib/itms_automation/database_steps_helper.rb +0 -125
- data/lib/itms_automation/web_steps_helper.rb +0 -838
- data/project/Gemfile +0 -3
- 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 -4
- data/project/features/step_definitions/lib_steps/steps_definition.rb +0 -3
- data/project/features/step_definitions/repositories/project_object.yml +0 -2
- data/project/features/support/env.rb +0 -10
- data/project/features/support/hooks.rb +0 -128
data/project/Gemfile
DELETED
data/project/README.md
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
###itms_automation gem
|
2
|
-
itms_automation is an open-source tool for automating GUI, RESTful, SOAP, Database and eMail.
|
3
|
-
Importantly, itms_automation is cross-platform, it allows you to write tests against multiple platforms (Linux, Windows, MacOS) on multiple browsers (chrome, firefox ...) using the same API.
|
4
|
-
|
5
|
-
###Getting Started
|
6
|
-
These instructions will get you a copy of the project up and running on your local machine for testing purposes. See deployment for notes on how to install itms_automation gem
|
7
|
-
###Prerequisites
|
8
|
-
- Ruby: 2.3+
|
9
|
-
###Installing
|
10
|
-
`$ gem install itms_automation`
|
11
|
-
System automatically fetch all relate automation libraries after install itms_automation gem
|
12
|
-
###Setup
|
13
|
-
`$ itms_automation gen`
|
14
|
-
This command help to create a set folder structure which followed the format of BDD Cucumber and itms_automation.
|
15
|
-
###Structure folder format
|
16
|
-
- Screenshot folder
|
17
|
-
Once your scenario failed, the screen will be captured and saved to this folder
|
18
|
-
|
19
|
-
- TestSuite folder
|
20
|
-
Place to store user's feature files.
|
21
|
-
|
22
|
-
- Step_definitions folder
|
23
|
-
- lib_steps
|
24
|
-
- actionword.rb
|
25
|
-
- steps.rb
|
26
|
-
two file help to create user custom steps
|
27
|
-
- repositories
|
28
|
-
- project_object.yml (all web objects will store in this file)
|
29
|
-
- support
|
30
|
-
- env.rb
|
31
|
-
- hook.rb
|
32
|
-
|
33
|
-
- config folder
|
34
|
-
All browser capabilities configuration
|
data/project/Rakefile
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'cucumber'
|
5
|
-
require 'cucumber/rake/task'
|
6
|
-
testsuite_name = ENV['TESTSUITE']
|
7
|
-
testcase_report_name = ENV['TESTCASE_REPORT_NAME']
|
8
|
-
report_path = "Reports/#{testsuite_name}"
|
9
|
-
debug_opts = [ "--format usage", "--out"]
|
10
|
-
report_opts = ["REPORT=true","--color", "--format junit", "--out #{report_path}", "--format json --out #{report_path}/#{testcase_report_name}.json"]
|
11
|
-
namespace :execute do
|
12
|
-
Cucumber::Rake::Task.new(:report, "Execute automation test with report output.") do |t|
|
13
|
-
t.cucumber_opts = [*report_opts, "--format progress"]
|
14
|
-
end
|
15
|
-
Cucumber::Rake::Task.new(:debug, "Debug automation test without report output.") do |t|
|
16
|
-
t.cucumber_opts = [*debug_opts]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
rescue LoadError
|
20
|
-
desc 'Cucumber rake task not available'
|
21
|
-
task :features do
|
22
|
-
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
23
|
-
end
|
24
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
args: ["--headless","--disable-gpu",--no-sandbox]
|
@@ -1 +0,0 @@
|
|
1
|
-
browser.download.downloadDir: '/home/seluser'
|
@@ -1 +0,0 @@
|
|
1
|
-
browser.download.downloadDir: '/home/seluser'
|
@@ -1 +0,0 @@
|
|
1
|
-
mobileEmulation: {deviceName: "iPhone X"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
args: ["--start-maximized","--disable-infobars","--incognito", "--user-agent='Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile /9A334 Safari/7534.48.3'"]
|
2
|
-
prefs: {
|
3
|
-
password_manager_enabled: false,
|
4
|
-
default_content_settings: {popups: 0},
|
5
|
-
content_settings: {pattern_pairs: {'*': {'multiple-automatic-downloads': 1}}}
|
6
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
mobileEmulation: {deviceName: "iPhone X"}
|
data/project/cucumber.yml
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
Before do |scenario|
|
2
|
-
$driver = getDriver
|
3
|
-
$wait_time = ENV["WAIT_TIME"] || 30
|
4
|
-
$print_log = ENV["PRINT_LOG"] || false
|
5
|
-
$browser_data = page.driver.browser.capabilities
|
6
|
-
end
|
7
|
-
|
8
|
-
AfterConfiguration do
|
9
|
-
$OBJECT = loadYAMLfile("features/step_definitions/repositories/project_object.yml")
|
10
|
-
validate_params_exist
|
11
|
-
if ENV['DELETE_COOKIE']
|
12
|
-
browser = Capybara.current_session.driver.browser
|
13
|
-
browser.manage.delete_all_cookies
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def validate_params_exist
|
18
|
-
raise "❌ ERROR: Missing param SERVER_URL." if ENV['SERVER_URL'].nil?
|
19
|
-
raise "❌ ERROR: Missing param BROWSER." if ENV['BROWSER'].nil?
|
20
|
-
if ENV['REPORT']
|
21
|
-
raise "❌ ERROR: Missing param TESTSUITE." if ENV['TESTSUITE'].nil?
|
22
|
-
raise "❌ ERROR: Missing param TESTCASE_REPORT_NAME." if ENV['TESTCASE_REPORT_NAME'].nil?
|
23
|
-
$report_path = "Reports/#{ENV['TESTSUITE']}"
|
24
|
-
$testcase_report_name = ENV['TESTCASE_REPORT_NAME']
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def getDriver
|
29
|
-
case ENV['BROWSER']
|
30
|
-
when "chrome"
|
31
|
-
@chrome_options = loadYAMLfile('config/chrome_options.yaml')
|
32
|
-
Capybara.register_driver :selenium do |app|
|
33
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'],:desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: @chrome_options))
|
34
|
-
end
|
35
|
-
Capybara.current_driver = :selenium
|
36
|
-
when "firefox"
|
37
|
-
@firefox_options = loadYAMLfile('config/firefox_options.yaml')
|
38
|
-
Capybara.register_driver :selenium do |app|
|
39
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'], :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.firefox(firefoxOptions: @firefox_options))
|
40
|
-
end
|
41
|
-
Capybara.current_driver = :selenium
|
42
|
-
when "safari"
|
43
|
-
@safari_options = loadYAMLfile('config/safari_options.yaml')
|
44
|
-
Capybara.register_driver :selenium do |app|
|
45
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'], :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.safari(safariOptions: @safari_options))
|
46
|
-
end
|
47
|
-
Capybara.current_driver = :selenium
|
48
|
-
when "ie"
|
49
|
-
@ie_options = loadYAMLfile('config/ie_options.yaml')
|
50
|
-
Capybara.register_driver :selenium do |app|
|
51
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'], :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.internet_explorer(ieOptions: @ie_options))
|
52
|
-
end
|
53
|
-
Capybara.current_driver = :selenium
|
54
|
-
when "chrome_headless"
|
55
|
-
@chrome_headless_options = loadYAMLfile('config/chrome_headless_options.yaml')
|
56
|
-
Capybara.register_driver :selenium do |app|
|
57
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'], :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.chrome(chromeOptions: @chrome_headless_options))
|
58
|
-
end
|
59
|
-
Capybara.current_driver = :selenium
|
60
|
-
when "remote"
|
61
|
-
@capabilities = loadYAMLfile('config/remote_options.yaml')
|
62
|
-
Capybara.register_driver :selenium do |app|
|
63
|
-
Capybara::Selenium::Driver.new(app, :url => ENV['SERVER_URL'], :desired_capabilities => @capabilities)
|
64
|
-
end
|
65
|
-
Capybara.current_driver = :selenium
|
66
|
-
else
|
67
|
-
raise "❌ ERROR: Unsupported browser: #{ENV['BROWSER']}. Available: chrome || chrome headless || firefox || safari || ie || remote"
|
68
|
-
end
|
69
|
-
unless ENV["SCREEN_RESOLUTION"].nil?
|
70
|
-
screen_resolution = ENV["SCREEN_RESOLUTION"].split("x")
|
71
|
-
Capybara.page.current_window.resize_to(screen_resolution[0], screen_resolution[1])
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def loadYAMLfile(filename)
|
76
|
-
begin
|
77
|
-
return YAML.load_file(filename)
|
78
|
-
rescue Psych::SyntaxError => ex
|
79
|
-
raise "❌ SyntaxError when reading file: #{ex}"
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
After do |scenario|
|
84
|
-
# save_screenshot = ENV['SCREENSHOT'] || false
|
85
|
-
# if save_screenshot == true
|
86
|
-
# file_name = 'failed_%s.png' % rand(1000).to_s
|
87
|
-
# page.save_screenshot($screenshot+file_name) if scenario.failed?
|
88
|
-
# begin
|
89
|
-
# Capybara.page.driver.quit
|
90
|
-
# Capybara.send(:session_pool).delete_if { |key, value| key =~ /selenium/i }
|
91
|
-
# rescue StandardError => myStandardError
|
92
|
-
# puts "❌ Error: #{myStandardError}"
|
93
|
-
# exit(1)
|
94
|
-
# end
|
95
|
-
# end
|
96
|
-
# $browser_data = page.driver.browser.capabilities
|
97
|
-
# p "$browser_data:#{$browser_data.inspect}"
|
98
|
-
FileUtils.rm_rf(Dir.glob('downloads/*'))
|
99
|
-
end
|
100
|
-
|
101
|
-
at_exit do
|
102
|
-
if ENV['REPORT']
|
103
|
-
begin
|
104
|
-
# validateReport
|
105
|
-
time = Time.now.getutc
|
106
|
-
if $browser_data
|
107
|
-
browser_name = $browser_data[:browser_name]
|
108
|
-
browser_version = $browser_data[:browser_version]
|
109
|
-
platform = $browser_data[:platform_name]
|
110
|
-
end
|
111
|
-
ReportBuilder.configure do |config|
|
112
|
-
config.report_path = "#{$report_path}/#{$testcase_report_name}"
|
113
|
-
config.input_path = "#{$report_path}/#{$testcase_report_name}.json"
|
114
|
-
config.report_types = [:json, :html]
|
115
|
-
config.color = 'blue'
|
116
|
-
config.additional_info = {
|
117
|
-
'Browser' => browser_name || nil,
|
118
|
-
'Platform' => platform || nil,
|
119
|
-
'Browser Version' => browser_version || nil,
|
120
|
-
'Report Generated' => time
|
121
|
-
}
|
122
|
-
end
|
123
|
-
options = { report_title: "iTMS - Test Management System" }
|
124
|
-
ReportBuilder.build_report options
|
125
|
-
rescue NoMethodError
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|