howitzer 2.2.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -1
  3. data/LICENSE +1 -1
  4. data/README.md +16 -17
  5. data/generators/base_generator.rb +4 -6
  6. data/generators/config/config_generator.rb +2 -4
  7. data/generators/config/templates/boot.rb +1 -1
  8. data/generators/config/templates/capybara.rb +3 -5
  9. data/generators/config/templates/default.yml +19 -20
  10. data/generators/config/templates/drivers/browserstack.rb +31 -4
  11. data/generators/config/templates/drivers/crossbrowsertesting.rb +9 -11
  12. data/generators/config/templates/drivers/headless_chrome.rb +1 -1
  13. data/generators/config/templates/drivers/headless_firefox.rb +1 -1
  14. data/generators/config/templates/drivers/lambdatest.rb +30 -0
  15. data/generators/config/templates/drivers/sauce.rb +30 -2
  16. data/generators/config/templates/drivers/selenium.rb +1 -1
  17. data/generators/config/templates/drivers/selenium_grid.rb +3 -3
  18. data/generators/config/templates/drivers/testingbot.rb +29 -2
  19. data/generators/cucumber/templates/env.rb +1 -1
  20. data/generators/cucumber/templates/hooks.rb +9 -3
  21. data/generators/cucumber/templates/transformers.rb +1 -1
  22. data/generators/prerequisites/templates/factory_bot.rb +1 -1
  23. data/generators/root/templates/Gemfile.erb +4 -14
  24. data/generators/rspec/templates/spec_helper.rb +5 -5
  25. data/generators/turnip/templates/spec_helper.rb +5 -5
  26. data/generators/web/templates/example_page.rb +1 -1
  27. data/lib/howitzer/cache.rb +1 -1
  28. data/lib/howitzer/capybara_helpers.rb +46 -9
  29. data/lib/howitzer/email.rb +2 -2
  30. data/lib/howitzer/exceptions.rb +21 -21
  31. data/lib/howitzer/gmail_api/client.rb +13 -4
  32. data/lib/howitzer/log.rb +6 -6
  33. data/lib/howitzer/mail_adapters/mailgun.rb +1 -1
  34. data/lib/howitzer/mail_adapters/mailtrap.rb +3 -3
  35. data/lib/howitzer/mail_adapters/onesecmail.rb +80 -0
  36. data/lib/howitzer/mail_adapters/testmail.rb +102 -0
  37. data/lib/howitzer/mailgun_api/client.rb +3 -2
  38. data/lib/howitzer/mailgun_api/response.rb +1 -2
  39. data/lib/howitzer/mailtrap_api/client.rb +19 -1
  40. data/lib/howitzer/meta/actions.rb +13 -16
  41. data/lib/howitzer/meta/element.rb +12 -10
  42. data/lib/howitzer/onesecmail_api/client.rb +44 -0
  43. data/lib/howitzer/onesecmail_api.rb +7 -0
  44. data/lib/howitzer/testmail_api/client.rb +44 -0
  45. data/lib/howitzer/testmail_api.rb +7 -0
  46. data/lib/howitzer/utils/string_extensions.rb +6 -2
  47. data/lib/howitzer/version.rb +1 -1
  48. data/lib/howitzer/web/base_section.rb +1 -1
  49. data/lib/howitzer/web/capybara_methods_proxy.rb +11 -5
  50. data/lib/howitzer/web/element_dsl.rb +104 -45
  51. data/lib/howitzer/web/iframe_dsl.rb +2 -2
  52. data/lib/howitzer/web/page.rb +4 -14
  53. data/lib/howitzer/web/page_dsl.rb +15 -6
  54. data/lib/howitzer/web/page_validator.rb +25 -26
  55. data/lib/howitzer/web/section.rb +5 -2
  56. data/lib/howitzer/web/section_dsl.rb +64 -30
  57. data/lib/howitzer.rb +2 -2
  58. metadata +29 -165
  59. data/.coveralls.yml +0 -1
  60. data/.gitignore +0 -14
  61. data/.rspec +0 -3
  62. data/.rubocop.yml +0 -60
  63. data/.ruby-gemset +0 -1
  64. data/.travis.yml +0 -8
  65. data/Gemfile +0 -14
  66. data/ISSUE_TEMPLATE.md +0 -16
  67. data/MAINTENANCE.md +0 -32
  68. data/Rakefile +0 -38
  69. data/features/cli_help.feature +0 -31
  70. data/features/cli_new.feature +0 -393
  71. data/features/cli_unknown.feature +0 -17
  72. data/features/cli_update.feature +0 -223
  73. data/features/cli_version.feature +0 -14
  74. data/features/step_definitions/common_steps.rb +0 -34
  75. data/features/support/env.rb +0 -1
  76. data/generators/config/templates/drivers/appium.rb +0 -25
  77. data/generators/config/templates/drivers/poltergeist.rb +0 -11
  78. data/generators/config/templates/drivers/webkit.rb +0 -6
  79. data/generators/root/templates/.gitignore +0 -21
  80. data/generators/root/templates/.rubocop.yml.erb +0 -56
  81. data/generators/turnip/templates/.rspec +0 -1
  82. data/howitzer.gemspec +0 -39
  83. data/lib/howitzer/mail_adapters/debugmail.rb +0 -0
  84. data/spec/config/custom.yml +0 -9
  85. data/spec/spec_helper.rb +0 -73
  86. data/spec/support/generator_helper.rb +0 -21
  87. data/spec/support/logger_helper.rb +0 -13
  88. data/spec/support/shared_examples/capybara_context_holder.rb +0 -33
  89. data/spec/support/shared_examples/capybara_methods_proxy.rb +0 -94
  90. data/spec/support/shared_examples/dynamic_section_methods.rb +0 -35
  91. data/spec/support/shared_examples/element_dsl.rb +0 -242
  92. data/spec/support/shared_examples/meta_highlight_xpath.rb +0 -41
  93. data/spec/unit/generators/base_generator_spec.rb +0 -283
  94. data/spec/unit/generators/config_generator_spec.rb +0 -61
  95. data/spec/unit/generators/cucumber_generator_spec.rb +0 -62
  96. data/spec/unit/generators/emails_generator_spec.rb +0 -35
  97. data/spec/unit/generators/prerequisites_generator_spec.rb +0 -53
  98. data/spec/unit/generators/root_generator_spec.rb +0 -86
  99. data/spec/unit/generators/rspec_generator_spec.rb +0 -36
  100. data/spec/unit/generators/tasks_generator_spec.rb +0 -31
  101. data/spec/unit/generators/templates/cucumber_spec.rb +0 -97
  102. data/spec/unit/generators/templates/rspec_spec.rb +0 -88
  103. data/spec/unit/generators/templates/turnip_spec.rb +0 -98
  104. data/spec/unit/generators/turnip_generator_spec.rb +0 -52
  105. data/spec/unit/generators/web_generator_spec.rb +0 -52
  106. data/spec/unit/lib/cache_spec.rb +0 -85
  107. data/spec/unit/lib/capybara_helpers_spec.rb +0 -730
  108. data/spec/unit/lib/email_spec.rb +0 -186
  109. data/spec/unit/lib/gmail_api/client_spec.rb +0 -26
  110. data/spec/unit/lib/howitzer_spec.rb +0 -92
  111. data/spec/unit/lib/init_spec.rb +0 -2
  112. data/spec/unit/lib/log_spec.rb +0 -122
  113. data/spec/unit/lib/mail_adapters/abstract_spec.rb +0 -62
  114. data/spec/unit/lib/mail_adapters/gmail_spec.rb +0 -128
  115. data/spec/unit/lib/mail_adapters/mailgun_spec.rb +0 -158
  116. data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +0 -130
  117. data/spec/unit/lib/mailgun_api/client_spec.rb +0 -80
  118. data/spec/unit/lib/mailgun_api/connector_spec.rb +0 -54
  119. data/spec/unit/lib/mailgun_api/response_spec.rb +0 -28
  120. data/spec/unit/lib/mailtrap_api/client_spec.rb +0 -67
  121. data/spec/unit/lib/meta/element_spec.rb +0 -59
  122. data/spec/unit/lib/meta/entry_spec.rb +0 -77
  123. data/spec/unit/lib/meta/iframe_spec.rb +0 -66
  124. data/spec/unit/lib/meta/section_spec.rb +0 -43
  125. data/spec/unit/lib/utils/string_extensions_spec.rb +0 -77
  126. data/spec/unit/lib/web/base_section_spec.rb +0 -43
  127. data/spec/unit/lib/web/element_dsl_spec.rb +0 -31
  128. data/spec/unit/lib/web/iframe_dsl_spec.rb +0 -203
  129. data/spec/unit/lib/web/page_dsl_spec.rb +0 -74
  130. data/spec/unit/lib/web/page_spec.rb +0 -385
  131. data/spec/unit/lib/web/page_validator_spec.rb +0 -276
  132. data/spec/unit/lib/web/section_dsl_spec.rb +0 -165
  133. data/spec/unit/lib/web/section_spec.rb +0 -70
  134. data/spec/unit/version_spec.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7364832d86f0134a208559b840387a50685f15458ca2e54a7cac8f9869fe2974
