howitzer 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/LICENSE +1 -1
- data/README.md +16 -16
- data/generators/base_generator.rb +1 -1
- data/generators/config/config_generator.rb +1 -4
- data/generators/config/templates/boot.rb +1 -1
- data/generators/config/templates/capybara.rb +1 -3
- data/generators/config/templates/default.yml +5 -19
- data/generators/config/templates/drivers/browserstack.rb +1 -1
- data/generators/config/templates/drivers/crossbrowsertesting.rb +1 -1
- data/generators/config/templates/drivers/headless_chrome.rb +1 -1
- data/generators/config/templates/drivers/headless_firefox.rb +1 -1
- data/generators/config/templates/drivers/sauce.rb +1 -1
- data/generators/config/templates/drivers/selenium.rb +1 -1
- data/generators/config/templates/drivers/selenium_grid.rb +2 -2
- data/generators/config/templates/drivers/testingbot.rb +1 -1
- data/generators/cucumber/templates/env.rb +1 -1
- data/generators/cucumber/templates/hooks.rb +8 -2
- data/generators/cucumber/templates/transformers.rb +1 -1
- data/generators/prerequisites/templates/factory_bot.rb +1 -1
- data/generators/root/templates/Gemfile.erb +4 -10
- data/generators/rspec/templates/spec_helper.rb +4 -4
- data/generators/turnip/templates/spec_helper.rb +4 -4
- data/generators/web/templates/example_page.rb +1 -1
- data/lib/howitzer/cache.rb +1 -1
- data/lib/howitzer/capybara_helpers.rb +27 -7
- data/lib/howitzer/email.rb +2 -2
- data/lib/howitzer/exceptions.rb +21 -21
- data/lib/howitzer/gmail_api/client.rb +13 -4
- data/lib/howitzer/log.rb +6 -6
- data/lib/howitzer/mailgun_api/client.rb +3 -2
- data/lib/howitzer/mailgun_api/response.rb +1 -2
- data/lib/howitzer/mailtrap_api/client.rb +1 -1
- data/lib/howitzer/meta/actions.rb +13 -16
- data/lib/howitzer/meta/element.rb +12 -10
- data/lib/howitzer/utils/string_extensions.rb +6 -2
- data/lib/howitzer/version.rb +1 -1
- data/lib/howitzer/web/base_section.rb +1 -1
- data/lib/howitzer/web/capybara_methods_proxy.rb +11 -5
- data/lib/howitzer/web/element_dsl.rb +104 -45
- data/lib/howitzer/web/iframe_dsl.rb +2 -2
- data/lib/howitzer/web/page.rb +4 -14
- data/lib/howitzer/web/page_dsl.rb +15 -6
- data/lib/howitzer/web/page_validator.rb +25 -26
- data/lib/howitzer/web/section.rb +5 -2
- data/lib/howitzer/web/section_dsl.rb +64 -30
- data/lib/howitzer.rb +2 -2
- metadata +24 -161
- data/.coveralls.yml +0 -1
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.rubocop.yml +0 -60
- data/.ruby-gemset +0 -1
- data/.travis.yml +0 -8
- data/Gemfile +0 -14
- data/ISSUE_TEMPLATE.md +0 -16
- data/MAINTENANCE.md +0 -32
- data/Rakefile +0 -38
- data/features/cli_help.feature +0 -31
- data/features/cli_new.feature +0 -393
- data/features/cli_unknown.feature +0 -17
- data/features/cli_update.feature +0 -223
- data/features/cli_version.feature +0 -14
- data/features/step_definitions/common_steps.rb +0 -34
- data/features/support/env.rb +0 -1
- data/generators/config/templates/drivers/poltergeist.rb +0 -11
- data/generators/config/templates/drivers/webkit.rb +0 -6
- data/generators/root/templates/.gitignore +0 -21
- data/generators/root/templates/.rubocop.yml.erb +0 -56
- data/generators/turnip/templates/.rspec +0 -1
- data/howitzer.gemspec +0 -39
- data/lib/howitzer/mail_adapters/debugmail.rb +0 -0
- data/spec/config/custom.yml +0 -9
- data/spec/spec_helper.rb +0 -73
- data/spec/support/generator_helper.rb +0 -21
- data/spec/support/logger_helper.rb +0 -13
- data/spec/support/shared_examples/capybara_context_holder.rb +0 -33
- data/spec/support/shared_examples/capybara_methods_proxy.rb +0 -94
- data/spec/support/shared_examples/dynamic_section_methods.rb +0 -35
- data/spec/support/shared_examples/element_dsl.rb +0 -242
- data/spec/support/shared_examples/meta_highlight_xpath.rb +0 -41
- data/spec/unit/generators/base_generator_spec.rb +0 -283
- data/spec/unit/generators/config_generator_spec.rb +0 -61
- data/spec/unit/generators/cucumber_generator_spec.rb +0 -62
- data/spec/unit/generators/emails_generator_spec.rb +0 -35
- data/spec/unit/generators/prerequisites_generator_spec.rb +0 -53
- data/spec/unit/generators/root_generator_spec.rb +0 -86
- data/spec/unit/generators/rspec_generator_spec.rb +0 -36
- data/spec/unit/generators/tasks_generator_spec.rb +0 -31
- data/spec/unit/generators/templates/cucumber_spec.rb +0 -97
- data/spec/unit/generators/templates/rspec_spec.rb +0 -88
- data/spec/unit/generators/templates/turnip_spec.rb +0 -98
- data/spec/unit/generators/turnip_generator_spec.rb +0 -52
- data/spec/unit/generators/web_generator_spec.rb +0 -52
- data/spec/unit/lib/cache_spec.rb +0 -85
- data/spec/unit/lib/capybara_helpers_spec.rb +0 -730
- data/spec/unit/lib/email_spec.rb +0 -186
- data/spec/unit/lib/gmail_api/client_spec.rb +0 -26
- data/spec/unit/lib/howitzer_spec.rb +0 -92
- data/spec/unit/lib/init_spec.rb +0 -2
- data/spec/unit/lib/log_spec.rb +0 -122
- data/spec/unit/lib/mail_adapters/abstract_spec.rb +0 -62
- data/spec/unit/lib/mail_adapters/gmail_spec.rb +0 -128
- data/spec/unit/lib/mail_adapters/mailgun_spec.rb +0 -158
- data/spec/unit/lib/mail_adapters/mailtrap_spec.rb +0 -130
- data/spec/unit/lib/mailgun_api/client_spec.rb +0 -80
- data/spec/unit/lib/mailgun_api/connector_spec.rb +0 -54
- data/spec/unit/lib/mailgun_api/response_spec.rb +0 -28
- data/spec/unit/lib/mailtrap_api/client_spec.rb +0 -67
- data/spec/unit/lib/meta/element_spec.rb +0 -59
- data/spec/unit/lib/meta/entry_spec.rb +0 -77
- data/spec/unit/lib/meta/iframe_spec.rb +0 -66
- data/spec/unit/lib/meta/section_spec.rb +0 -43
- data/spec/unit/lib/utils/string_extensions_spec.rb +0 -77
- data/spec/unit/lib/web/base_section_spec.rb +0 -43
- data/spec/unit/lib/web/element_dsl_spec.rb +0 -31
- data/spec/unit/lib/web/iframe_dsl_spec.rb +0 -203
- data/spec/unit/lib/web/page_dsl_spec.rb +0 -74
- data/spec/unit/lib/web/page_spec.rb +0 -385
- data/spec/unit/lib/web/page_validator_spec.rb +0 -276
- data/spec/unit/lib/web/section_dsl_spec.rb +0 -165
- data/spec/unit/lib/web/section_spec.rb +0 -70
- data/spec/unit/version_spec.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c577b57b08ceb6da2f3a82b8b7e29950f02903fd519379bf42d49bfbb98d619
|
4
|
+
data.tar.gz: 3c3ee954802caa64bddd20e53c230dae5a6442bd83860b85058f90a61bf8cbc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bbe3fe208d2d92ebfa7b04e6ae7fa7842ff8400515f8e699ab8587cbdb1ee8206f2cfc0a9e7b3841173fd6c4f7d0ab01341dc24172ca0a3fb4136c07a14ca46
|
7
|
+
data.tar.gz: 3f98ca3bc90bd1e35b7b2a87bbc8059878de7bbe08109cbdeff83e46f02bf9a8503f3bc4d034028fbef73718aac71702424276a49d59f892e25bf771d21e8f4d
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
-
## [In git](https://github.com/strongqa/howitzer/compare/v2.
|
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
|
+
## [v2.3.0](https://github.com/strongqa/howitzer/compare/v2.2.0...v2.3.0)
|
8
|
+
|
9
|
+
### New Features
|
10
|
+
- Support Ruby 3.0 (minimum version is 2.6.8)
|
11
|
+
- Unlock Activesupport 6.x
|
12
|
+
- Support latest versions of Cucumber
|
13
|
+
- Integrate rubocop-rspec linter
|
14
|
+
- Use latest version Rubocop
|
15
|
+
- Stop capybara-webkit support
|
16
|
+
- Stop poltergeist support
|
17
|
+
- Stop Apium driver support
|
18
|
+
- remove gmail gem from dependencies and add it only when it is really required
|
19
|
+
- Migrate to new Travis CI domain
|
20
|
+
- Replace abandoned Coveralls integration with Codecov [codecov.io](https://codecov.io/gh/strongqa/howitzer/)
|
21
|
+
|
7
22
|
## [v2.2.0](https://github.com/strongqa/howitzer/compare/v2.1.1...v2.2.0)
|
8
23
|
|
9
24
|
### New Features
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
<p align="center" style="overflow: hidden;">
|
2
|
-
<a href="
|
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="
|
14
|
-
<a href="https://travis-ci.
|
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=
|
17
|
-
|
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>
|
@@ -30,7 +32,7 @@
|
|
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](
|
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,14 @@ 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.
|
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
|
53
|
+
* [Android SDK](https://developer.android.com/studio) and [Appium](https://appium.io/docs/en/about-appium/getting-started) (For Appium driver)
|
54
54
|
## Setup
|
55
55
|
To install, type
|
56
56
|
|
@@ -67,7 +67,7 @@ To generate the project with [Cucumber](https://cucumber.io/), type:
|
|
67
67
|
howitzer new <PROJECT NAME> --cucumber
|
68
68
|
```
|
69
69
|
|
70
|
-
With [Rspec](
|
70
|
+
With [Rspec](https://rspec.info/):
|
71
71
|
|
72
72
|
```bash
|
73
73
|
howitzer new <PROJECT NAME> --rspec
|
@@ -145,7 +145,7 @@ community](https://github.com/strongqa/howitzer/graphs/contributors).
|
|
145
145
|
License
|
146
146
|
-------
|
147
147
|
|
148
|
-
howitzer is Copyright © 2012-
|
148
|
+
howitzer is Copyright © 2012-2021 Roman Parashchenko and StrongQA LLC. It is free
|
149
149
|
software, and may be redistributed under the terms specified in the
|
150
150
|
[LICENSE](LICENSE) file.
|
151
151
|
|
@@ -154,11 +154,11 @@ About StrongQA
|
|
154
154
|
|
155
155
|
![StrongQA](https://github.com/strongqa/howitzer/blob/gh-pages/images/strongqa-logo.png)
|
156
156
|
|
157
|
-
howitzer is maintained and funded by StrongQA,
|
158
|
-
The names and logos for StrongQA are trademarks of StrongQA,
|
157
|
+
howitzer is maintained and funded by StrongQA, LLC.
|
158
|
+
The names and logos for StrongQA are trademarks of StrongQA, LLC.
|
159
159
|
|
160
160
|
We love open source software!
|
161
161
|
See [our other projects][testing_solutions] or [hire us][hire] to consult and develop testing solutions.
|
162
162
|
|
163
|
-
[testing_solutions]:
|
163
|
+
[testing_solutions]: https://strongqa.com/services/testing-solutions?utm_source=github
|
164
164
|
[hire]: https://strongqa.com?utm_source=github
|
@@ -119,7 +119,7 @@ module Howitzer
|
|
119
119
|
|
120
120
|
def write_template(dest_path, source_path)
|
121
121
|
File.open(dest_path, 'w+') do |f|
|
122
|
-
f.write(ERB.new(File.open(source_path, 'r').read,
|
122
|
+
f.write(ERB.new(File.open(source_path, 'r').read, trim_mode: '-')
|
123
123
|
.result(OpenStruct.new(@options).instance_eval { binding }))
|
124
124
|
end
|
125
125
|
end
|
@@ -9,17 +9,14 @@ 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' },
|
18
16
|
{ source: 'drivers/sauce.rb', destination: 'config/drivers/sauce.rb' },
|
19
17
|
{ source: 'drivers/selenium.rb', destination: 'config/drivers/selenium.rb' },
|
20
18
|
{ 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' }
|
19
|
+
{ source: 'drivers/testingbot.rb', destination: 'config/drivers/testingbot.rb' }
|
23
20
|
] }
|
24
21
|
end
|
25
22
|
|
@@ -2,8 +2,6 @@ HOWITZER_KNOWN_DRIVERS = %i[
|
|
2
2
|
appium
|
3
3
|
selenium
|
4
4
|
selenium_grid
|
5
|
-
webkit
|
6
|
-
poltergeist
|
7
5
|
sauce
|
8
6
|
testingbot
|
9
7
|
browserstack
|
@@ -14,7 +12,7 @@ HOWITZER_KNOWN_DRIVERS = %i[
|
|
14
12
|
|
15
13
|
unless HOWITZER_KNOWN_DRIVERS.include?(Howitzer.driver.to_s.to_sym)
|
16
14
|
raise Howitzer::UnknownDriverError, "Unknown '#{Howitzer.driver}' driver." \
|
17
|
-
|
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,16 @@
|
|
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,
|
29
|
+
# Specify one of the following drivers: selenium, selenium_grid, sauce,
|
30
30
|
# testingbot, browserstack, crossbrowsertesting, headless_chrome, headless_firefox, appium
|
31
|
-
driver:
|
31
|
+
driver: headless_chrome
|
32
32
|
|
33
33
|
# -Selenium-
|
34
34
|
# specify one of next browsers: iexplore (ie), firefox (ff), chrome, safari
|
35
35
|
selenium_browser: ff
|
36
36
|
|
37
37
|
# -Headless Chrome-
|
38
|
-
# List of available flags (
|
38
|
+
# List of available flags (https://peter.sh/experiments/chromium-command-line-switches/)
|
39
39
|
headless_chrome_flags: "window-size=1920x1080, disable-gpu"
|
40
40
|
|
41
41
|
# -Headless Firefox-
|
@@ -45,20 +45,6 @@
|
|
45
45
|
# -Selenium Grid-
|
46
46
|
selenium_hub_url: "http://example.com:4444/wd/hub"
|
47
47
|
|
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
48
|
rspec_wait_timeout: 10
|
63
49
|
|
64
50
|
###########################################################
|
@@ -68,7 +54,7 @@
|
|
68
54
|
cloud_auth_pass: api_key_or_api_secret_or_access_key
|
69
55
|
cloud_platform: any
|
70
56
|
cloud_browser_name: Chrome
|
71
|
-
cloud_browser_version: '
|
57
|
+
cloud_browser_version: 'latest'
|
72
58
|
cloud_max_duration: '1800'
|
73
59
|
cloud_http_idle_timeout: 40
|
74
60
|
|
@@ -117,7 +103,7 @@
|
|
117
103
|
mail_wait_time: 60
|
118
104
|
mail_sleep_time: 3
|
119
105
|
|
120
|
-
# -Mailgun- (
|
106
|
+
# -Mailgun- (https://mailgun.com/)
|
121
107
|
mailgun_key: mailgun_account_private_key
|
122
108
|
mailgun_domain: mailgun_domain_with_stored_method
|
123
109
|
|
@@ -14,7 +14,7 @@ Capybara.register_driver :browserstack do |app|
|
|
14
14
|
caps[:firefox_profile] = profile
|
15
15
|
end
|
16
16
|
end
|
17
|
-
url = "
|
17
|
+
url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.browserstack.com/wd/hub"
|
18
18
|
CapybaraHelpers.cloud_driver(app, caps, url)
|
19
19
|
end
|
20
20
|
|
@@ -19,7 +19,7 @@ Capybara.register_driver :crossbrowsertesting do |app|
|
|
19
19
|
caps[:firefox_profile] = profile
|
20
20
|
end
|
21
21
|
end
|
22
|
-
url = "
|
22
|
+
url = "https://#{CGI.escape(Howitzer.cloud_auth_login)}:#{Howitzer.cloud_auth_pass}"\
|
23
23
|
'@hub.crossbrowsertesting.com/wd/hub'
|
24
24
|
CapybaraHelpers.cloud_driver(app, caps, url)
|
25
25
|
end
|
@@ -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
|
@@ -16,7 +16,7 @@ Capybara.register_driver :sauce do |app|
|
|
16
16
|
caps[:firefox_profile] = profile
|
17
17
|
end
|
18
18
|
end
|
19
|
-
url = "
|
19
|
+
url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@ondemand.saucelabs.com/wd/hub"
|
20
20
|
CapybaraHelpers.cloud_driver(app, caps, url)
|
21
21
|
end
|
22
22
|
|
@@ -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
|
@@ -11,8 +11,8 @@ Capybara.register_driver :selenium_grid do |app|
|
|
11
11
|
Selenium::WebDriver::Remote::Capabilities.safari
|
12
12
|
else
|
13
13
|
raise Howitzer::UnknownBrowserError, "Unknown '#{Howitzer.selenium_browser}' selenium_browser." \
|
14
|
-
|
15
|
-
|
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?
|
@@ -15,7 +15,7 @@ Capybara.register_driver :testingbot do |app|
|
|
15
15
|
caps[:firefox_profile] = profile
|
16
16
|
end
|
17
17
|
end
|
18
|
-
url = "
|
18
|
+
url = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@hub.testingbot.com/wd/hub"
|
19
19
|
CapybaraHelpers.cloud_driver(app, caps, url)
|
20
20
|
end
|
21
21
|
|
@@ -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]
|
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
|
-
|
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
|
@@ -10,7 +16,7 @@ After do |scenario|
|
|
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
18
|
Howitzer::Log.info "CLOUD VIDEO #{@session_start} - #{session_end}" \
|
13
|
-
|
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,7 +1,9 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
+
ruby '>=2.6.8'
|
4
|
+
|
3
5
|
gem 'capybara-screenshot'
|
4
|
-
<%= "gem 'cucumber', '
|
6
|
+
<%= "gem 'cucumber', '>=3.0', '<7'\n" if cucumber -%>
|
5
7
|
<%= "gem 'cuke_sniffer', require: false\n" if cucumber -%>
|
6
8
|
gem 'factory_bot'
|
7
9
|
gem 'howitzer'
|
@@ -11,18 +13,10 @@ gem 'repeater'
|
|
11
13
|
gem 'rest-client'
|
12
14
|
<%= "gem 'rspec', '~>3.2'\n" if rspec || turnip -%>
|
13
15
|
gem 'rubocop'
|
16
|
+
<%= "gem 'rubocop-rspec'\n" if rspec || turnip -%>
|
14
17
|
<%= "gem 'turnip'\n" if turnip -%>
|
15
18
|
<%= "gem 'syntax'\n" if cucumber -%>
|
16
19
|
|
17
20
|
# Uncomment it if you are going to use 'appium' driver. Appium and Android SDK should be installed.
|
18
21
|
# See https://appium.io/docs/en/about-appium/getting-started/
|
19
22
|
# gem 'appium_capybara'
|
20
|
-
|
21
|
-
# Uncomment it if you are going to use 'webkit' driver. QT library should be installed.
|
22
|
-
# See https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit
|
23
|
-
#
|
24
|
-
# gem 'capybara-webkit'
|
25
|
-
|
26
|
-
# Uncomment it if you are going to use 'poltergeist' driver. PhantomJS should be installed.
|
27
|
-
# See https://github.com/jnicklas/capybara#poltergeist
|
28
|
-
# gem 'poltergeist', git: 'https://github.com/teampoltergeist/poltergeist.git', branch: :master
|
@@ -2,7 +2,7 @@ require 'capybara/rspec/features'
|
|
2
2
|
require_relative '../config/boot'
|
3
3
|
require_relative '../config/capybara'
|
4
4
|
|
5
|
-
Dir['./spec/support/**/*.rb'].each { |f| require f }
|
5
|
+
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
6
6
|
|
7
7
|
RSpec.configure do |config|
|
8
8
|
Howitzer::Log.settings_as_formatted_text
|
@@ -17,7 +17,7 @@ RSpec.configure do |config|
|
|
17
17
|
config.wait_timeout = Howitzer.rspec_wait_timeout
|
18
18
|
config.order = Howitzer.test_order.presence || :defined
|
19
19
|
|
20
|
-
config.before
|
20
|
+
config.before do
|
21
21
|
scenario_name =
|
22
22
|
if RSpec.current_example.description.blank?
|
23
23
|
RSpec.current_example.metadata[:full_description]
|
@@ -28,12 +28,12 @@ RSpec.configure do |config|
|
|
28
28
|
@session_start = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
|
29
29
|
end
|
30
30
|
|
31
|
-
config.after
|
31
|
+
config.after do
|
32
32
|
Howitzer::Cache.clear_all_ns
|
33
33
|
if CapybaraHelpers.cloud_driver?
|
34
34
|
session_end = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
|
35
35
|
Howitzer::Log.info "CLOUD VIDEO #{@session_start} - #{session_end}" \
|
36
|
-
|
36
|
+
" URL: #{CapybaraHelpers.cloud_resource_path(:video)}"
|
37
37
|
elsif CapybaraHelpers.ie_browser?
|
38
38
|
Howitzer::Log.info 'IE reset session'
|
39
39
|
Capybara.current_session.execute_script("void(document.execCommand('ClearAuthenticationCache', false));")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require_relative '../config/boot'
|
2
2
|
require_relative '../config/capybara'
|
3
3
|
|
4
|
-
Dir['./spec/support/**/*.rb'].each { |f| require f }
|
4
|
+
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
5
5
|
|
6
6
|
RSpec.configure do |config|
|
7
7
|
Howitzer::Log.settings_as_formatted_text
|
@@ -16,7 +16,7 @@ RSpec.configure do |config|
|
|
16
16
|
config.wait_timeout = Howitzer.rspec_wait_timeout
|
17
17
|
config.order = Howitzer.test_order.presence || :defined
|
18
18
|
|
19
|
-
config.before
|
19
|
+
config.before do
|
20
20
|
scenario_name =
|
21
21
|
if RSpec.current_example.description.blank?
|
22
22
|
RSpec.current_example.metadata[:full_description]
|
@@ -27,12 +27,12 @@ RSpec.configure do |config|
|
|
27
27
|
@session_start = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
|
28
28
|
end
|
29
29
|
|
30
|
-
config.after
|
30
|
+
config.after do
|
31
31
|
Howitzer::Cache.clear_all_ns
|
32
32
|
if CapybaraHelpers.cloud_driver?
|
33
33
|
session_end = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
|
34
34
|
Howitzer::Log.info "CLOUD VIDEO #{@session_start} - #{session_end}" \
|
35
|
-
|
35
|
+
" URL: #{CapybaraHelpers.cloud_resource_path(:video)}"
|
36
36
|
elsif CapybaraHelpers.ie_browser?
|
37
37
|
Howitzer::Log.info 'IE reset session'
|
38
38
|
Capybara.current_session.execute_script("void(document.execCommand('ClearAuthenticationCache', false));")
|
data/lib/howitzer/cache.rb
CHANGED
@@ -1,11 +1,33 @@
|
|
1
1
|
require 'rest-client'
|
2
2
|
require 'howitzer/exceptions'
|
3
3
|
|
4
|
+
# There is an issue with supporting Ruby 3 by Selenium Webdriver 3.x version
|
5
|
+
# https://github.com/SeleniumHQ/selenium/issues/9001
|
6
|
+
# Migration to Selenium Webdriver 4 is planned when it will be released without alfa, beta stages.
|
7
|
+
if Gem::Requirement.new('>=3').satisfied_by?(Gem::Version.new(RUBY_VERSION)) ||
|
8
|
+
Gem::Requirement.new(['>=3', '<4']).satisfied_by?(Gem::Version.new(Selenium::WebDriver::VERSION))
|
9
|
+
module Selenium
|
10
|
+
module WebDriver
|
11
|
+
module Remote
|
12
|
+
class Bridge # rubocop:disable Style/Documentation
|
13
|
+
class << self
|
14
|
+
alias original_handshake handshake
|
15
|
+
|
16
|
+
def handshake(opts = {})
|
17
|
+
original_handshake(**opts)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
4
26
|
module Howitzer
|
5
27
|
# This module holds capybara helpers methods
|
6
28
|
module CapybaraHelpers
|
7
|
-
CHECK_YOUR_SETTINGS_MSG = 'Please check your settings'.freeze
|
8
|
-
HOWITZER_KNOWN_BROWSERS = [
|
29
|
+
CHECK_YOUR_SETTINGS_MSG = 'Please check your settings'.freeze # :nodoc:
|
30
|
+
HOWITZER_KNOWN_BROWSERS = [ # :nodoc:
|
9
31
|
CLOUD_BROWSERS = [
|
10
32
|
SAUCE = :sauce,
|
11
33
|
TESTINGBOT = :testingbot,
|
@@ -15,10 +37,8 @@ module Howitzer
|
|
15
37
|
LOCAL_BROWSERS = [
|
16
38
|
HEADLESS_CHROME = :headless_chrome,
|
17
39
|
HEADLESS_FIREFOX = :headless_firefox,
|
18
|
-
POLTERGEIST = :poltergeist,
|
19
40
|
SELENIUM = :selenium,
|
20
|
-
SELENIUM_GRID = :selenium_grid
|
21
|
-
WEBKIT = :webkit
|
41
|
+
SELENIUM_GRID = :selenium_grid
|
22
42
|
].freeze
|
23
43
|
].freeze
|
24
44
|
|
@@ -127,7 +147,7 @@ module Howitzer
|
|
127
147
|
http_client: http_client,
|
128
148
|
browser: :remote
|
129
149
|
}
|
130
|
-
driver = Capybara::Selenium::Driver.new(app, options)
|
150
|
+
driver = Capybara::Selenium::Driver.new(app, **options)
|
131
151
|
driver.browser.file_detector = remote_file_detector
|
132
152
|
driver
|
133
153
|
end
|
@@ -199,7 +219,7 @@ module Howitzer
|
|
199
219
|
end
|
200
220
|
|
201
221
|
def update_sauce_job_status(json_data = {})
|
202
|
-
host = "
|
222
|
+
host = "https://#{Howitzer.cloud_auth_login}:#{Howitzer.cloud_auth_pass}@saucelabs.com"
|
203
223
|
path = "/rest/v1/#{Howitzer.cloud_auth_login}/jobs/#{session_id}"
|
204
224
|
url = "#{host}#{path}"
|
205
225
|
::RestClient.put url, json_data.to_json, content_type: :json, accept: :json
|
data/lib/howitzer/email.rb
CHANGED
@@ -79,8 +79,8 @@ module Howitzer
|
|
79
79
|
def self.find_by_recipient(recipient, params = {})
|
80
80
|
if defined?(subject_value).nil? || subject_value.nil?
|
81
81
|
raise Howitzer::NoEmailSubjectError, "Please specify email subject. For example:\n" \
|
82
|
-
|
83
|
-
|
82
|
+
"class SomeEmail < Howitzer::Email\n" \
|
83
|
+
" subject ‘some subject text’\nend"
|
84
84
|
end
|
85
85
|
new(adapter.find(recipient, expand_subject(params), wait: wait_time_value))
|
86
86
|
end
|
data/lib/howitzer/exceptions.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
# This module holds all custom howitzer exceptions
|
2
2
|
module Howitzer
|
3
|
-
CommunicationError = Class.new(StandardError)
|
4
|
-
ParseError = Class.new(StandardError)
|
5
|
-
InvalidApiKeyError = Class.new(StandardError)
|
6
|
-
BadElementParamsError = Class.new(StandardError)
|
7
|
-
NoValidationError = Class.new(StandardError)
|
8
|
-
UnknownValidationError = Class.new(StandardError)
|
9
|
-
EmailNotFoundError = Class.new(StandardError)
|
10
|
-
NoAttachmentsError = Class.new(StandardError)
|
11
|
-
DriverNotSpecifiedError = Class.new(StandardError)
|
12
|
-
UnknownDriverError = Class.new(StandardError)
|
13
|
-
CloudBrowserNotSpecifiedError = Class.new(StandardError)
|
14
|
-
SelBrowserNotSpecifiedError = Class.new(StandardError)
|
15
|
-
UnknownBrowserError = Class.new(StandardError)
|
16
|
-
IncorrectPageError = Class.new(StandardError)
|
17
|
-
AmbiguousPageMatchingError = Class.new(StandardError)
|
18
|
-
NoMailAdapterError = Class.new(StandardError)
|
19
|
-
NoPathForPageError = Class.new(StandardError)
|
20
|
-
NoEmailSubjectError = Class.new(StandardError)
|
21
|
-
NoDataError = Class.new(StandardError)
|
22
|
-
UndefinedElementError = Class.new(StandardError)
|
23
|
-
UndefinedSexySettingError = Class.new(StandardError)
|
3
|
+
CommunicationError = Class.new(StandardError) # :nodoc:
|
4
|
+
ParseError = Class.new(StandardError) # :nodoc:
|
5
|
+
InvalidApiKeyError = Class.new(StandardError) # :nodoc:
|
6
|
+
BadElementParamsError = Class.new(StandardError) # :nodoc:
|
7
|
+
NoValidationError = Class.new(StandardError) # :nodoc:
|
8
|
+
UnknownValidationError = Class.new(StandardError) # :nodoc:
|
9
|
+
EmailNotFoundError = Class.new(StandardError) # :nodoc:
|
10
|
+
NoAttachmentsError = Class.new(StandardError) # :nodoc:
|
11
|
+
DriverNotSpecifiedError = Class.new(StandardError) # :nodoc:
|
12
|
+
UnknownDriverError = Class.new(StandardError) # :nodoc:
|
13
|
+
CloudBrowserNotSpecifiedError = Class.new(StandardError) # :nodoc:
|
14
|
+
SelBrowserNotSpecifiedError = Class.new(StandardError) # :nodoc:
|
15
|
+
UnknownBrowserError = Class.new(StandardError) # :nodoc:
|
16
|
+
IncorrectPageError = Class.new(StandardError) # :nodoc:
|
17
|
+
AmbiguousPageMatchingError = Class.new(StandardError) # :nodoc:
|
18
|
+
NoMailAdapterError = Class.new(StandardError) # :nodoc:
|
19
|
+
NoPathForPageError = Class.new(StandardError) # :nodoc:
|
20
|
+
NoEmailSubjectError = Class.new(StandardError) # :nodoc:
|
21
|
+
NoDataError = Class.new(StandardError) # :nodoc:
|
22
|
+
UndefinedElementError = Class.new(StandardError) # :nodoc:
|
23
|
+
UndefinedSexySettingError = Class.new(StandardError) # :nodoc:
|
24
24
|
end
|