howitzer 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +32 -0
- data/.travis.yml +1 -4
- data/.yardopts +1 -2
- data/CHANGELOG.md +28 -1
- data/Gemfile +6 -0
- data/LICENSE +1 -1
- data/README.md +55 -85
- data/Rakefile +7 -7
- data/bin/howitzer +56 -31
- data/features/cli_new.feature +162 -79
- data/features/cli_update.feature +114 -21
- data/features/step_definitions/common_steps.rb +29 -9
- data/features/support/env.rb +1 -1
- data/features/support/transformers.rb +2 -2
- data/generators/base_generator.rb +121 -49
- data/generators/config/config_generator.rb +8 -5
- data/generators/config/templates/boot.rb +14 -0
- data/generators/config/templates/capybara.rb +156 -0
- data/generators/config/templates/custom.yml +2 -3
- data/generators/config/templates/default.yml +50 -82
- data/generators/cucumber/cucumber_generator.rb +9 -9
- data/generators/cucumber/templates/common_steps.rb +4 -4
- data/generators/cucumber/templates/cucumber.rake +63 -54
- data/generators/cucumber/templates/env.rb +24 -23
- data/generators/cucumber/templates/transformers.rb +23 -15
- data/generators/emails/emails_generator.rb +4 -2
- data/generators/emails/templates/example_email.rb +4 -4
- data/generators/prerequisites/prerequisites_generator.rb +24 -0
- data/generators/prerequisites/templates/base.rb +22 -0
- data/generators/prerequisites/templates/factory_girl.rb +30 -0
- data/generators/prerequisites/templates/user.rb +7 -0
- data/generators/prerequisites/templates/users.rb +12 -0
- data/generators/root/root_generator.rb +11 -7
- data/generators/root/templates/.rubocop.yml +32 -0
- data/generators/root/templates/Gemfile.erb +27 -0
- data/generators/root/templates/Rakefile +6 -8
- data/generators/rspec/rspec_generator.rb +7 -7
- data/generators/rspec/templates/example_spec.rb +1 -1
- data/generators/rspec/templates/rspec.rake +48 -29
- data/generators/rspec/templates/spec_helper.rb +33 -32
- data/generators/tasks/tasks_generator.rb +4 -2
- data/generators/tasks/templates/common.rake +1 -16
- data/generators/turnip/templates/.rspec +1 -0
- data/generators/turnip/templates/common_steps.rb +25 -0
- data/generators/turnip/templates/example.feature +8 -0
- data/generators/turnip/templates/spec_helper.rb +56 -0
- data/generators/turnip/templates/turnip.rake +61 -0
- data/generators/turnip/templates/turnip_helper.rb +6 -0
- data/generators/turnip/turnip_generator.rb +26 -0
- data/generators/web/templates/example_page.rb +15 -0
- data/generators/web/templates/menu_section.rb +13 -0
- data/generators/web/web_generator.rb +22 -0
- data/howitzer.gemspec +14 -21
- data/lib/howitzer.rb +47 -7
- data/lib/howitzer/cache.rb +70 -0
- data/lib/howitzer/capybara_helpers.rb +194 -0
- data/lib/howitzer/email.rb +96 -104
- data/lib/howitzer/exceptions.rb +10 -6
- data/lib/howitzer/log.rb +120 -0
- data/lib/howitzer/mail_adapters.rb +7 -0
- data/lib/howitzer/mail_adapters/abstract.rb +84 -0
- data/lib/howitzer/mail_adapters/mailgun.rb +115 -0
- data/lib/howitzer/mailgun_api.rb +9 -0
- data/lib/howitzer/mailgun_api/client.rb +79 -0
- data/lib/howitzer/mailgun_api/connector.rb +37 -0
- data/lib/howitzer/mailgun_api/response.rb +28 -0
- data/lib/howitzer/tasks/framework.rake +2 -2
- data/lib/howitzer/utils.rb +7 -1
- data/lib/howitzer/utils/string_extensions.rb +66 -0
- data/lib/howitzer/version.rb +2 -1
- data/lib/howitzer/web.rb +11 -0
- data/lib/howitzer/web/base_section.rb +27 -0
- data/lib/howitzer/web/blank_page.rb +12 -0
- data/lib/howitzer/web/capybara_methods_proxy.rb +29 -0
- data/lib/howitzer/web/element_dsl.rb +109 -0
- data/lib/howitzer/web/iframe_dsl.rb +93 -0
- data/lib/howitzer/web/page.rb +173 -0
- data/lib/howitzer/web/page_dsl.rb +64 -0
- data/lib/howitzer/web/page_validator.rb +118 -0
- data/lib/howitzer/web/section.rb +27 -0
- data/lib/howitzer/web/section_dsl.rb +154 -0
- data/spec/config/custom.yml +10 -1
- data/spec/spec_helper.rb +37 -19
- data/spec/support/generator_helper.rb +12 -11
- data/spec/support/logger_helper.rb +10 -9
- data/spec/support/mailgun_unit_client.rb +52 -44
- data/spec/support/shared_examples/capybara_context_holder.rb +33 -0
- data/spec/support/shared_examples/capybara_methods_proxy.rb +94 -0
- data/spec/support/shared_examples/dynamic_section_methods.rb +35 -0
- data/spec/support/shared_examples/element_dsl.rb +119 -0
- data/spec/unit/generators/base_generator_spec.rb +64 -33
- data/spec/unit/generators/config_generator_spec.rb +11 -7
- data/spec/unit/generators/cucumber_generator_spec.rb +26 -17
- data/spec/unit/generators/emails_generator_spec.rb +10 -6
- data/spec/unit/generators/prerequisites_generator_spec.rb +53 -0
- data/spec/unit/generators/root_generator_spec.rb +50 -13
- data/spec/unit/generators/rspec_generator_spec.rb +9 -9
- data/spec/unit/generators/tasks_generator_spec.rb +6 -6
- data/spec/unit/generators/turnip_generator_spec.rb +52 -0
- data/spec/unit/generators/web_generator_spec.rb +52 -0
- data/spec/unit/lib/cache_spec.rb +85 -0
- data/spec/unit/lib/capybara_helpers_spec.rb +696 -0
- data/spec/unit/lib/email_spec.rb +104 -91
- data/spec/unit/lib/howitzer.rb +31 -0
- data/spec/unit/lib/init_spec.rb +0 -1
- data/spec/unit/lib/log_spec.rb +122 -0
- data/spec/unit/lib/mail_adapters/abstract_spec.rb +62 -0
- data/spec/unit/lib/mail_adapters/mailgun_spec.rb +163 -0
- data/spec/unit/lib/mailgun_api/client_spec.rb +58 -0
- data/spec/unit/lib/mailgun_api/connector_spec.rb +54 -0
- data/spec/unit/lib/mailgun_api/response_spec.rb +28 -0
- data/spec/unit/lib/utils/string_extensions_spec.rb +77 -0
- data/spec/unit/lib/web/base_section_spec.rb +41 -0
- data/spec/unit/lib/web/element_dsl_spec.rb +17 -0
- data/spec/unit/lib/web/iframe_dsl_spec.rb +99 -0
- data/spec/unit/lib/web/page_dsl_spec.rb +52 -0
- data/spec/unit/lib/web/page_spec.rb +304 -0
- data/spec/unit/lib/web/page_validator_spec.rb +218 -0
- data/spec/unit/lib/web/section_dsl_spec.rb +165 -0
- data/spec/unit/lib/web/section_spec.rb +61 -0
- data/spec/unit/version_spec.rb +1 -1
- metadata +116 -203
- data/GETTING_STARTED.md +0 -774
- data/generators/cucumber/templates/cucumber.yml +0 -10
- data/generators/pages/pages_generator.rb +0 -21
- data/generators/pages/templates/example_menu.rb +0 -15
- data/generators/pages/templates/example_page.rb +0 -15
- data/generators/root/templates/Gemfile +0 -7
- data/generators/root/templates/boot.rb +0 -10
- data/lib/howitzer/blank_page.rb +0 -6
- data/lib/howitzer/capybara/dsl_ex.rb +0 -15
- data/lib/howitzer/capybara/settings.rb +0 -343
- data/lib/howitzer/helpers.rb +0 -230
- data/lib/howitzer/init.rb +0 -1
- data/lib/howitzer/mailgun/client.rb +0 -65
- data/lib/howitzer/mailgun/connector.rb +0 -34
- data/lib/howitzer/mailgun/response.rb +0 -28
- data/lib/howitzer/patches/rawler_patched.rb +0 -86
- data/lib/howitzer/settings.rb +0 -27
- data/lib/howitzer/utils/data_generator/data_storage.rb +0 -88
- data/lib/howitzer/utils/data_generator/gen.rb +0 -135
- data/lib/howitzer/utils/locator_store.rb +0 -217
- data/lib/howitzer/utils/log.rb +0 -139
- data/lib/howitzer/utils/page_validator.rb +0 -133
- data/lib/howitzer/vendor/firebug-1.12.1-fx.xpi +0 -0
- data/lib/howitzer/vendor/firepath-0.9.7-fx.xpi +0 -0
- data/lib/howitzer/web_page.rb +0 -253
- data/spec/active_resource.rb +0 -0
- data/spec/config/default.yml +0 -26
- data/spec/support/boot_helper.rb +0 -15
- data/spec/unit/generators/pages_generator_spec.rb +0 -33
- data/spec/unit/lib/capybara/dsl_ex_spec.rb +0 -60
- data/spec/unit/lib/capybara/settings_spec.rb +0 -441
- data/spec/unit/lib/helpers_spec.rb +0 -1129
- data/spec/unit/lib/mailgun/client_spec.rb +0 -36
- data/spec/unit/lib/mailgun/connector_spec.rb +0 -70
- data/spec/unit/lib/mailgun/response_spec.rb +0 -28
- data/spec/unit/lib/settings_spec.rb +0 -17
- data/spec/unit/lib/utils/data_generator/data_storage_spec.rb +0 -80
- data/spec/unit/lib/utils/data_generator/gen_spec.rb +0 -90
- data/spec/unit/lib/utils/locator_store_spec.rb +0 -157
- data/spec/unit/lib/utils/log_spec.rb +0 -107
- data/spec/unit/lib/utils/page_validator_spec.rb +0 -265
- data/spec/unit/lib/web_page_spec.rb +0 -346
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3377af22722ffdd00c6ec6067a03d035550efa2
|
4
|
+
data.tar.gz: 1ddd61bd420afbd578e960f8056e1ccdd3efb261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38792fab666d6b97c8b638214901522d2c2f75862619ef0afa64dc8d73df4dc85403b1366c7921eaf5f31c9048091f00d25b734fd619aa4d77d405fb357362f
|
7
|
+
data.tar.gz: 5f5a2b10f02da32f4d618f1192ce380a246998a2fa4cdd8692d12830ef2d2f62e6fea36b0a1d63c80c0cb905a3d80ae46a10fd4ba7b46ffd4971c72546afba28
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# See full list of defaults here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
|
2
|
+
# To see all cops used see here: https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
|
3
|
+
|
4
|
+
AllCops:
|
5
|
+
TargetRubyVersion: 2.3
|
6
|
+
|
7
|
+
LineLength:
|
8
|
+
Max: 120
|
9
|
+
|
10
|
+
Style/CaseIndentation:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/EmptyElse:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Lint/AmbiguousRegexpLiteral:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Style/CaseEquality:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
MethodLength:
|
23
|
+
Max: 30
|
24
|
+
|
25
|
+
Style/TrivialAccessors:
|
26
|
+
AllowDSLWriters: true
|
27
|
+
|
28
|
+
Style/FrozenStringLiteralComment:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Metrics/ModuleLength:
|
32
|
+
Max: 150
|
data/.travis.yml
CHANGED
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,36 @@
|
|
1
|
-
## [In git](https://github.com/strongqa/howitzer/compare/
|
1
|
+
## [In git](https://github.com/strongqa/howitzer/compare/v2.0.0...master)
|
2
2
|
|
3
3
|
### New Features
|
4
4
|
|
5
5
|
### Bugfixes
|
6
6
|
|
7
|
+
## [v2.0.0](https://github.com/strongqa/howitzer/compare/v1.1.1...v2.0.0)
|
8
|
+
|
9
|
+
### New Features
|
10
|
+
- Added REST API prerequisites with FactoryGirl
|
11
|
+
- Added Turnip supporting
|
12
|
+
- Restricted using several bdd frameworks at the same time
|
13
|
+
- Removed Opera browser supporting
|
14
|
+
- Integrated Rubocop
|
15
|
+
- Stopped Ruby supporting less than v2.2.2
|
16
|
+
- Introduced /web folder for page object elements
|
17
|
+
- Moved capybara settings to framework side
|
18
|
+
- Integrated Capybara screenshots
|
19
|
+
- Renamed and restructured default settings
|
20
|
+
- Placed everything to own namespace
|
21
|
+
- Introduced "subject" dsl method for emails
|
22
|
+
- Moved framework dependent libraries from the gem
|
23
|
+
- Introduced common tag groups for all BDD frameworks
|
24
|
+
- Stopped Rawler supporting
|
25
|
+
- Reimplemented page dsl methods from scratch
|
26
|
+
- Introduced sections and iframes
|
27
|
+
- Introduced email adapters
|
28
|
+
- Stopped supporting of output to txt file
|
29
|
+
- Removed raising error on log.error
|
30
|
+
- Removed locator storage
|
31
|
+
- Prevented capybara form dsl method usage
|
32
|
+
- Introduced new Page.on method
|
33
|
+
|
7
34
|
## [v1.1.1](https://github.com/strongqa/howitzer/compare/v1.1.0...v1.1.1)
|
8
35
|
|
9
36
|
### Bugfixes
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,52 +1,50 @@
|
|
1
|
-
|
1
|
+
<p align="center" style="overflow: hidden;">
|
2
|
+
<a href="http://howitzer-framework.io">
|
3
|
+
<img src="https://raw.githubusercontent.com/strongqa/howitzer/gh-pages/images/howitzer-logo.png" alt="Howitzer" />
|
4
|
+
</a>
|
5
|
+
<br/>
|
2
6
|
|
3
|
-
|
4
|
-
[![Gem Version](http://img.shields.io/gem/v/howitzer.svg)][gem]
|
5
|
-
[![Build Status](https://travis-ci.org/strongqa/howitzer.svg?branch=master)][travis]
|
6
|
-
[![Dependency Status](https://gemnasium.com/strongqa/howitzer.svg)][gemnasium]
|
7
|
-
[![Code Climate](https://codeclimate.com/github/romikoops/howitzer.png)][codeclimate]
|
8
|
-
[![Coverage Status](https://coveralls.io/repos/strongqa/howitzer/badge.png?branch=master)][coveralls]
|
9
|
-
[![License](http://img.shields.io/badge/license-MIT-blue.svg)][license]
|
7
|
+
<p align="center"><b>Ruby-based framework for acceptance testing of web applications.</b></p>
|
10
8
|
|
11
|
-
|
12
|
-
[travis]: https://travis-ci.org/strongqa/howitzer
|
13
|
-
[gemnasium]: https://gemnasium.com/strongqa/howitzer
|
14
|
-
[codeclimate]: https://codeclimate.com/github/romikoops/howitzer
|
15
|
-
[coveralls]: https://coveralls.io/r/strongqa/howitzer?branch=master
|
16
|
-
[license]: https://github.com/strongqa/howitzer/blob/master/LICENSE
|
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>
|
17
10
|
|
18
|
-
|
11
|
+
<p align="center">
|
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>
|
15
|
+
<a href='https://gemnasium.com/strongqa/howitzer'><img src="https://gemnasium.com/strongqa/howitzer.svg" /></a>
|
16
|
+
<a href="https://codeclimate.com/github/strongqa/howitzer"><img src="https://codeclimate.com/github/strongqa/howitzer.png" /></a>
|
17
|
+
<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>
|
18
|
+
<a href="https://github.com/strongqa/howitzer/blob/master/LICENSE"><img src="http://img.shields.io/badge/license-MIT-blue.svg" /></a>
|
19
|
+
</p>
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
The framework was built with modern patterns, techniques, and tools in automated testing. For details, please see [Test Framework Design](https://github.com/strongqa/howitzer/wiki/Test-Framework-Design).
|
21
|
+
</p>
|
23
22
|
|
24
23
|
## Key Benefits
|
25
|
-
- Independent of
|
26
|
-
- Fast installation of the complete testing infrastructure (takes less than 5 minutes).
|
27
|
-
-
|
28
|
-
- Possibility to choose
|
24
|
+
- Independent of a web application technical stack, language and architecture.
|
25
|
+
- Fast installation and configuration of the complete testing infrastructure (takes less than 5 minutes).
|
26
|
+
- Elegant, intuitive and powerful Ruby language underneath.
|
27
|
+
- Possibility to choose your favorite BDD tool (Cucumber, RSpec or Turnip).
|
29
28
|
- Integration with SauceLabs, Testingbot, BrowserStack and MailGun web services.
|
30
|
-
- Easy tests support.
|
29
|
+
- Easy tests support based on the best patterns, techniques, principles.
|
31
30
|
- Ability to execute tests against to both browserless driver and actual browsers with no changes in your tests.
|
32
|
-
- Searches for broken links.
|
33
|
-
|
34
31
|
|
35
32
|
## Documentation
|
36
|
-
Refer to the [GETTING STARTED](http://
|
33
|
+
Refer to the [GETTING STARTED](http://docs.howitzer-framework.io) document to start working with *Howitzer*.
|
37
34
|
|
38
35
|
You can also find the Rdoc documentation on [Rubygems](https://rubygems.org/gems/howitzer).
|
39
36
|
|
40
37
|
## Related Products
|
41
|
-
* [Howitzer Example](https://github.com/strongqa/
|
42
|
-
* [Howitzer
|
38
|
+
* [Howitzer Example RSpec](https://github.com/strongqa/howitzer_example_rspec) – an example of Howitzer based project for demo web application based on RSpec.
|
39
|
+
* [Howitzer Example Cucumber](https://github.com/strongqa/howitzer_example_cucumber) – an example of Howitzer based project for demo web application based on Cucumber.
|
40
|
+
* [Howitzer Example Turnip](https://github.com/strongqa/howitzer_example_turnip) – an example of Howitzer based project for demo web application based on Turnip.
|
43
41
|
|
44
42
|
## Requirements
|
45
43
|
* Supported OS: Mac OS X, Linux, Windows
|
46
|
-
* [Ruby](https://www.ruby-lang.org/en/downloads/)
|
44
|
+
* [Ruby](https://www.ruby-lang.org/en/downloads/) 2.2.2+
|
47
45
|
* [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions) (For **Windows** only)
|
48
|
-
* [PhantomJS](http://phantomjs.org/download.html)
|
49
|
-
* [ChromeDriver](https://
|
46
|
+
* [PhantomJS](http://phantomjs.org/download.html) (For **phantomjs** and **poltergeist** drivers only)
|
47
|
+
* [ChromeDriver](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver)
|
50
48
|
* [QT](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit) (For **webkit** driver only)
|
51
49
|
|
52
50
|
## Setup
|
@@ -59,47 +57,22 @@ gem install howitzer
|
|
59
57
|
## Usage
|
60
58
|
Browse to a desired directory where a new project will be created.
|
61
59
|
|
62
|
-
To
|
60
|
+
To generate the project with [Cucumber](https://cucumber.io/), type:
|
63
61
|
|
64
62
|
```bash
|
65
63
|
howitzer new <PROJECT NAME> --cucumber
|
66
64
|
```
|
67
65
|
|
68
|
-
|
69
|
-
```
|
70
|
-
config/
|
71
|
-
cucumber.yml
|
72
|
-
default.yml
|
73
|
-
custom.yml
|
74
|
-
tasks/
|
75
|
-
common.rake
|
76
|
-
cucumber.rake
|
77
|
-
rspec.rake
|
78
|
-
emails/
|
79
|
-
example_email.rb
|
80
|
-
features/
|
81
|
-
support/env.rb
|
82
|
-
step_definitions/common_steps.rb
|
83
|
-
example.feature
|
84
|
-
pages/
|
85
|
-
example_page.rb
|
86
|
-
example_menu.rb
|
87
|
-
boot.rb
|
88
|
-
Gemfile
|
89
|
-
Rakefile
|
90
|
-
.gitignore
|
91
|
-
```
|
92
|
-
|
93
|
-
With Rspec:
|
66
|
+
With [Rspec](http://rspec.info/):
|
94
67
|
|
95
68
|
```bash
|
96
69
|
howitzer new <PROJECT NAME> --rspec
|
97
70
|
```
|
98
71
|
|
99
|
-
With
|
72
|
+
With [Turnip](https://github.com/jnicklas/turnip):
|
100
73
|
|
101
74
|
```bash
|
102
|
-
howitzer new <PROJECT NAME> --
|
75
|
+
howitzer new <PROJECT NAME> --turnip
|
103
76
|
```
|
104
77
|
|
105
78
|
**Configuration**
|
@@ -108,19 +81,26 @@ Learn and specify correct default settings in the `config/default.yml` file. For
|
|
108
81
|
|
109
82
|
## Test Implementation Workflow
|
110
83
|
|
111
|
-
- Prepare
|
112
|
-
-
|
113
|
-
- Implement
|
84
|
+
- Prepare BDD feature with scenarios
|
85
|
+
- Mark feature/scenarios with priority tags.
|
86
|
+
- Implement prerequisites generation (optional):
|
87
|
+
* implement factories
|
88
|
+
* implement models
|
89
|
+
- Implement appropriate pages in the `web/pages` folder. For details, refer to [Page Object Pattern](https://github.com/strongqa/howitzer/wiki/PageObject-pattern).
|
90
|
+
- Implement emails in `emails` folder (optional).
|
114
91
|
- Implement scenarios:
|
115
92
|
* For Cucumber:
|
116
93
|
1. Read and learn [Cucumber Best Practices](https://github.com/strongqa/howitzer/wiki/Cucumber-Best-Practices)
|
117
|
-
2. Implement step definitions in the `features/step_definitions
|
94
|
+
2. Implement step definitions in the `features/step_definitions` folder.
|
118
95
|
* For Rspec: Use [DSL](https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec/features.rb) provided by Capybara to create descriptive acceptance tests.
|
119
|
-
|
96
|
+
* For Turnip: Implement step definitions in the `spec/steps` folder.
|
97
|
+
- Debug features against to desired drivers.
|
120
98
|
- Enjoy it!
|
121
99
|
|
122
100
|
## Rake Tasks
|
123
101
|
|
102
|
+
[Rake](https://ruby.github.io/rake/) was originally created to handle software build processes, but the combination of convenience and flexibility that it provides has made it the standard method of job automation for Ruby projects.
|
103
|
+
|
124
104
|
You can get a list of all available tasks by typing the following command:
|
125
105
|
|
126
106
|
```bash
|
@@ -131,25 +111,15 @@ rake -T
|
|
131
111
|
## Upgrading Howitzer
|
132
112
|
Before attempting to upgrade an existing project, you should be sure you have a good reason to upgrade. You need to balance several factors: the need for new features, the increasing difficulty of finding support for old code, and your available time and skills, to name a few.
|
133
113
|
|
134
|
-
From version _v1.1.0_ howitzer provides **howitzer update** command. After updating the Howitzer version in the Gemfile, run
|
114
|
+
From version _v1.1.0_ howitzer provides **howitzer update** command. After updating the Howitzer version in the Gemfile, run following commands:
|
135
115
|
|
136
116
|
```
|
137
|
-
|
138
|
-
|
139
|
-
Identical 'config/custom.yml' file
|
140
|
-
Added 'config/default.yml' file
|
141
|
-
* Root files generation ...
|
142
|
-
Added '.gitignore' file
|
143
|
-
Conflict with 'Gemfile' file
|
144
|
-
Overwrite 'Gemfile' file? [Yn]:Y
|
145
|
-
Forced 'Gemfile' file
|
146
|
-
Identical 'Rakefile' file
|
147
|
-
Conflict with 'boot.rb' file
|
148
|
-
Overwrite 'boot.rb' file? [Yn]:n
|
149
|
-
Skipped 'boot.rb' file
|
150
|
-
|
151
|
-
...
|
117
|
+
bundle update howitzer
|
118
|
+
bundle exec howitzer update
|
152
119
|
```
|
120
|
+
|
121
|
+
This will help you with the creation of new files and changes of old files in an interactive session.
|
122
|
+
|
153
123
|
Don't forget to review the difference, to see if there were any unexpected changes and merge them. It is easy if your project is under revision control systems like _Git_.
|
154
124
|
|
155
125
|
## Additional Information
|
@@ -161,7 +131,7 @@ Don't forget to review the difference, to see if there were any unexpected chang
|
|
161
131
|
Contributing
|
162
132
|
------------
|
163
133
|
|
164
|
-
Please see [CONTRIBUTING.md](
|
134
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
165
135
|
|
166
136
|
howitzer was originally designed by Roman Parashchenko and is now maintained by StrongQA team. You can find list of contributors here [open source
|
167
137
|
community](https://github.com/strongqa/howitzer/graphs/contributors).
|
@@ -169,14 +139,14 @@ community](https://github.com/strongqa/howitzer/graphs/contributors).
|
|
169
139
|
License
|
170
140
|
-------
|
171
141
|
|
172
|
-
howitzer is Copyright © 2012-
|
142
|
+
howitzer is Copyright © 2012-2016 Roman Parashchenko and StrongQA Ltd. It is free
|
173
143
|
software, and may be redistributed under the terms specified in the
|
174
|
-
[LICENSE](
|
144
|
+
[LICENSE](LICENSE) file.
|
175
145
|
|
176
146
|
About StrongQA
|
177
147
|
----------------
|
178
148
|
|
179
|
-
![StrongQA](
|
149
|
+
![StrongQA](https://github.com/strongqa/howitzer/blob/gh-pages/images/strongqa-logo.png)
|
180
150
|
|
181
151
|
howitzer is maintained and funded by StrongQA, Ltd.
|
182
152
|
The names and logos for StrongQA are trademarks of StrongQA, Ltd.
|
data/Rakefile
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require
|
2
|
+
require 'bundler'
|
3
3
|
Bundler.setup
|
4
4
|
|
5
5
|
require 'rake'
|
6
6
|
require 'yard'
|
7
7
|
require 'rspec/core/rake_task'
|
8
8
|
require 'cucumber/rake/task'
|
9
|
+
require 'rubocop/rake_task'
|
10
|
+
|
9
11
|
Bundler::GemHelper.install_tasks
|
10
|
-
RSpec::Core::RakeTask.new(:spec) { |
|
12
|
+
RSpec::Core::RakeTask.new(:spec) { |_spec| }
|
11
13
|
|
12
14
|
Cucumber::Rake::Task.new(:cucumber, 'Run all cucumber features') do |t|
|
13
15
|
t.fork = false
|
14
16
|
end
|
15
17
|
|
16
|
-
|
17
|
-
task(all_tests: [:spec, :cucumber]) {}
|
18
|
+
YARD::Rake::YardocTask.new { |_t| }
|
18
19
|
|
19
|
-
|
20
|
-
end
|
20
|
+
RuboCop::RakeTask.new
|
21
21
|
|
22
|
-
task :
|
22
|
+
task default: [:rubocop, :spec, :cucumber]
|
data/bin/howitzer
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require 'gli'
|
3
3
|
require_relative '../lib/howitzer/version'
|
4
4
|
|
5
|
+
# Howitzer Command line interface
|
5
6
|
module HowitzerCli
|
6
|
-
|
7
7
|
extend GLI::App
|
8
8
|
synopsis_format :compact
|
9
9
|
program_desc 'Ruby based framework for acceptance testing'
|
@@ -13,30 +13,39 @@ module HowitzerCli
|
|
13
13
|
arg_name '<PROJECT NAME>'
|
14
14
|
command :new do |c|
|
15
15
|
c.desc 'Integrate Cucumber'
|
16
|
-
c.switch [:c, :cucumber]
|
16
|
+
c.switch [:c, :cucumber], negatable: false
|
17
17
|
|
18
18
|
c.desc 'Integrate Rspec'
|
19
19
|
c.switch [:r, :rspec], negatable: false
|
20
20
|
|
21
|
-
c.
|
22
|
-
|
21
|
+
c.desc 'Integrate Turnip'
|
22
|
+
c.switch [:t, :turnip], negatable: false
|
23
|
+
|
24
|
+
c.action do |_global_options, options, args|
|
25
|
+
if !args.empty?
|
23
26
|
validate_options(options)
|
24
27
|
load_generators
|
25
28
|
path_to_dir = File.join(Dir.pwd, args.first)
|
26
|
-
puts
|
29
|
+
puts ' * New project directory creation ...'
|
27
30
|
Dir.mkdir(path_to_dir)
|
28
31
|
puts " Created new './#{args.first}' folder"
|
29
32
|
Dir.chdir(path_to_dir)
|
30
|
-
Howitzer::ConfigGenerator.new
|
31
|
-
Howitzer::
|
32
|
-
Howitzer::TasksGenerator.new
|
33
|
-
Howitzer::EmailsGenerator.new
|
34
|
-
Howitzer::RootGenerator.new
|
35
|
-
Howitzer::
|
36
|
-
|
37
|
-
|
33
|
+
Howitzer::ConfigGenerator.new(options)
|
34
|
+
Howitzer::WebGenerator.new(options)
|
35
|
+
Howitzer::TasksGenerator.new(options)
|
36
|
+
Howitzer::EmailsGenerator.new(options)
|
37
|
+
Howitzer::RootGenerator.new(options)
|
38
|
+
Howitzer::PrerequisitesGenerator.new(options)
|
39
|
+
if options[:cucumber]
|
40
|
+
Howitzer::CucumberGenerator.new(options)
|
41
|
+
elsif options[:rspec]
|
42
|
+
Howitzer::RspecGenerator.new(options)
|
43
|
+
elsif options['turnip']
|
44
|
+
Howitzer::TurnipGenerator.new(options)
|
45
|
+
end
|
46
|
+
puts '[WARN] Extra parameters were skipped' if args.size > 1
|
38
47
|
elsif args.size.zero?
|
39
|
-
exit_now!(
|
48
|
+
exit_now!('Please specify <PROJECT NAME>', 64)
|
40
49
|
end
|
41
50
|
end
|
42
51
|
end
|
@@ -44,22 +53,34 @@ module HowitzerCli
|
|
44
53
|
desc 'Upgrade existing project'
|
45
54
|
command :update do |c|
|
46
55
|
c.action do
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
56
|
+
check_project_presence
|
57
|
+
load_generators
|
58
|
+
Howitzer::ConfigGenerator.new
|
59
|
+
Howitzer::WebGenerator.new
|
60
|
+
Howitzer::TasksGenerator.new
|
61
|
+
Howitzer::EmailsGenerator.new
|
62
|
+
Howitzer::PrerequisitesGenerator.new
|
63
|
+
if cucumber_integrated?
|
64
|
+
Howitzer::RootGenerator.new(cucumber: true)
|
65
|
+
Howitzer::CucumberGenerator.new
|
66
|
+
elsif rspec_integrated?
|
67
|
+
Howitzer::RootGenerator.new(rspec: true)
|
68
|
+
Howitzer::RspecGenerator.new
|
69
|
+
elsif turnip_integrated?
|
70
|
+
Howitzer::RootGenerator.new(turnip: true)
|
71
|
+
Howitzer::TurnipGenerator.new
|
72
|
+
end
|
53
73
|
end
|
54
74
|
end
|
55
75
|
|
56
|
-
#helpers
|
76
|
+
# helpers
|
57
77
|
class << self
|
58
78
|
private
|
79
|
+
|
59
80
|
def validate_options(options)
|
60
|
-
if
|
61
|
-
|
62
|
-
|
81
|
+
return if [options[:cucumber], options[:rspec], options[:turnip]].count { |el| el } == 1
|
82
|
+
|
83
|
+
exit_now!('Provide --cucumber, --rspec or --turnip option', 64)
|
63
84
|
end
|
64
85
|
|
65
86
|
def check_project_presence
|
@@ -67,23 +88,27 @@ module HowitzerCli
|
|
67
88
|
end
|
68
89
|
|
69
90
|
def howitzer_project?
|
70
|
-
Dir.
|
91
|
+
(Dir.exist?('web') || Dir.exist?('pages')) && Dir.exist?('config')
|
71
92
|
end
|
72
93
|
|
73
94
|
def load_generators
|
74
|
-
Dir[
|
95
|
+
Dir[
|
96
|
+
File.join(__dir__, '..', 'generators', '**', '*_generator.rb')
|
97
|
+
].each { |f| require File.expand_path(f) }
|
75
98
|
end
|
76
99
|
|
77
100
|
def cucumber_integrated?
|
78
|
-
Dir.
|
101
|
+
Dir.exist?('features')
|
79
102
|
end
|
80
103
|
|
81
104
|
def rspec_integrated?
|
82
|
-
|
105
|
+
File.exist?('spec/spec_helper.rb') && !File.exist?('spec/turnip_helper.rb')
|
106
|
+
end
|
107
|
+
|
108
|
+
def turnip_integrated?
|
109
|
+
File.exist?('spec/spec_helper.rb') && File.exist?('spec/turnip_helper.rb')
|
83
110
|
end
|
84
111
|
end
|
85
112
|
end
|
86
113
|
|
87
|
-
unless ENV['TEST_MODE']
|
88
|
-
exit(HowitzerCli.run(ARGV))
|
89
|
-
end
|
114
|
+
exit(HowitzerCli.run(ARGV)) unless ENV['TEST_MODE']
|