4
- data.tar.gz: e761cd0524e173f0414ecd57ab2a9c1a99fba1325bb379fa9d56873aa74b6516
3
+ metadata.gz: 1044884bf6fe39dc63128f59f930a0d75ae80297a946d34d2464f47a30fe17fe
4
+ data.tar.gz: b5501960e801914414fc6569996a9cc219e601ea78dfea1dac28c7db9d582ac7
5
5
  SHA512:
6
- metadata.gz: 943c4121f3f8d1f9264a94819236543da59b7ad9aefb7f226b5d47049c5b34bf2ddc1bdb38b6ca10992ea3285fc738ddae774f95ff4ad3dd79bd437397ce7f69
7
- data.tar.gz: de7ca6029f7e6eae2837a3fbbc799403cbff55ca33a6b4b4de05200ef10466477e76fcc416fdad94226919565f3d1574bc7129e23ad66f0a86335e5bcc716765
6
+ metadata.gz: 450f74b4dec7185673b2faa9138c8afb4b9568be8680f38718728105ad5893a5e1abfb1d908e759a021fcd3af13093e67775537b3a109219b065b00c30a7f293
7
+ data.tar.gz: 0bc01379c520937ec1bd004fffcc44b9c558ff9c1c5eea1a292067d65f5d1661f9f5aaf806c5b0183d34e46c2591fc3bd9b71a0cc8288fc7e12b56d9946478d0
data/CHANGELOG.md CHANGED
@@ -1,9 +1,51 @@
1
- ## [In git](https://github.com/strongqa/howitzer/compare/v2.2.0...master)
1
+ ## [In git](https://github.com/strongqa/howitzer/compare/v2.3.0...master)
2
2
 
3
3
  ### New Features
4
4
 
5
5
  ### Bug-fixes
6
6
 
