itms_automation 2.2 → 2.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/bin/generate.rb +3 -37
  3. data/bin/helper.rb +23 -10
  4. data/bin/itms_automation +18 -23
  5. data/doc/installation.md +16 -0
  6. data/doc/itms-automation-API.md +103 -0
  7. data/doc/itms-automation-help.md +18 -0
  8. data/example/android/android_app/android_app_calculator.zip +0 -0
  9. data/example/android/android_app/android_app_calculator/AndroidCalculator.apk +0 -0
  10. data/example/android/android_app/android_app_calculator/features/calculator.feature +36 -0
  11. data/example/android/android_app/android_app_calculator/features/my_first.feature +13 -0
  12. data/example/android/android_app/android_app_calculator/features/screenshots/test.png +0 -0
  13. data/example/android/android_app/android_app_calculator/features/step_definitions/custom_steps.rb +5 -0
  14. data/example/android/android_app/android_app_calculator/features/support/env.rb +52 -0
  15. data/example/android/android_app/android_app_calculator/features/support/hooks.rb +26 -0
  16. data/example/android/android_web/android_web_gmail_login.zip +0 -0
  17. data/example/android/android_web/android_web_gmail_login/features/gmail_login.feature +12 -0
  18. data/example/android/android_web/android_web_gmail_login/features/my_first.feature +1 -0
  19. data/example/android/android_web/android_web_gmail_login/features/screenshots/test.png +0 -0
  20. data/example/android/android_web/android_web_gmail_login/features/step_definitions/custom_steps.rb +5 -0
  21. data/example/android/android_web/android_web_gmail_login/features/support/env.rb +51 -0
  22. data/example/android/android_web/android_web_gmail_login/features/support/hooks.rb +27 -0
  23. data/example/desktop web/desktop_web_gmail_login.zip +0 -0
  24. data/example/desktop web/desktop_web_gmail_login/features/gmail_login.feature +9 -0
  25. data/example/desktop web/desktop_web_gmail_login/features/gmail_multi_login.feature +21 -0
  26. data/example/desktop web/desktop_web_gmail_login/features/my_first.feature +1 -0
  27. data/example/desktop web/desktop_web_gmail_login/features/screenshots/test.png +0 -0
  28. data/example/desktop web/desktop_web_gmail_login/features/step_definitions/custom_steps.rb +5 -0
  29. data/example/desktop web/desktop_web_gmail_login/features/support/env.rb +106 -0
  30. data/example/desktop web/desktop_web_gmail_login/features/support/hooks.rb +38 -0
  31. data/features-skeleton/my_first.feature +5 -0
  32. data/features-skeleton/screenshots/test.png +0 -0
  33. data/features-skeleton/step_definitions/custom_steps.rb +5 -0
  34. data/features-skeleton/step_definitions/repositories/project_object.yml +1 -0
  35. data/features-skeleton/support/env.rb +106 -0
  36. data/features-skeleton/support/hooks.rb +38 -0
  37. data/lib/itms_automation.rb +1 -3
  38. data/lib/itms_automation/assertion_steps.rb +68 -0
  39. data/lib/itms_automation/click_elements_steps.rb +24 -0
  40. data/lib/itms_automation/configuration_steps.rb +7 -0
  41. data/lib/itms_automation/input_steps.rb +59 -0
  42. data/lib/itms_automation/javascript_handling_steps.rb +10 -0
  43. data/lib/itms_automation/methods/assertion_methods.rb +333 -0
  44. data/lib/itms_automation/methods/click_elements_methods.rb +23 -0
  45. data/lib/itms_automation/methods/configuration_methods.rb +35 -0
  46. data/lib/itms_automation/methods/error_handling_methods.rb +93 -0
  47. data/lib/itms_automation/methods/input_methods.rb +69 -0
  48. data/lib/itms_automation/methods/javascript_handling_methods.rb +9 -0
  49. data/lib/itms_automation/methods/misc_methods.rb +63 -0
  50. data/lib/itms_automation/methods/navigate_methods.rb +123 -0
  51. data/lib/itms_automation/methods/progress_methods.rb +15 -0
  52. data/lib/itms_automation/methods/required_files.rb +9 -0
  53. data/lib/itms_automation/methods/screenshot_methods.rb +6 -0
  54. data/lib/itms_automation/navigation_steps.rb +79 -0
  55. data/lib/itms_automation/progress_steps.rb +17 -0
  56. data/lib/itms_automation/screenshot_steps.rb +6 -0
  57. data/lib/itms_automation/version.rb +5 -3
  58. metadata +78 -94
  59. data/bin/console +0 -14
  60. data/bin/documentation_generator.rb +0 -119
  61. data/bin/setup +0 -8
  62. data/lib/itms_automation/all_steps.rb +0 -8
  63. data/lib/itms_automation/assertion_helper.rb +0 -29
  64. data/lib/itms_automation/auto_util.rb +0 -699
  65. data/lib/itms_automation/database_steps_helper.rb +0 -125
  66. data/lib/itms_automation/web_steps_helper.rb +0 -838
  67. data/project/Gemfile +0 -3
  68. data/project/README.md +0 -34
  69. data/project/Rakefile +0 -24
  70. data/project/config/chrome_headless_options.yaml +0 -1
  71. data/project/config/chrome_options.yaml +0 -6
  72. data/project/config/firefox_headless_options.yaml +0 -1
  73. data/project/config/firefox_options.yaml +0 -1
  74. data/project/config/ie_options.yaml +0 -1
  75. data/project/config/remote_options.yaml +0 -6
  76. data/project/config/safari_options.yaml +0 -1
  77. data/project/cucumber.yml +0 -4
  78. data/project/features/TestSuite/WebGUI.feature +0 -4
  79. data/project/features/step_definitions/lib_steps/steps_definition.rb +0 -3
  80. data/project/features/step_definitions/repositories/project_object.yml +0 -2
  81. data/project/features/support/env.rb +0 -10
  82. data/project/features/support/hooks.rb +0 -128
@@ -1,3 +0,0 @@
1
- source 'http://rubygems.org'
2
- gem 'report_builder'
3
- gem 'itms_automation'
@@ -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
@@ -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,6 +0,0 @@
1
- args: ["--start-maximized","--disable-infobars","--incognito"]
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
- 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"}
@@ -1,4 +0,0 @@
1
- chrome: BROWSER=chrome
2
- firefox: BROWSER=firefox
3
- ie: BROWSER=internet_explorer
4
- parallel: parallel_cucumber
@@ -1,4 +0,0 @@
1
- Feature: demo
2
-
3
- Scenario: new scenario
4
- Given I open the page "http://google.com"
@@ -1,3 +0,0 @@
1
- And /I open the page "(.*)"/ do |url_site|
2
- execute_openbrowser(url_site)
3
- end
@@ -1,2 +0,0 @@
1
- signupbutton: {xpath_selector: '//li[@class="mm-listitem"]//a[@href="#"][contains(text(),"T")]'}
2
-
@@ -1,10 +0,0 @@
1
- STDOUT.sync = true
2
- require "rubygems"
3
- require "capybara"
4
- require "capybara/cucumber"
5
- require "cucumber"
6
- require "yaml"
7
- require "selenium-webdriver"
8
- require "colorize"
9
- require "itms_automation"
10
- require "report_builder"
@@ -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