howitzer 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -1
- data/.travis.yml +3 -2
- data/CHANGELOG.md +25 -5
- data/GETTING_STARTED.md +158 -13
- data/README.md +49 -32
- data/Rakefile +10 -1
- data/bin/howitzer +49 -78
- data/features/cli_help.feature +30 -0
- data/features/cli_new.feature +263 -0
- data/features/cli_unknown.feature +17 -0
- data/features/cli_version.feature +14 -0
- data/features/step_definitions/common_steps.rb +1 -0
- data/features/support/env.rb +1 -0
- data/features/support/transformers.rb +3 -0
- data/generators/base_generator.rb +2 -0
- data/generators/config/config_generator.rb +1 -1
- data/generators/config/templates/default.yml +4 -14
- data/generators/cucumber/cucumber_generator.rb +1 -1
- data/generators/cucumber/templates/cucumber.yml +1 -2
- data/generators/cucumber/templates/env.rb +8 -7
- data/generators/emails/emails_generator.rb +1 -1
- data/generators/pages/pages_generator.rb +1 -1
- data/generators/pages/templates/example_page.rb +2 -2
- data/generators/root/root_generator.rb +1 -1
- data/generators/root/templates/Gemfile +1 -1
- data/generators/rspec/rspec_generator.rb +1 -1
- data/generators/rspec/templates/example_spec.rb +2 -2
- data/generators/rspec/templates/rspec.rake +1 -1
- data/generators/rspec/templates/spec_helper.rb +6 -5
- data/generators/tasks/tasks_generator.rb +1 -1
- data/generators/tasks/templates/common.rake +1 -0
- data/howitzer.gemspec +8 -8
- data/lib/howitzer.rb +4 -1
- data/lib/howitzer/blank_page.rb +6 -0
- data/lib/howitzer/capybara/dsl_ex.rb +15 -0
- data/lib/howitzer/capybara/settings.rb +267 -0
- data/lib/howitzer/email.rb +134 -0
- data/lib/howitzer/exceptions.rb +18 -0
- data/lib/howitzer/helpers.rb +34 -23
- data/lib/howitzer/init.rb +1 -4
- data/lib/howitzer/mailgun/client.rb +48 -0
- data/lib/howitzer/mailgun/connector.rb +34 -0
- data/lib/howitzer/mailgun/response.rb +28 -0
- data/lib/howitzer/utils.rb +2 -2
- data/lib/howitzer/utils/data_generator/data_storage.rb +15 -2
- data/lib/howitzer/utils/data_generator/gen.rb +14 -10
- data/lib/howitzer/utils/locator_store.rb +14 -7
- data/lib/howitzer/utils/log.rb +2 -0
- data/lib/howitzer/utils/page_validator.rb +74 -27
- data/lib/howitzer/version.rb +1 -1
- data/lib/howitzer/web_page.rb +83 -32
- data/spec/config/default.yml +10 -12
- data/spec/spec_helper.rb +12 -0
- data/spec/support/mailgun_unit_client.rb +60 -0
- data/spec/unit/generators/generators_spec.rb +7 -7
- data/spec/unit/lib/capybara/dsl_ex_spec.rb +60 -0
- data/spec/unit/lib/{capybara_settings_spec.rb → capybara/settings_spec.rb} +16 -10
- data/spec/unit/lib/email_spec.rb +129 -0
- data/spec/unit/lib/helpers_spec.rb +160 -34
- data/spec/unit/lib/init_spec.rb +1 -12
- data/spec/unit/lib/mailgun/client_spec.rb +36 -0
- data/spec/unit/lib/mailgun/connector_spec.rb +70 -0
- data/spec/unit/lib/mailgun/response_spec.rb +29 -0
- data/spec/unit/lib/utils/data_generator/data_storage_spec.rb +23 -5
- data/spec/unit/lib/utils/data_generator/gen_spec.rb +2 -63
- data/spec/unit/lib/utils/locator_store_spec.rb +41 -6
- data/spec/unit/lib/utils/log_spec.rb +1 -1
- data/spec/unit/lib/utils/page_validator_spec.rb +149 -25
- data/spec/unit/lib/web_page_spec.rb +127 -53
- metadata +102 -142
- data/lib/howitzer/utils/capybara_patched.rb +0 -23
- data/lib/howitzer/utils/capybara_settings.rb +0 -247
- data/lib/howitzer/utils/email/email.rb +0 -85
- data/lib/howitzer/utils/email/mail_client.rb +0 -132
- data/lib/howitzer/utils/email/mailgun.rb +0 -175
- data/lib/howitzer/utils/email/mailgun_helper.rb +0 -61
- data/spec/unit/bin/howitzer_spec.rb +0 -175
- data/spec/unit/lib/utils/email/email_spec.rb +0 -75
- data/spec/unit/lib/utils/email/mail_client_spec.rb +0 -115
- data/spec/unit/lib/utils/email/mailgun_helper_spec.rb +0 -95
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1ccf5128e9fd63e0b38181fb268f299e7fce85b5
|
4
|
+
data.tar.gz: 7673a8839534fa1b4e66857b3c5ece195564637f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5a38c6ce3b3c19ddd8479290fc106fd248ea8746938fb8fd5efae051b5a3fe404007b41504f6d701b48d3ee44d1ca53a1326d7da4c220f62cd5d6753d95535c8
|
7
|
+
data.tar.gz: f53c4432a9ebe7407ea49b53b978370b6d7bfa790ce3ebee55c3591897800156beaf3c810ed3a51817fd22087ce8998cbf3fc9a9f91cf88adeb1dcc4df426c6d
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,23 +1,43 @@
|
|
1
|
-
## In git
|
1
|
+
## [In git](https://github.com/strongqa/howitzer/compare/master...develop)
|
2
2
|
|
3
3
|
### New Features
|
4
4
|
|
5
5
|
### Bugfixes
|
6
6
|
|
7
|
-
## [v1.0.
|
7
|
+
## [v1.0.2](https://github.com/strongqa/howitzer/compare/v1.0.1...v1.0.2)
|
8
|
+
|
9
|
+
### New Features
|
10
|
+
- Added Ruby 2.1 supporting
|
11
|
+
- Added Windows Supporting
|
12
|
+
- Improved project documentation
|
13
|
+
- Simplified new project creation
|
14
|
+
- Rewritten Mailgun integration to support Fabruary changes
|
15
|
+
- Created [Howitzer_example](https://github.com/strongqa/howitzer_example)
|
16
|
+
- Moved from personal github account to organization
|
17
|
+
- Added supporting of native selenium phantomjs driver
|
18
|
+
- Implemented smart page identification
|
19
|
+
- Rewritten command line interface and covered by acceptance tests fully
|
20
|
+
- Simplified DataStorage clearing after each tests
|
21
|
+
|
22
|
+
### Bugfixes
|
23
|
+
- Fixed reset session after each scenario against to IE
|
24
|
+
- Corrected default Cucumber and Rspec formatters
|
25
|
+
- Minor bug fixing and code refactoring
|
26
|
+
|
27
|
+
## [v1.0.1](https://github.com/strongqa/howitzer/compare/v1.0...v1.0.1)
|
8
28
|
|
9
29
|
### Bugfixes
|
10
30
|
- Fixed unit tests
|
11
31
|
- Fixed correct Ruby version supporting
|
12
32
|
|
13
|
-
## [v1.0](https://github.com/
|
33
|
+
## [v1.0](https://github.com/strongqa/howitzer/compare/v0.0.3...v1.0)
|
14
34
|
|
15
35
|
It is major release, so there are many new features, refactoring, unit tests, code documentation.
|
16
36
|
|
17
37
|
**Caution**: It is not going to support old versions anymore.
|
18
38
|
|
19
39
|
|
20
|
-
## [v0.0.3](https://github.com/
|
40
|
+
## [v0.0.3](https://github.com/strongqa/howitzer/compare/v0.0.1...v0.0.3)
|
21
41
|
|
22
42
|
### New Features
|
23
43
|
|
@@ -27,6 +47,6 @@ It is major release, so there are many new features, refactoring, unit tests, co
|
|
27
47
|
|
28
48
|
* Fixed problem with dependencies
|
29
49
|
|
30
|
-
## [v0.0.1](https://github.com/
|
50
|
+
## [v0.0.1](https://github.com/strongqa/howitzer/tree/v0.0.1)
|
31
51
|
|
32
52
|
Initial version
|
data/GETTING_STARTED.md
CHANGED
@@ -2,6 +2,7 @@ Getting Started
|
|
2
2
|
===============
|
3
3
|
|
4
4
|
## Jump to Section
|
5
|
+
* [Available Drivers](#available-drivers)
|
5
6
|
* [Pages](#pages)
|
6
7
|
* [Validations](#validations)
|
7
8
|
* [Locators](#locators)
|
@@ -18,6 +19,126 @@ Getting Started
|
|
18
19
|
* [Cucumber Tranformers](#cucumber-transformers)
|
19
20
|
* [RSpec Folder Structure](#rspec-folder-structure)
|
20
21
|
|
22
|
+
Available Drivers
|
23
|
+
------
|
24
|
+
[[Back To Top]](#jump-to-section)
|
25
|
+
|
26
|
+
**Driver** - universal interface for test runners against to different web browsers. All implementations of drivers can be divided to 2 categories:
|
27
|
+
|
28
|
+
* **Headless testing** - browser emulation without GUI(very useful on CI servers, like Bamboo, TeamCity, Jenkins, etc.)
|
29
|
+
* **Real browser testing** - integration with real browsers via extensions, plugins, ActiveX, etc.(for local and cloud based testing, like SauceLabs, Testingbot)
|
30
|
+
|
31
|
+
Howitzer uses [Capybara](http://jnicklas.github.io/capybara/) for driver management and configuration. All that you really need:
|
32
|
+
- specify the **driver** settings in _config/default.yml_
|
33
|
+
- specify some additional settings for chosen driver.
|
34
|
+
Bellow you can find aggregated table with some useful informations about driver settings in Howitzer:
|
35
|
+
|
36
|
+
<table>
|
37
|
+
<thead>
|
38
|
+
<tr>
|
39
|
+
<th>Driver</th>
|
40
|
+
<th align="center">Category</th>
|
41
|
+
<th align="center">Setting name</th>
|
42
|
+
<th align="center">Setting type</th>
|
43
|
+
<th align="center">Description</th>
|
44
|
+
</tr>
|
45
|
+
</thead>
|
46
|
+
<tbody>
|
47
|
+
<tr>
|
48
|
+
<td><a href="http://phantomjs.org/">phantomjs</a>(<strong>default</strong>)</td>
|
49
|
+
<td align="center">Headless</td>
|
50
|
+
<td align="left" rowspan="2">
|
51
|
+
<strong>pjs_ignore_js_errors</strong><br/><br/>
|
52
|
+
<strong>pjs_ignore_ssl_errors</strong>
|
53
|
+
</td>
|
54
|
+
<td align="left" rowspan="2">
|
55
|
+
Boolean <br/><br/>
|
56
|
+
Boolean
|
57
|
+
</td>
|
58
|
+
<td align="left" rowspan="2">
|
59
|
+
if false, then raises exception on js error in app<br/>
|
60
|
+
if false, then ignores ssl warnings
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr>
|
64
|
+
<td><a href="https://github.com/teampoltergeist/poltergeist">poltergeist</a></td>
|
65
|
+
<td align="center">Headless</td>
|
66
|
+
</tr>
|
67
|
+
<tr>
|
68
|
+
<td><a href="https://github.com/thoughtbot/capybara-webkit">webkit</a></td>
|
69
|
+
<td align="center">Headless</td>
|
70
|
+
<td align="center">-</td>
|
71
|
+
<td align="center">-</td>
|
72
|
+
<td align="center">-</td>
|
73
|
+
</tr>
|
74
|
+
<tr>
|
75
|
+
<td><a href="https://code.google.com/p/selenium/wiki/RubyBindings">selenium</a></td>
|
76
|
+
<td align="center">Real</td>
|
77
|
+
<td align="center"><strong>sel_browser</strong></td>
|
78
|
+
<td align="center">String</td>
|
79
|
+
<td align="center">specify one of next browsers: iexplore (ie), firefox (ff), chrome, opera, safari</td>
|
80
|
+
</tr>
|
81
|
+
<tr>
|
82
|
+
<td>selenium_dev</td>
|
83
|
+
<td align="center">Real</td>
|
84
|
+
<td align="center"><strong>-</strong></td>
|
85
|
+
<td align="center">-</td>
|
86
|
+
<td align="center">Execute tests against to FireFox with firebug and firepath extensions</td>
|
87
|
+
</tr>
|
88
|
+
<tr>
|
89
|
+
<td><a href="https://saucelabs.com">sauce</a></td>
|
90
|
+
<td align="center">Real</td>
|
91
|
+
<td align="center">
|
92
|
+
<strong>sl_user<strong><br/>
|
93
|
+
<strong>sl_api_key</strong><br/>
|
94
|
+
<strong>sl_url</strong><br/>
|
95
|
+
<strong>sl_platform</strong><br/>
|
96
|
+
<strong>sl_browser_name</strong><br/>
|
97
|
+
<strong>sl_selenium_version</strong><br/>
|
98
|
+
<strong>sl_max_duration</strong><br/>
|
99
|
+
<strong>sl_idle_timeout</strong></td>
|
100
|
+
<td align="center">
|
101
|
+
String<br/>
|
102
|
+
String<br/>
|
103
|
+
String<br/>
|
104
|
+
Symbol<br/>
|
105
|
+
String<br/>
|
106
|
+
String<br/>
|
107
|
+
String<br/>
|
108
|
+
String</td>
|
109
|
+
<td align="center">See details <a href="https://saucelabs.com/docs/additional-config">here</a></td>
|
110
|
+
</tr>
|
111
|
+
<tr>
|
112
|
+
<td><a href="http://testingbot.com">testingbot</a></td>
|
113
|
+
<td align="center">Real</td>
|
114
|
+
<td align="center">
|
115
|
+
<strong>tb_api_key<strong><br/>
|
116
|
+
<strong>tb_api_secret<strong><br/>
|
117
|
+
<strong>tb_url<strong><br/>
|
118
|
+
<strong>tb_platform<strong><br/>
|
119
|
+
<strong>tb_browser_name<strong><br/>
|
120
|
+
<strong>tb_browser_version<strong><br/>
|
121
|
+
<strong>tb_selenium_version<strong><br/>
|
122
|
+
<strong>tb_max_duration<strong><br/>
|
123
|
+
<strong>tb_idle_timeout<strong><br/>
|
124
|
+
<strong>tb_record_screenshot<strong>
|
125
|
+
</td>
|
126
|
+
<td align="center">
|
127
|
+
String<br/>
|
128
|
+
String<br/>
|
129
|
+
String<br/>
|
130
|
+
Symbol<br/>
|
131
|
+
String<br/>
|
132
|
+
Numberic<br/>
|
133
|
+
String<br/>
|
134
|
+
String<br/>
|
135
|
+
String<br/>
|
136
|
+
Boolean</td>
|
137
|
+
<td align="center">See details <a href="http://testingbot.com/support/other/test-options">here</a></td>
|
138
|
+
</tr>
|
139
|
+
</tbody>
|
140
|
+
</table>
|
141
|
+
|
21
142
|
Pages
|
22
143
|
------
|
23
144
|
[[Back To Top]](#jump-to-section)
|
@@ -36,6 +157,8 @@ Each page contains required constant URL(the relative URL of the page):
|
|
36
157
|
**Example :**
|
37
158
|
|
38
159
|
```ruby
|
160
|
+
# put the class to ./pages/home_page.rb file
|
161
|
+
|
39
162
|
class HomePage < WebPage
|
40
163
|
URL = '/'
|
41
164
|
end
|
@@ -65,7 +188,7 @@ Validation Type | Options | Value Type | Description
|
|
65
188
|
```ruby
|
66
189
|
class HomePage < WebPage
|
67
190
|
URL = '/'
|
68
|
-
validates :url, pattern:
|
191
|
+
validates :url, pattern: /\A(?:.*?:\/\/)?[^\/]*\/?\z/
|
69
192
|
end
|
70
193
|
```
|
71
194
|
|
@@ -119,7 +242,7 @@ Each page contains a description of all elements by adding the appropriate locat
|
|
119
242
|
```ruby
|
120
243
|
class HomePage < WebPage
|
121
244
|
URL = '/'
|
122
|
-
validates :url, pattern:
|
245
|
+
validates :url, pattern: /\A(?:.*?:\/\/)?[^\/]*\/?\z/
|
123
246
|
|
124
247
|
add_locator :test_locator_name1, '.foo' #css locator, default
|
125
248
|
add_locator :test_locator_name2, css: '.foo' #css locator
|
@@ -247,16 +370,34 @@ Emails
|
|
247
370
|
------
|
248
371
|
[[Back To Top]](#jump-to-section)
|
249
372
|
|
250
|
-
|
251
|
-
|
373
|
+
Howitzer uses amazing service [Mailgun](http://mailgun.com) which allows to catch all emails of sandbox domain, and to store them to its data storage during 3 days. It is extrimaly useful for new user creation with email confirmation during testing of web applications
|
374
|
+
|
375
|
+
You can use **free** account. Follow steps below:
|
252
376
|
|
253
|
-
|
377
|
+
1. Sign up [here](https://mailgun.com/signup)
|
378
|
+
2. Login and copy your API Key
|
379
|
+
3. Open config/default.yml file of your project, find **mailgun_key** setting and past copied api key there.
|
380
|
+
4. Open Mailgun web page again and copy mailgun domain, ie. 'sandboxbaf443d4c81b43d0b64a413805dc6f68.mailgun.org'
|
381
|
+
5. Open config/default.yml file of your project again, find **mailgun_domain** setting and past copied mailgun domain there.
|
382
|
+
6. Open Mailgun web page again and navigate to **Routes** menu
|
383
|
+
7. Create new route with following parameters
|
254
384
|
|
255
|
-
|
385
|
+
Priority | Filter Expression | Action | Description
|
386
|
+
:--------:|:---------------------:|:-------:|:------------------
|
387
|
+
0 | match_recipient(".*") | store() | Store all messages
|
256
388
|
|
257
|
-
|
389
|
+
_**Email**_ Class corresponds to one letter. Used to test the notifications.
|
258
390
|
|
259
|
-
|
391
|
+
* **.find_by_recipient (recipient)** - search for the letter recipient. The parameter receives email recipient.
|
392
|
+
* **.find (recipient, subject)** - same as the **self.find_by_recipient (recipient)**, but only in case, when we do not know in advance what kind of _subject_ has email.
|
393
|
+
* **\#plain_text_body** - receiving body of message as plain text
|
394
|
+
* **\#html_body** - receiving body of messages as html
|
395
|
+
* **\#text_body** - receiving body of messages as stripped text
|
396
|
+
* **\#mail_from** - returns who has send email data in format: User Name <user@email>
|
397
|
+
* **\#recipients** - returns array of recipients who has received current email
|
398
|
+
* **\#received_time** - returns email received time
|
399
|
+
* **\#sender_email** - returns sender user email
|
400
|
+
* **\#get_mime_part** - allows you to receive the attachment of email
|
260
401
|
|
261
402
|
**Example:**
|
262
403
|
```ruby
|
@@ -267,6 +408,8 @@ end
|
|
267
408
|
|
268
409
|
Example, how custom class might look like:
|
269
410
|
```ruby
|
411
|
+
# put the class to ./emails/my_email.rb file
|
412
|
+
|
270
413
|
class MyEmail <Email
|
271
414
|
SUBJECT = "Test email" # specify the subject of an email
|
272
415
|
|
@@ -403,11 +546,12 @@ Data Storage is simple key value storage, which uses namespaces (for example, :u
|
|
403
546
|
This module has next methods:
|
404
547
|
|
405
548
|
|
406
|
-
Method
|
407
|
-
|
408
|
-
| DataStorage.store(ns,key,value)
|
409
|
-
| DataStorage::extract(ns, key=nil)
|
410
|
-
| DataStorage::clear_ns(ns)
|
549
|
+
Method | Description
|
550
|
+
:------------------------------------------:|:--------------------------------------------------:
|
551
|
+
| DataStorage.store(ns,key,value) | Adds data to storage, where ns - uniq namespace name
|
552
|
+
| DataStorage::extract(ns, key=nil) | Gets data from storage by namespace and key. If key is not specified, then it will returns all data from namespace
|
553
|
+
| DataStorage::clear_ns(ns) | Removes namespace with data
|
554
|
+
| DataStorage::clear_all_ns(exception_list=SPECIAL_NS_LIST)| Removes all namespaces except special namespaces provided as array
|
411
555
|
|
412
556
|
**Example:**
|
413
557
|
```ruby
|
@@ -527,3 +671,4 @@ You can run all tests from this folder by command:
|
|
527
671
|
```bash
|
528
672
|
rake rspec:bvt:accounts
|
529
673
|
```
|
674
|
+
|
data/README.md
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
# Howitzer
|
2
|
-
|
3
|
-
[![Build Status](https://
|
4
|
-
[![Dependency Status](https://gemnasium.com/romikoops/howitzer.png)]
|
2
|
+
[![Gem Version](http://img.shields.io/gem/v/howitzer.svg)][gem]
|
3
|
+
[![Build Status](https://travis-ci.org/strongqa/howitzer.svg?branch=master)][travis]
|
4
|
+
[![Dependency Status](https://gemnasium.com/romikoops/howitzer.png)][gemnasium]
|
5
|
+
[![Code Climate](https://codeclimate.com/github/romikoops/howitzer.png)][codeclimate]
|
6
|
+
[![License](http://img.shields.io/badge/license-MIT-blue.svg)][license]
|
7
|
+
|
8
|
+
[gem]: https://rubygems.org/gems/howitzer
|
9
|
+
[travis]: https://travis-ci.org/strongqa/howitzer
|
10
|
+
[gemnasium]: https://gemnasium.com/romikoops/howitzer
|
11
|
+
[codeclimate]: https://codeclimate.com/github/romikoops/howitzer
|
12
|
+
[license]: https://github.com/strongqa/howitzer/blob/master/LICENSE
|
5
13
|
|
6
14
|
Howitzer is Ruby based framework for acceptance testing.
|
7
15
|
|
8
16
|
Initially it was developed for testing of web applications, but it is applicable to testing of web services or some API as well.
|
9
|
-
The framework uses modern patterns, techniques and tools in automated testing area. For details, please see [Test Framework Design](https://github.com/
|
17
|
+
The framework uses modern patterns, techniques and tools in automated testing area. For details, please see [Test Framework Design](https://github.com/strongqa/howitzer/wiki/Test-Framework-Design).
|
10
18
|
|
11
19
|
## Key benefits
|
12
20
|
- Independent of test web application, its technologies and lanquage.
|
@@ -20,44 +28,35 @@ The framework uses modern patterns, techniques and tools in automated testing ar
|
|
20
28
|
|
21
29
|
|
22
30
|
## Documentation
|
23
|
-
See [GETTING_STARTED](https://github.com/
|
31
|
+
See [GETTING_STARTED](https://github.com/strongqa/howitzer/blob/develop/GETTING_STARTED.md) how to work with *howitzer*.
|
24
32
|
|
25
33
|
Also you can find Rdoc documentation on [Rubygems](https://rubygems.org/gems/howitzer).
|
26
34
|
|
35
|
+
## Related products
|
36
|
+
* [Howitzer Example](https://github.com/strongqa/howitzer_example) - Demo Rails application and Acceptance tests
|
37
|
+
* [Howitzer Stat](https://github.com/strongqa/howitzer_stat) - Howitzer extension for test coverage visualization of web web pages
|
38
|
+
|
27
39
|
## Requirements
|
28
|
-
|
40
|
+
* Supported OS: Mac OS X, Linux, Windows
|
41
|
+
* Ruby 1.9.3+
|
42
|
+
* [DevKit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#installation-instructions)(For **Windows** only)
|
43
|
+
* [PhantomJS](http://phantomjs.org/download.html)
|
44
|
+
* [ChromeDriver](https://code.google.com/p/selenium/wiki/ChromeDriver)
|
29
45
|
|
30
46
|
## Setup
|
31
47
|
To install, type
|
32
48
|
|
33
49
|
```bash
|
34
|
-
|
50
|
+
gem install howitzer
|
35
51
|
```
|
36
52
|
|
37
53
|
## Usage
|
38
|
-
|
39
|
-
|
40
|
-
```bash
|
41
|
-
mkdir test_automation
|
42
|
-
cd test_automation
|
43
|
-
```
|
44
|
-
|
45
|
-
Then for Cucumber:
|
46
|
-
|
47
|
-
```bash
|
48
|
-
howitzer install --cucumber
|
49
|
-
```
|
50
|
-
|
51
|
-
For Rspec:
|
52
|
-
|
53
|
-
```bash
|
54
|
-
howitzer install --rspec
|
55
|
-
```
|
54
|
+
navigate to desired directory where new project will be created
|
56
55
|
|
57
|
-
|
56
|
+
To deploy the framework with Cucumber, type:
|
58
57
|
|
59
58
|
```bash
|
60
|
-
howitzer
|
59
|
+
howitzer new <PROJECT NAME> --cucumber
|
61
60
|
```
|
62
61
|
|
63
62
|
This command will generate next folders and files:
|
@@ -84,15 +83,33 @@ Gemfile
|
|
84
83
|
Rakefile
|
85
84
|
.gitignore
|
86
85
|
```
|
86
|
+
|
87
|
+
With Rspec:
|
88
|
+
|
89
|
+
```bash
|
90
|
+
howitzer new <PROJECT NAME> --rspec
|
91
|
+
```
|
92
|
+
|
93
|
+
With both the ones:
|
94
|
+
|
95
|
+
```bash
|
96
|
+
howitzer new <PROJECT NAME> --cucumber --rspec
|
97
|
+
```
|
98
|
+
|
87
99
|
### Configuration
|
88
100
|
Learn and specify correct default settings in `config/default.yml` file. For details, please see original [sexy_settings](https://github.com/romikoops/sexy_settings) gem.
|
89
101
|
|
90
102
|
## Test implementation workflow
|
91
103
|
|
92
|
-
- Prepare
|
93
|
-
- Implement
|
94
|
-
- Implement
|
95
|
-
-
|
104
|
+
- Prepare Features and Scenarios
|
105
|
+
- Implement appropriate pages in `pages` folder. For details, see [Page Object Pattern](https://github.com/strongqa/howitzer/wiki/PageObject-pattern).
|
106
|
+
- Implement emails in `emails` folder.
|
107
|
+
- Implement scenarios:
|
108
|
+
* Cucumber:
|
109
|
+
1. Read and learn [Cucumber Best Practices](https://github.com/strongqa/howitzer/wiki/Cucumber-Best-Practices)
|
110
|
+
2. Implement step definitions in `features/step_definitions/common_steps.rb` file.
|
111
|
+
* Rspec: Use [DSL](https://github.com/jnicklas/capybara/blob/master/lib/capybara/rspec/features.rb) provided by Capybara for creating descriptive acceptance tests
|
112
|
+
- Debug feature against to desired driver.
|
96
113
|
- Enjoy it!
|
97
114
|
|
98
115
|
## Rake tasks
|
@@ -106,7 +123,7 @@ rake -T
|
|
106
123
|
## More information
|
107
124
|
* [Rubygems](https://rubygems.org/gems/howitzer)
|
108
125
|
* [Mailing list](https://groups.google.com/forum/#!forum/howitzer_ruby)
|
109
|
-
* [Issues](https://github.com/
|
126
|
+
* [Issues](https://github.com/strongqa/howitzer/issues)
|
110
127
|
|
111
128
|
## Contributing
|
112
129
|
|
data/Rakefile
CHANGED
@@ -4,6 +4,15 @@ Bundler.setup
|
|
4
4
|
|
5
5
|
require 'rake'
|
6
6
|
require 'rspec/core/rake_task'
|
7
|
+
require 'cucumber/rake/task'
|
7
8
|
Bundler::GemHelper.install_tasks
|
8
9
|
RSpec::Core::RakeTask.new(:spec) { |spec| }
|
9
|
-
|
10
|
+
|
11
|
+
Cucumber::Rake::Task.new(:cucumber, 'Run all cucumber features') do |t|
|
12
|
+
t.fork = false
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "All tests"
|
16
|
+
task(all_tests: [:spec, :cucumber]) {}
|
17
|
+
|
18
|
+
task :default => :all_tests
|