7
+ ## [2.5.0](https://github.com/strongqa/howitzer/compare/v2.4.0...v2.5.0) (2022-08-16)
8
+
9
+
10
+ ### Features
11
+
12
+ * 1secMail integration ([#316](https://github.com/strongqa/howitzer/issues/316)) ([6850758](https://github.com/strongqa/howitzer/commit/6850758370bd293d241f95c2a3cc0163c6fb3062))
13
+ * testmail.app integration ([#314](https://github.com/strongqa/howitzer/issues/314)) ([7f62bae](https://github.com/strongqa/howitzer/commit/7f62bae2e7e91200e02ed98acded9070726f3fc1))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * mailtrap integration update ([#313](https://github.com/strongqa/howitzer/issues/313)) ([49e7390](https://github.com/strongqa/howitzer/commit/49e73909f7033d2986b0f5713bbbcbea7231ade0))
19
+
20
+ ## [2.4.0](https://github.com/strongqa/howitzer/compare/v2.3.0...v2.4.0) (2022-07-22)
21
+
22
+
23
+ ### Features
24
+
25
+ * LambdaTest support ([#305](https://github.com/strongqa/howitzer/issues/305)) ([eca5b8a](https://github.com/strongqa/howitzer/commit/eca5b8a6e4e30c4b9a7640ee999c061cd8e71e09))
26
+ * RegExp email subject matcher for Mailgun ([#304](https://github.com/strongqa/howitzer/issues/304)) ([598c9a2](https://github.com/strongqa/howitzer/commit/598c9a27b5dd8047c212ad050f86b78fa72d326d))
27
+ * Selenium 4 support ([#303](https://github.com/strongqa/howitzer/issues/303)) ([c5bf2d8](https://github.com/strongqa/howitzer/commit/c5bf2d8426e36f97b9fa109a783803c7b1bb538d))
28
+
29
+
30
+ ### Continuous Integration
31
+
32
+ * release-please integration ([#307](https://github.com/strongqa/howitzer/issues/307)) ([bd2f53e](https://github.com/strongqa/howitzer/commit/bd2f53e75c9ef283daadf8f9063d827c4f885a77))
33
+
34
+ ## [v2.3.0](https://github.com/strongqa/howitzer/compare/v2.2.0...v2.3.0)
35
+
36
+ ### New Features
37
+ - Support Ruby 3.0 (minimum version is 2.6.8)
38
+ - Unlock Activesupport 6.x
39
+ - Support latest versions of Cucumber
40
+ - Integrate rubocop-rspec linter
41
+ - Use latest version Rubocop
42
+ - Stop capybara-webkit support
43
+ - Stop poltergeist support
44
+ - Stop Apium driver support
45
+ - remove gmail gem from dependencies and add it only when it is really required
46
+ - Migrate to new Travis CI domain
47
+ - Replace abandoned Coveralls integration with Codecov [codecov.io](https://codecov.io/gh/strongqa/howitzer/)
48
+
7
49
  ## [v2.2.0](https://github.com/strongqa/howitzer/compare/v2.1.1...v2.2.0)
8
50
 
9
51
  ### New Features
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2016 Roman Parashchenko and StrongQA, Ltd.
1
+ Copyright (c) 2012-2021 Roman Parashchenko and StrongQA, LLC.
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,20 +1,22 @@
1
1
  <p align="center" style="overflow: hidden;">
2
- <a href="http://howitzer-framework.io">
2
+ <a href="https://howitzer-framework.io">
3
3
  <img src="https://raw.githubusercontent.com/strongqa/howitzer/gh-pages/images/howitzer-logo.png" alt="Howitzer" />
4
4
  </a>
5
5
  <br/>
6
6
 
7
- <p align="center"><b>Ruby-based framework for acceptance testing of web applications.</b></p>
7
+ <p align="center"><b>A Ruby-based framework for acceptance testing of web applications.</b></p>
8
8
 
9
9
  <p align="center">The framework was built with modern patterns, techniques, and tools in automated testing in order to speed up tests development and simplify supporting.</p>
10
10
 
11
11
  <p align="center">
12
12
  <a href="https://gitter.im/strongqa/howitzer"><img src="https://badges.gitter.im/Join%20Chat.svg" /></a>
13
- <a href="https://rubygems.org/gems/howitzer"><img src="http://img.shields.io/gem/v/howitzer.svg" /></a>
14
- <a href="https://travis-ci.org/strongqa/howitzer"><img src="https://travis-ci.org/strongqa/howitzer.svg?branch=master" /></a>
13
+ <a href="https://rubygems.org/gems/howitzer"><img src="https://img.shields.io/gem/v/howitzer.svg" /></a>
14
+ <a href="https://app.travis-ci.com/github/strongqa/howitzer"><img src="https://app.travis-ci.com/strongqa/howitzer.svg?branch=master" /></a>
15
15
  <a href="https://codeclimate.com/github/strongqa/howitzer"><img src="https://codeclimate.com/github/strongqa/howitzer.png" /></a>
16
- <a href='https://coveralls.io/github/strongqa/howitzer?branch=master'><img src='https://coveralls.io/repos/github/strongqa/howitzer/badge.svg?branch=master' alt='Coverage Status' /></a>
17
- <a href="https://github.com/strongqa/howitzer/blob/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg" /></a>
16
+ <a href="https://codecov.io/gh/strongqa/howitzer">
17
+ <img src="https://codecov.io/gh/strongqa/howitzer/branch/master/graph/badge.svg?token=vB8DYQtmjA"/>
18
+ </a>
19
+ <a href="https://github.com/strongqa/howitzer/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>
18
20
  </p>
19
21
 
20
22
  </p>
@@ -24,13 +26,13 @@
24
26
  - Fast installation and configuration of the complete testing infrastructure (takes less than 5 minutes).
25
27
  - Elegant, intuitive and powerful Ruby language underneath.
26
28
  - Possibility to choose your favorite BDD tool (Cucumber, RSpec or Turnip).
27
- - Integration with SauceLabs, Testingbot, BrowserStack, CrossBrowserTesting cloud services.
29
+ - Integration with SauceLabs, Testingbot, BrowserStack, CrossBrowserTesting, LambdaTest cloud services.
28
30
  - Integration with MailGun, Gmail, Mailtrap email services.
29
31
  - Easy tests support based on the best patterns, techniques, principles.
30
32
  - Ability to execute tests against to both browserless driver and actual browsers with no changes in your tests.
31
33
 
32
34
  ## Documentation
33
- Refer to the [GETTING STARTED](http://docs.howitzer-framework.io) document to start working with *Howitzer*.
35
+ Refer to the [GETTING STARTED](https://docs.howitzer-framework.io) document to start working with *Howitzer*.
34
36
 
35
37
  You can also find the Rdoc documentation on [Rubygems](https://rubygems.org/gems/howitzer).
36
38
 
@@ -41,16 +43,13 @@ You can also find the Rdoc documentation on [Rubygems](https://rubygems.org/gems
41
43
 
42
44
  ## Requirements
43
45
  * Supported OS: Mac OS X, Linux, Windows
44
- * [Ruby](https://www.ruby-lang.org/en/downloads/) 2.3+
46
+ * [Ruby](https://www.ruby-lang.org/en/downloads/) 2.6.8+
45
47
  * [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions) (For **Windows** only)
46
- * [PhantomJS](http://phantomjs.org/download.html) (For **poltergeist** driver only)
47
48
  * [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) (For **chrome** selenium browser, 2.29+ for headless mode)
48
49
  * [GeckoDriver](https://github.com/mozilla/geckodriver/releases) (For **firefox** selenium browser)
49
50
  * [SafariDriver](https://webkit.org/blog/6900/webdriver-support-in-safari-10/) (For **safari** selenium browser)
50
- * [QT](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit) (For **webkit** driver only)
51
51
  * [Chrome](https://www.google.com/chrome/browser/desktop/index.html) v.59+ (For **headless chrome** support)
52
52
  * [Firefox](https://www.mozilla.org/en-US/firefox/new/) v.56+ (For **headless firefox** support)
53
- * [Android SDK](https://developer.android.com/studio/index.html) and [Appium](http://appium.io/getting-started.html) (For Appium driver)
54
53
  ## Setup
55
54
  To install, type
56
55
 
@@ -67,7 +66,7 @@ To generate the project with [Cucumber](https://cucumber.io/), type:
67
66
  howitzer new <PROJECT NAME> --cucumber
68
67
  ```
69
68
 
70
- With [Rspec](http://rspec.info/):
69
+ With [Rspec](https://rspec.info/):
71
70
 
72
71
  ```bash
73
72
  howitzer new <PROJECT NAME> --rspec
@@ -145,7 +144,7 @@ community](https://github.com/strongqa/howitzer/graphs/contributors).
145
144
  License
146
145
  -------
147
146
 
148
- howitzer is Copyright © 2012-2017 Roman Parashchenko and StrongQA Ltd. It is free
147
+ howitzer is Copyright © 2012-2021 Roman Parashchenko and StrongQA LLC. It is free
149
148
  software, and may be redistributed under the terms specified in the
150
149
  [LICENSE](LICENSE) file.
151
150
 
@@ -154,11 +153,11 @@ About StrongQA
154
153
 
155
154
  ![StrongQA](https://github.com/strongqa/howitzer/blob/gh-pages/images/strongqa-logo.png)
156
155
 
157
- howitzer is maintained and funded by StrongQA, Ltd.
158
- The names and logos for StrongQA are trademarks of StrongQA, Ltd.
156
+ howitzer is maintained and funded by StrongQA, LLC.
157
+ The names and logos for StrongQA are trademarks of StrongQA, LLC.
159
158
 
160
159
  We love open source software!
161
160
  See [our other projects][testing_solutions] or [hire us][hire] to consult and develop testing solutions.
162
161
 
163
- [testing_solutions]: http://strongqa.com/testing_solutions/?utm_source=github
162
+ [testing_solutions]: https://strongqa.com/services/testing-solutions?utm_source=github
164
163
  [hire]: https://strongqa.com?utm_source=github
@@ -89,8 +89,8 @@ module Howitzer
89
89
  copy_templates_file_exist(data, destination_path, source_path)
90
90
  else
91
91
  write_template(destination_path, source_path)
92
- puts_info "#{ColorizedString.new('Added').light_green} template '#{data[:source]}' with"\
93
- " params '#{@options}' to destination '#{data[:destination]}'"
92
+ puts_info "#{ColorizedString.new('Added').light_green} template '#{data[:source]}' with " \
93
+ "params '#{@options}' to destination '#{data[:destination]}'"
94
94
  end
95
95
  end
96
96
  end
@@ -118,10 +118,8 @@ module Howitzer
118
118
  end
119
119
 
120
120
  def write_template(dest_path, source_path)
121
- File.open(dest_path, 'w+') do |f|
122
- f.write(ERB.new(File.open(source_path, 'r').read, nil, '-')
123
- .result(OpenStruct.new(@options).instance_eval { binding }))
124
- end
121
+ File.write(dest_path, ERB.new(File.read(source_path), trim_mode: '-')
122
+ .result(OpenStruct.new(@options).instance_eval { binding })) # rubocop:disable Style/OpenStructUse
125
123
  end
126
124
 
127
125
  private
@@ -9,17 +9,15 @@ module Howitzer
9
9
  { source: 'custom.yml', destination: 'config/custom.yml' },
10
10
  { source: 'capybara.rb', destination: 'config/capybara.rb' },
11
11
  { source: 'default.yml', destination: 'config/default.yml' },
12
- { source: 'drivers/appium.rb', destination: 'config/drivers/appium.rb' },
13
12
  { source: 'drivers/browserstack.rb', destination: 'config/drivers/browserstack.rb' },
14
13
  { source: 'drivers/crossbrowsertesting.rb', destination: 'config/drivers/crossbrowsertesting.rb' },
15
14
  { source: 'drivers/headless_chrome.rb', destination: 'config/drivers/headless_chrome.rb' },
16
15
  { source: 'drivers/headless_firefox.rb', destination: 'config/drivers/headless_firefox.rb' },
17
- { source: 'drivers/poltergeist.rb', destination: 'config/drivers/poltergeist.rb' },
16
+ { source: 'drivers/lambdatest.rb', destination: 'config/drivers/lambdatest.rb' },
18
17
  { source: 'drivers/sauce.rb', destination: 'config/drivers/sauce.rb' },
19
18
  { source: 'drivers/selenium.rb', destination: 'config/drivers/selenium.rb' },
20
19
  { source: 'drivers/selenium_grid.rb', destination: 'config/drivers/selenium_grid.rb' },
21
- { source: 'drivers/testingbot.rb', destination: 'config/drivers/testingbot.rb' },
22
- { source: 'drivers/webkit.rb', destination: 'config/drivers/webkit.rb' }
20
+ { source: 'drivers/testingbot.rb', destination: 'config/drivers/testingbot.rb' }
23
21
  ] }
24
22
  end
25
23
 
@@ -3,7 +3,7 @@ require 'bundler/setup'
3
3
 
4
4
  Bundler.require(:default)
5
5
 
6
- Dir[
6
+ Dir[ # rubocop:disable Lint/NonDeterministicRequireOrder
7
7
  './emails/**/*.rb',
8
8
  './web/sections/**/*.rb',
9
9
  './web/pages/**/*.rb',
@@ -1,20 +1,18 @@
1
1
  HOWITZER_KNOWN_DRIVERS = %i[
2
- appium
3
2
  selenium
4
3
  selenium_grid
5
- webkit
6
- poltergeist
7
4
  sauce
8
5
  testingbot
9
6
  browserstack
10
7
  crossbrowsertesting
8
+ lambdatest
11
9
  headless_chrome
12
10
  headless_firefox
13
11
  ].freeze
14
12
 
15
13
  unless HOWITZER_KNOWN_DRIVERS.include?(Howitzer.driver.to_s.to_sym)
16
- raise Howitzer::UnknownDriverError, "Unknown '#{Howitzer.driver}' driver." \
17
- " Check your settings, it should be one of #{HOWITZER_KNOWN_DRIVERS}"
14
+ raise Howitzer::UnknownDriverError, "Unknown '#{Howitzer.driver}' driver. " \
15
+ "Check your settings, it should be one of #{HOWITZER_KNOWN_DRIVERS}"
18
16
  end
19
17
 
20
18
  Capybara.configure do |config|
@@ -26,16 +26,17 @@
26
26
  # Specify SEED to reproduce the shuffling from a previous run. e.g. 'random:5738'
27
27
  test_order: defined
28
28
 
29
- # Specify one of the following drivers: selenium, selenium_grid, webkit, poltergeist, sauce,
30
- # testingbot, browserstack, crossbrowsertesting, headless_chrome, headless_firefox, appium
31
- driver: poltergeist
29
+ # Specify one of the following drivers: selenium, selenium_grid, sauce,
30
+ # testingbot, browserstack, crossbrowsertesting, lambdatest, headless_chrome,
31
+ # headless_firefox
32
+ driver: headless_chrome
32
33
 
33
34
  # -Selenium-
34
35
  # specify one of next browsers: iexplore (ie), firefox (ff), chrome, safari
35
36
  selenium_browser: ff
36
37
 
37
38
  # -Headless Chrome-
38
- # List of available flags (http://peter.sh/experiments/chromium-command-line-switches/)
39
+ # List of available flags (https://peter.sh/experiments/chromium-command-line-switches/)
39
40
  headless_chrome_flags: "window-size=1920x1080, disable-gpu"
40
41
 
41
42
  # -Headless Firefox-
@@ -45,20 +46,6 @@
45
46
  # -Selenium Grid-
46
47
  selenium_hub_url: "http://example.com:4444/wd/hub"
47
48
 
48
- # -Poltergeist-
49
- # specify settings for poltergeist
50
- phantom_ignore_js_errors: false
51
- phantom_ignore_ssl_errors: true
52
-
53
- # -Appium- (https://appium.io/docs/en/writing-running-appium/caps/)
54
- appium_url: "http://localhost:80/wd/hub"
55
- appium_platform_name: "iOS"
56
- appium_platform_version: "10.0"
57
- appium_browser_name: "Safari"
58
- appium_device_name: "iPad Air 2 Simulator"
59
- appium_device_orientation: "portrait"
60
-
61
-
62
49
  rspec_wait_timeout: 10
63
50
 
64
51
  ###########################################################
@@ -68,7 +55,7 @@
68
55
  cloud_auth_pass: api_key_or_api_secret_or_access_key
69
56
  cloud_platform: any
70
57
  cloud_browser_name: Chrome
71
- cloud_browser_version: '31'
58
+ cloud_browser_version: 'latest'
72
59
  cloud_max_duration: '1800'
73
60
  cloud_http_idle_timeout: 40
74
61
 
@@ -95,6 +82,11 @@
95
82
  cloud_cbt_record_video: 'true'
96
83
  cloud_cbt_record_network: 'true'
97
84
 
85
+ # -LambdaTest (https://www.lambdatest.com/support/docs/selenium-automation-capabilities)
86
+ cloud_lambdatest_resolution: '1024x768'
87
+ cloud_lambdatest_project: 'Howitzer Example'
88
+ cloud_lambdatest_build: 'v1'
89
+
98
90
  ###########################################################
99
91
  # CAPYBARA SETTINGS #
100
92
  ###########################################################
@@ -117,7 +109,7 @@
117
109
  mail_wait_time: 60
118
110
  mail_sleep_time: 3
119
111
 
120
- # -Mailgun- (http://www.mailgun.com/)
112
+ # -Mailgun- (https://mailgun.com/)
121
113
  mailgun_key: mailgun_account_private_key
122
114
  mailgun_domain: mailgun_domain_with_stored_method
123
115
 
@@ -128,3 +120,10 @@
128
120
  # -Gmail-
129
121
  gmail_login: gmail_address
130
122
  gmail_password: gmail_password
123
+
124
+ # -testmail.app-
125
+ testmail_api_key: testmail_api_key
126
+ testmail_namespace: testmail_namespace
127
+
128
+ # 1secMail
129
+ onesecmail_domain: 1secmail.com
@@ -1,10 +1,32 @@
1
- Capybara.register_driver :browserstack do |app|
1
+ def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
2
+ caps = CapybaraHelpers.required_w3c_cloud_caps
3
+ bstack_options = {
4
+ sessionName: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
5
+ projectName: Howitzer.cloud_bstack_project,
6
+ buildName: Howitzer.cloud_bstack_build
7
+ }
8
+ bstack_options['resolution'] = Howitzer.cloud_bstack_resolution if Howitzer.cloud_bstack_resolution.present?
9
+ bstack_options['os'] = Howitzer.cloud_bstack_os if Howitzer.cloud_bstack_os.present?
10
+ caps['bstack:options'] = bstack_options
11
+ if Howitzer.user_agent.present?
12
+ if CapybaraHelpers.chrome_browser?
13
+ caps['goog:chromeOptions'] = { 'args' => ["--user-agent=#{Howitzer.user_agent}"] }
14
+ elsif CapybaraHelpers.ff_browser?
15
+ profile = Selenium::WebDriver::Firefox::Profile.new
16
+ profile['general.useragent.override'] = Howitzer.user_agent
17
+ caps['moz:firefoxOptions'] = { profile: profile.as_json['zip'] }
18
+ end
19
+ end
20
+ caps
21
+ end
22
+
23
+ def classic_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
2
24
  caps = CapybaraHelpers.required_cloud_caps.merge(
3
25
  project: Howitzer.cloud_bstack_project,
4
26
  build: Howitzer.cloud_bstack_build
5
27
  )
6
- caps[:resolution] = Howitzer.cloud_bstack_resolution if Howitzer.cloud_bstack_resolution.present?
7
- caps[:device] = Howitzer.cloud_bstack_mobile_device if Howitzer.cloud_bstack_mobile_device.present?
28
+ caps['resolution'] = Howitzer.cloud_bstack_resolution if Howitzer.cloud_bstack_resolution.present?
29
+ caps['os'] = Howitzer.cloud_bstack_os if Howitzer.cloud_bstack_os.present?
8
30
  if Howitzer.user_agent.present?
9
31
  if CapybaraHelpers.chrome_browser?
10
32
  caps['chromeOptions'] = { 'args' => ["--user-agent=#{Howitzer.user_agent}"] }
@@ -14,7 +36,12 @@ Capybara.register_driver :browserstack do |app|
14
36
  caps[:firefox_profile] = profile
15
37
  end
16
38
  end
17
- url = "http://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.browserstack.com/wd/hub"
39
+ caps
40
+ end
41
+
42
+ Capybara.register_driver :browserstack do |app|
43
+ url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.browserstack.com/wd/hub"
44
+ caps = CapybaraHelpers.w3c_selenium? ? w3c_selenium_browserstack_caps : classic_selenium_browserstack_caps
18
45
  CapybaraHelpers.cloud_driver(app, caps, url)
19
46
  end
20
47
 
@@ -1,15 +1,15 @@
1
1
  # :crossbrowsertesting driver
2
2
 
3
3
  Capybara.register_driver :crossbrowsertesting do |app|
4
- caps = {}
5
- caps['name'] = Howitzer.cloud_cbt_name
6
- caps['build'] = Howitzer.cloud_cbt_build
7
- caps['browser_api_name'] = Howitzer.cloud_browser_name + Howitzer.cloud_browser_version.to_s
8
- caps['os_api_name'] = Howitzer.cloud_cbt_os_api_name
9
- caps['screen_resolution'] = Howitzer.cloud_cbt_screen_resolution
10
- caps['record_video'] = Howitzer.cloud_cbt_record_video
11
- caps['record_network'] = Howitzer.cloud_cbt_record_network
12
- caps['max_duration'] = Howitzer.cloud_max_duration
4
+ url = "https://#{CGI.escape(Howitzer.cloud_auth_login)}:#{Howitzer.cloud_auth_pass}" \
5
+ '@hub.crossbrowsertesting.com/wd/hub'
6
+ caps = CapybaraHelpers.required_cloud_caps.merge(
7
+ build: Howitzer.cloud_cbt_build,
8
+ screenResolution: Howitzer.cloud_cbt_screen_resolution,
9
+ record_video: Howitzer.cloud_cbt_record_video,
10
+ record_network: Howitzer.cloud_cbt_record_network,
11
+ max_duration: Howitzer.cloud_max_duration
12
+ )
13
13
  if Howitzer.user_agent.present?
14
14
  if CapybaraHelpers.chrome_browser?
15
15
  caps['chromeOptions'] = { 'args' => ["--user-agent=#{Howitzer.user_agent}"] }
@@ -19,8 +19,6 @@ Capybara.register_driver :crossbrowsertesting do |app|
19
19
  caps[:firefox_profile] = profile
20
20
  end
21
21
  end
22
- url = "http://#{CGI.escape(Howitzer.cloud_auth_login)}:#{Howitzer.cloud_auth_pass}"\
23
- '@hub.crossbrowsertesting.com/wd/hub'
24
22
  CapybaraHelpers.cloud_driver(app, caps, url)
25
23
  end
26
24
 
@@ -7,7 +7,7 @@ Capybara.register_driver :headless_chrome do |app|
7
7
  startup_flags.concat(Howitzer.headless_chrome_flags.split(/\s*,\s*/)) if Howitzer.headless_chrome_flags
8
8
  options = Selenium::WebDriver::Chrome::Options.new(args: startup_flags)
9
9
  params = { browser: :chrome, options: options }
10
- Capybara::Selenium::Driver.new app, params
10
+ Capybara::Selenium::Driver.new app, **params
11
11
  end
12
12
 
13
13
  Capybara::Screenshot.class_eval do
@@ -13,7 +13,7 @@ Capybara.register_driver :headless_firefox do |app|
13
13
  end
14
14
  options = Selenium::WebDriver::Firefox::Options.new(args: startup_flags, profile: ff_profile)
15
15
  params = { browser: :firefox, options: options }
16
- Capybara::Selenium::Driver.new app, params
16
+ Capybara::Selenium::Driver.new app, **params
17
17
  end
18
18
 
19
19
  Capybara.javascript_driver = :headless_firefox
@@ -0,0 +1,30 @@
1
+ def w3c_selenium_lambdatest_caps
2
+ caps = CapybaraHelpers.required_w3c_cloud_caps
3
+ lt_options = {
4
+ name: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
5
+ build: Howitzer.cloud_lambdatest_build
6
+ }
7
+ lt_options[:platformName] = Howitzer.cloud_platform unless Howitzer.cloud_platform.casecmp?('any')
8
+ lt_options[:resolution] = Howitzer.cloud_lambdatest_resolution if Howitzer.cloud_lambdatest_resolution.present?
9
+ caps['LT:Options'] = lt_options
10
+ caps
11
+ end
12
+
13
+ def classic_selenium_lambdatest_caps
14
+ caps = CapybaraHelpers.required_cloud_caps.merge(
15
+ build: Howitzer.cloud_lambdatest_build,
16
+ acceptSslCerts: true
17
+ )
18
+ caps[:resolution] = Howitzer.cloud_lambdatest_resolution if Howitzer.cloud_lambdatest_resolution.present?
19
+ caps
20
+ end
21
+
22
+ Capybara.register_driver :lambdatest do |app|
23
+ url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.lambdatest.com/wd/hub"
24
+ caps = CapybaraHelpers.w3c_selenium? ? w3c_selenium_lambdatest_caps : classic_selenium_lambdatest_caps
25
+ CapybaraHelpers.cloud_driver(app, caps, url)
26
+ end
27
+
28
+ Capybara::Screenshot.class_eval do
29
+ register_driver :lambdatest, &registered_drivers[:selenium]
30
+ end
@@ -1,6 +1,29 @@
1
1
  # :sauce driver
2
2
 
3
- Capybara.register_driver :sauce do |app|
3
+ def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
4
+ caps = CapybaraHelpers.required_w3c_cloud_caps
5
+ caps['platform'] = Howitzer.cloud_platform unless Howitzer.cloud_platform.casecmp?('any')
6
+ sauce_options = {
7
+ name: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
8
+ maxDuration: Howitzer.cloud_max_duration,
9
+ idleTimeout: Howitzer.cloud_sauce_idle_timeout,
10
+ recordScreenshots: Howitzer.cloud_sauce_record_screenshots,
11
+ videoUploadOnPass: Howitzer.cloud_sauce_video_upload_on_pass
12
+ }
13
+ caps['sauce:options'] = sauce_options
14
+ if Howitzer.user_agent.present?
15
+ if CapybaraHelpers.chrome_browser?
16
+ caps['goog:chromeOptions'] = { 'args' => ["--user-agent=#{Howitzer.user_agent}"] }
17
+ elsif CapybaraHelpers.ff_browser?
18
+ profile = Selenium::WebDriver::Firefox::Profile.new
19
+ profile['general.useragent.override'] = Howitzer.user_agent
20
+ caps['moz:firefoxOptions'] = { profile: profile.as_json['zip'] }
21
+ end
22
+ end
23
+ caps
24
+ end
25
+
26
+ def classic_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
4
27
  caps = CapybaraHelpers.required_cloud_caps.merge(
5
28
  maxDuration: Howitzer.cloud_max_duration,
6
29
  idleTimeout: Howitzer.cloud_sauce_idle_timeout,
@@ -16,7 +39,12 @@ Capybara.register_driver :sauce do |app|
16
39
  caps[:firefox_profile] = profile
17
40
  end
18
41
  end
19
- url = "http://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@ondemand.saucelabs.com:80/wd/hub"
42
+ caps
43
+ end
44
+
45
+ Capybara.register_driver :sauce do |app|
46
+ url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@ondemand.saucelabs.com/wd/hub"
47
+ caps = CapybaraHelpers.w3c_selenium? ? w3c_selenium_browserstack_caps : classic_selenium_browserstack_caps
20
48
  CapybaraHelpers.cloud_driver(app, caps, url)
21
49
  end
22
50
 
@@ -20,5 +20,5 @@ Capybara.register_driver :selenium do |app|
20
20
  args << "user-agent=#{Howitzer.user_agent}" if Howitzer.user_agent.present?
21
21
  params[:options] = Selenium::WebDriver::Chrome::Options.new(args: args)
22
22
  end
23
- Capybara::Selenium::Driver.new app, params
23
+ Capybara::Selenium::Driver.new app, **params
24
24
  end
@@ -10,9 +10,9 @@ Capybara.register_driver :selenium_grid do |app|
10
10
  elsif CapybaraHelpers.safari_browser?
11
11
  Selenium::WebDriver::Remote::Capabilities.safari
12
12
  else
13
- raise Howitzer::UnknownBrowserError, "Unknown '#{Howitzer.selenium_browser}' selenium_browser." \
14
- ' Check your settings, it should be one of' \
15
- ' [:ie, :iexplore, :ff, :firefox, :chrome, :safari]'
13
+ raise Howitzer::UnknownBrowserError, "Unknown '#{Howitzer.selenium_browser}' selenium_browser. " \
14
+ 'Check your settings, it should be one of ' \
15
+ '[:ie, :iexplore, :ff, :firefox, :chrome, :safari]'
16
16
  end
17
17
  if Howitzer.user_agent.present?
18
18
  if CapybaraHelpers.chrome_browser?
@@ -1,6 +1,28 @@
1
1
  # :testingbot driver
2
2
 
3
- Capybara.register_driver :testingbot do |app|
3
+ def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
4
+ caps = CapybaraHelpers.required_w3c_cloud_caps
5
+ caps[:platformName] = Howitzer.cloud_platform unless Howitzer.cloud_platform.casecmp?('any')
6
+ tb_options = {
7
+ name: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
8
+ maxduration: Howitzer.cloud_max_duration,
9
+ idletimeout: Howitzer.cloud_testingbot_idle_timeout,
10
+ screenshot: Howitzer.cloud_testingbot_screenshots
11
+ }
12
+ caps['tb:options'] = tb_options
13
+ if Howitzer.user_agent.present?
14
+ if CapybaraHelpers.chrome_browser?
15
+ caps['goog:chromeOptions'] = { 'args' => ["--user-agent=#{Howitzer.user_agent}"] }
16
+ elsif CapybaraHelpers.ff_browser?
17
+ profile = Selenium::WebDriver::Firefox::Profile.new
18
+ profile['general.useragent.override'] = Howitzer.user_agent
19
+ caps['moz:firefoxOptions'] = { profile: profile.as_json['zip'] }
20
+ end
21
+ end
22
+ caps
23
+ end
24
+
25
+ def classic_selenium_browserstack_caps
4
26
  caps = CapybaraHelpers.required_cloud_caps.merge(
5
27
  maxduration: Howitzer.cloud_max_duration,
6
28
  idletimeout: Howitzer.cloud_testingbot_idle_timeout,
@@ -15,7 +37,12 @@ Capybara.register_driver :testingbot do |app|
15
37
  caps[:firefox_profile] = profile
16
38
  end
17
39
  end
18
- url = "http://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.testingbot.com/wd/hub"
40
+ caps
41
+ end
42
+
43
+ Capybara.register_driver :testingbot do |app|
44
+ url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.testingbot.com/wd/hub"
45
+ caps = CapybaraHelpers.w3c_selenium? ? w3c_selenium_browserstack_caps : classic_selenium_browserstack_caps
19
46
  CapybaraHelpers.cloud_driver(app, caps, url)
20
47
  end
21
48
 
@@ -14,7 +14,7 @@ AfterConfiguration do |config|
14
14
  if Howitzer.test_order.present?
15
15
  order, seed = Howitzer.test_order.split(':')
16
16
  config.instance_variable_get(:@options)[:order] = order
17
- config.instance_variable_get(:@options)[:seed] = seed
17
+ config.instance_variable_get(:@options)[:seed] ||= seed
18
18
  end
19
19
  end
20
20
 
@@ -1,6 +1,12 @@
1
1
  Before do |scenario|
2
2
  Capybara.use_default_driver
3
- Howitzer::Log.print_feature_name(scenario.feature.name)
3
+ feature_name = \
4
+ if Gem::Requirement.new('>3').satisfied_by?(Gem::Version.new(Cucumber::VERSION))
5
+ File.read(scenario.location.file)[/Feature:\s(.+)/, 1]
6
+ else
7
+ scenario.feature.name
8
+ end
9
+ Howitzer::Log.print_feature_name(feature_name)
4
10
  Howitzer::Log.print_scenario_name(scenario.name)
5
11
  @session_start = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
6
12
  end
@@ -9,8 +15,8 @@ After do |scenario|
9
15
  if CapybaraHelpers.cloud_driver?
10
16
  Howitzer::Cache.store(:cloud, :status, false) if scenario.failed?
11
17
  session_end = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
12
- Howitzer::Log.info "CLOUD VIDEO #{@session_start} - #{session_end}" \
13
- " URL: #{CapybaraHelpers.cloud_resource_path(:video)}"
18
+ Howitzer::Log.info "CLOUD VIDEO #{@session_start} - #{session_end} " \
19
+ "URL: #{CapybaraHelpers.cloud_resource_path(:video)}"
14
20
  elsif CapybaraHelpers.ie_browser?
15
21
  Howitzer::Log.info 'IE reset session'
16
22
  Capybara.current_session.execute_script("void(document.execCommand('ClearAuthenticationCache', false));")
@@ -15,7 +15,7 @@
15
15
  # end
16
16
  ParameterType(
17
17
  name: 'factory',
18
- regexp: /(?:factory|FACTORY)_([A-Za-z_]+)(\d*)(?:\[\:(.+)\])?/,
18
+ regexp: /(?:factory|FACTORY)_([A-Za-z_]+)(\d*)(?:\[:(.+)\])?/,
19
19
  transformer: lambda do |_, factory, num, property|
20
20
  res = FactoryBot.given_by_number(factory.downcase, num)
21
21
  res = res.send(property) if property
@@ -1,4 +1,4 @@
1
- # @see http://www.rubydoc.info/gems/factory_bot/file/GETTING_STARTED.md
1
+ # @see https://www.rubydoc.info/gems/factory_bot/file/GETTING_STARTED.md
2
2
  require 'factory_bot'
3
3
 
4
4
  FactoryBot.definition_file_paths = [File.join(__dir__, 'factories')]