howitzer 1.1.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +32 -0
  4. data/.travis.yml +1 -4
  5. data/.yardopts +1 -2
  6. data/CHANGELOG.md +28 -1
  7. data/Gemfile +6 -0
  8. data/LICENSE +1 -1
  9. data/README.md +55 -85
  10. data/Rakefile +7 -7
  11. data/bin/howitzer +56 -31
  12. data/features/cli_new.feature +162 -79
  13. data/features/cli_update.feature +114 -21
  14. data/features/step_definitions/common_steps.rb +29 -9
  15. data/features/support/env.rb +1 -1
  16. data/features/support/transformers.rb +2 -2
  17. data/generators/base_generator.rb +121 -49
  18. data/generators/config/config_generator.rb +8 -5
  19. data/generators/config/templates/boot.rb +14 -0
  20. data/generators/config/templates/capybara.rb +156 -0
  21. data/generators/config/templates/custom.yml +2 -3
  22. data/generators/config/templates/default.yml +50 -82
  23. data/generators/cucumber/cucumber_generator.rb +9 -9
  24. data/generators/cucumber/templates/common_steps.rb +4 -4
  25. data/generators/cucumber/templates/cucumber.rake +63 -54
  26. data/generators/cucumber/templates/env.rb +24 -23
  27. data/generators/cucumber/templates/transformers.rb +23 -15
  28. data/generators/emails/emails_generator.rb +4 -2
  29. data/generators/emails/templates/example_email.rb +4 -4
  30. data/generators/prerequisites/prerequisites_generator.rb +24 -0
  31. data/generators/prerequisites/templates/base.rb +22 -0
  32. data/generators/prerequisites/templates/factory_girl.rb +30 -0
  33. data/generators/prerequisites/templates/user.rb +7 -0
  34. data/generators/prerequisites/templates/users.rb +12 -0
  35. data/generators/root/root_generator.rb +11 -7
  36. data/generators/root/templates/.rubocop.yml +32 -0
  37. data/generators/root/templates/Gemfile.erb +27 -0
  38. data/generators/root/templates/Rakefile +6 -8
  39. data/generators/rspec/rspec_generator.rb +7 -7
  40. data/generators/rspec/templates/example_spec.rb +1 -1
  41. data/generators/rspec/templates/rspec.rake +48 -29
  42. data/generators/rspec/templates/spec_helper.rb +33 -32
  43. data/generators/tasks/tasks_generator.rb +4 -2
  44. data/generators/tasks/templates/common.rake +1 -16
  45. data/generators/turnip/templates/.rspec +1 -0
  46. data/generators/turnip/templates/common_steps.rb +25 -0
  47. data/generators/turnip/templates/example.feature +8 -0
  48. data/generators/turnip/templates/spec_helper.rb +56 -0
  49. data/generators/turnip/templates/turnip.rake +61 -0
  50. data/generators/turnip/templates/turnip_helper.rb +6 -0
  51. data/generators/turnip/turnip_generator.rb +26 -0
  52. data/generators/web/templates/example_page.rb +15 -0
  53. data/generators/web/templates/menu_section.rb +13 -0
  54. data/generators/web/web_generator.rb +22 -0
  55. data/howitzer.gemspec +14 -21
  56. data/lib/howitzer.rb +47 -7
  57. data/lib/howitzer/cache.rb +70 -0
  58. data/lib/howitzer/capybara_helpers.rb +194 -0
  59. data/lib/howitzer/email.rb +96 -104
  60. data/lib/howitzer/exceptions.rb +10 -6
  61. data/lib/howitzer/log.rb +120 -0
  62. data/lib/howitzer/mail_adapters.rb +7 -0
  63. data/lib/howitzer/mail_adapters/abstract.rb +84 -0
  64. data/lib/howitzer/mail_adapters/mailgun.rb +115 -0
  65. data/lib/howitzer/mailgun_api.rb +9 -0
  66. data/lib/howitzer/mailgun_api/client.rb +79 -0
  67. data/lib/howitzer/mailgun_api/connector.rb +37 -0
  68. data/lib/howitzer/mailgun_api/response.rb +28 -0
  69. data/lib/howitzer/tasks/framework.rake +2 -2
  70. data/lib/howitzer/utils.rb +7 -1
  71. data/lib/howitzer/utils/string_extensions.rb +66 -0
  72. data/lib/howitzer/version.rb +2 -1
  73. data/lib/howitzer/web.rb +11 -0
  74. data/lib/howitzer/web/base_section.rb +27 -0
  75. data/lib/howitzer/web/blank_page.rb +12 -0
  76. data/lib/howitzer/web/capybara_methods_proxy.rb +29 -0
  77. data/lib/howitzer/web/element_dsl.rb +109 -0
  78. data/lib/howitzer/web/iframe_dsl.rb +93 -0
  79. data/lib/howitzer/web/page.rb +173 -0
  80. data/lib/howitzer/web/page_dsl.rb +64 -0
  81. data/lib/howitzer/web/page_validator.rb +118 -0
  82. data/lib/howitzer/web/section.rb +27 -0
  83. data/lib/howitzer/web/section_dsl.rb +154 -0
  84. data/spec/config/custom.yml +10 -1
  85. data/spec/spec_helper.rb +37 -19
  86. data/spec/support/generator_helper.rb +12 -11
  87. data/spec/support/logger_helper.rb +10 -9
  88. data/spec/support/mailgun_unit_client.rb +52 -44
  89. data/spec/support/shared_examples/capybara_context_holder.rb +33 -0
  90. data/spec/support/shared_examples/capybara_methods_proxy.rb +94 -0
  91. data/spec/support/shared_examples/dynamic_section_methods.rb +35 -0
  92. data/spec/support/shared_examples/element_dsl.rb +119 -0
  93. data/spec/unit/generators/base_generator_spec.rb +64 -33
  94. data/spec/unit/generators/config_generator_spec.rb +11 -7
  95. data/spec/unit/generators/cucumber_generator_spec.rb +26 -17
  96. data/spec/unit/generators/emails_generator_spec.rb +10 -6
  97. data/spec/unit/generators/prerequisites_generator_spec.rb +53 -0
  98. data/spec/unit/generators/root_generator_spec.rb +50 -13
  99. data/spec/unit/generators/rspec_generator_spec.rb +9 -9
  100. data/spec/unit/generators/tasks_generator_spec.rb +6 -6
  101. data/spec/unit/generators/turnip_generator_spec.rb +52 -0
  102. data/spec/unit/generators/web_generator_spec.rb +52 -0
  103. data/spec/unit/lib/cache_spec.rb +85 -0
  104. data/spec/unit/lib/capybara_helpers_spec.rb +696 -0
  105. data/spec/unit/lib/email_spec.rb +104 -91
  106. data/spec/unit/lib/howitzer.rb +31 -0
  107. data/spec/unit/lib/init_spec.rb +0 -1
  108. data/spec/unit/lib/log_spec.rb +122 -0
  109. data/spec/unit/lib/mail_adapters/abstract_spec.rb +62 -0
  110. data/spec/unit/lib/mail_adapters/mailgun_spec.rb +163 -0
  111. data/spec/unit/lib/mailgun_api/client_spec.rb +58 -0
  112. data/spec/unit/lib/mailgun_api/connector_spec.rb +54 -0
  113. data/spec/unit/lib/mailgun_api/response_spec.rb +28 -0
  114. data/spec/unit/lib/utils/string_extensions_spec.rb +77 -0
  115. data/spec/unit/lib/web/base_section_spec.rb +41 -0
  116. data/spec/unit/lib/web/element_dsl_spec.rb +17 -0
  117. data/spec/unit/lib/web/iframe_dsl_spec.rb +99 -0
  118. data/spec/unit/lib/web/page_dsl_spec.rb +52 -0
  119. data/spec/unit/lib/web/page_spec.rb +304 -0
  120. data/spec/unit/lib/web/page_validator_spec.rb +218 -0
  121. data/spec/unit/lib/web/section_dsl_spec.rb +165 -0
  122. data/spec/unit/lib/web/section_spec.rb +61 -0
  123. data/spec/unit/version_spec.rb +1 -1
  124. metadata +116 -203
  125. data/GETTING_STARTED.md +0 -774
  126. data/generators/cucumber/templates/cucumber.yml +0 -10
  127. data/generators/pages/pages_generator.rb +0 -21
  128. data/generators/pages/templates/example_menu.rb +0 -15
  129. data/generators/pages/templates/example_page.rb +0 -15
  130. data/generators/root/templates/Gemfile +0 -7
  131. data/generators/root/templates/boot.rb +0 -10
  132. data/lib/howitzer/blank_page.rb +0 -6
  133. data/lib/howitzer/capybara/dsl_ex.rb +0 -15
  134. data/lib/howitzer/capybara/settings.rb +0 -343
  135. data/lib/howitzer/helpers.rb +0 -230
  136. data/lib/howitzer/init.rb +0 -1
  137. data/lib/howitzer/mailgun/client.rb +0 -65
  138. data/lib/howitzer/mailgun/connector.rb +0 -34
  139. data/lib/howitzer/mailgun/response.rb +0 -28
  140. data/lib/howitzer/patches/rawler_patched.rb +0 -86
  141. data/lib/howitzer/settings.rb +0 -27
  142. data/lib/howitzer/utils/data_generator/data_storage.rb +0 -88
  143. data/lib/howitzer/utils/data_generator/gen.rb +0 -135
  144. data/lib/howitzer/utils/locator_store.rb +0 -217
  145. data/lib/howitzer/utils/log.rb +0 -139
  146. data/lib/howitzer/utils/page_validator.rb +0 -133
  147. data/lib/howitzer/vendor/firebug-1.12.1-fx.xpi +0 -0
  148. data/lib/howitzer/vendor/firepath-0.9.7-fx.xpi +0 -0
  149. data/lib/howitzer/web_page.rb +0 -253
  150. data/spec/active_resource.rb +0 -0
  151. data/spec/config/default.yml +0 -26
  152. data/spec/support/boot_helper.rb +0 -15
  153. data/spec/unit/generators/pages_generator_spec.rb +0 -33
  154. data/spec/unit/lib/capybara/dsl_ex_spec.rb +0 -60
  155. data/spec/unit/lib/capybara/settings_spec.rb +0 -441
  156. data/spec/unit/lib/helpers_spec.rb +0 -1129
  157. data/spec/unit/lib/mailgun/client_spec.rb +0 -36
  158. data/spec/unit/lib/mailgun/connector_spec.rb +0 -70
  159. data/spec/unit/lib/mailgun/response_spec.rb +0 -28
  160. data/spec/unit/lib/settings_spec.rb +0 -17
  161. data/spec/unit/lib/utils/data_generator/data_storage_spec.rb +0 -80
  162. data/spec/unit/lib/utils/data_generator/gen_spec.rb +0 -90
  163. data/spec/unit/lib/utils/locator_store_spec.rb +0 -157
  164. data/spec/unit/lib/utils/log_spec.rb +0 -107
  165. data/spec/unit/lib/utils/page_validator_spec.rb +0 -265
  166. data/spec/unit/lib/web_page_spec.rb +0 -346
@@ -13,7 +13,7 @@ Feature: Howitzer CLI New Project Creation
13
13
  When I run `howitzer new test_automation`
14
14
  Then the output should contain exactly:
15
15
  """
16
- error: Provide --cucumber and/or --rspec option
16
+ error: Provide --cucumber, --rspec or --turnip option
17
17
 
18
18
  """
19
19
  And the exit status should be 64
@@ -40,6 +40,7 @@ Feature: Howitzer CLI New Project Creation
40
40
  COMMAND OPTIONS
41
41
  -c, --cucumber - Integrate Cucumber
42
42
  -r, --rspec - Integrate Rspec
43
+ -t, --turnip - Integrate Turnip
43
44
 
44
45
  """
45
46
  And the exit status should be 0
@@ -55,20 +56,27 @@ Feature: Howitzer CLI New Project Creation
55
56
  * New project directory creation ...
56
57
  Created new './test_automation' folder
57
58
  * Config files generation ...
59
+ Added 'config/boot.rb' file
58
60
  Added 'config/custom.yml' file
61
+ Added 'config/capybara.rb' file
59
62
  Added 'config/default.yml' file
60
63
  * PageOriented pattern structure generation ...
61
- Added 'pages/example_page.rb' file
62
- Added 'pages/example_menu.rb' file
64
+ Added 'web/pages/example_page.rb' file
65
+ Added 'web/sections/menu_section.rb' file
63
66
  * Base rake task generation ...
64
67
  Added 'tasks/common.rake' file
65
68
  * Email example generation ...
66
69
  Added '/emails/example_email.rb' file
67
70
  * Root files generation ...
68
71
  Added '.gitignore' file
69
- Added 'Gemfile' file
72
+ Added '.rubocop.yml' file
70
73
  Added 'Rakefile' file
71
- Added 'boot.rb' file
74
+ Added template 'Gemfile.erb' with params '{:r=>true, :rspec=>true, :c=>false, :cucumber=>false, :t=>false, :turnip=>false}' to destination 'Gemfile'
75
+ * Pre-requisites integration to the framework ...
76
+ Added 'prerequisites/factory_girl.rb' file
77
+ Added 'prerequisites/factories/users.rb' file
78
+ Added 'prerequisites/models/base.rb' file
79
+ Added 'prerequisites/models/user.rb' file
72
80
  * RSpec integration to the framework ...
73
81
  Added 'spec/spec_helper.rb' file
74
82
  Added 'spec/example_spec.rb' file
@@ -77,19 +85,25 @@ Feature: Howitzer CLI New Project Creation
77
85
  """
78
86
  Then a directory named "test_automation" should exist
79
87
  Then the following files should exist:
80
- | test_automation/config/custom.yml |
81
- | test_automation/config/default.yml |
82
- | test_automation/emails/example_email.rb |
83
- | test_automation/pages/example_menu.rb |
84
- | test_automation/pages/example_page.rb |
85
- | test_automation/spec/example_spec.rb |
86
- | test_automation/spec/spec_helper.rb |
87
- | test_automation/tasks/common.rake |
88
- | test_automation/tasks/rspec.rake |
89
- | test_automation/boot.rb |
90
- | test_automation/Gemfile |
91
- | test_automation/Rakefile |
92
- | test_automation/.gitignore |
88
+ | test_automation/config/boot.rb |
89
+ | test_automation/config/custom.yml |
90
+ | test_automation/config/capybara.rb |
91
+ | test_automation/config/default.yml |
92
+ | test_automation/emails/example_email.rb |
93
+ | test_automation/web/sections/menu_section.rb |
94
+ | test_automation/web/pages/example_page.rb |
95
+ | test_automation/prerequisites/factory_girl.rb |
96
+ | test_automation/prerequisites/factories/users.rb |
97
+ | test_automation/prerequisites/models/base.rb |
98
+ | test_automation/prerequisites/models/user.rb |
99
+ | test_automation/spec/example_spec.rb |
100
+ | test_automation/spec/spec_helper.rb |
101
+ | test_automation/tasks/common.rake |
102
+ | test_automation/tasks/rspec.rake |
103
+ | test_automation/Gemfile |
104
+ | test_automation/Rakefile |
105
+ | test_automation/.gitignore |
106
+ | test_automation/.rubocop.yml |
93
107
  And the exit status should be 0
94
108
  Examples:
95
109
  | option |
@@ -103,117 +117,173 @@ Feature: Howitzer CLI New Project Creation
103
117
  * New project directory creation ...
104
118
  Created new './test_automation' folder
105
119
  * Config files generation ...
120
+ Added 'config/boot.rb' file
106
121
  Added 'config/custom.yml' file
122
+ Added 'config/capybara.rb' file
107
123
  Added 'config/default.yml' file
108
124
  * PageOriented pattern structure generation ...
109
- Added 'pages/example_page.rb' file
110
- Added 'pages/example_menu.rb' file
125
+ Added 'web/pages/example_page.rb' file
126
+ Added 'web/sections/menu_section.rb' file
111
127
  * Base rake task generation ...
112
128
  Added 'tasks/common.rake' file
113
129
  * Email example generation ...
114
130
  Added '/emails/example_email.rb' file
115
131
  * Root files generation ...
116
132
  Added '.gitignore' file
117
- Added 'Gemfile' file
133
+ Added '.rubocop.yml' file
118
134
  Added 'Rakefile' file
119
- Added 'boot.rb' file
135
+ Added template 'Gemfile.erb' with params '{:c=>true, :cucumber=>true, :r=>false, :rspec=>false, :t=>false, :turnip=>false}' to destination 'Gemfile'
136
+ * Pre-requisites integration to the framework ...
137
+ Added 'prerequisites/factory_girl.rb' file
138
+ Added 'prerequisites/factories/users.rb' file
139
+ Added 'prerequisites/models/base.rb' file
140
+ Added 'prerequisites/models/user.rb' file
120
141
  * Cucumber integration to the framework ...
121
142
  Added 'features/step_definitions/common_steps.rb' file
122
143
  Added 'features/support/env.rb' file
123
144
  Added 'features/support/transformers.rb' file
124
145
  Added 'features/example.feature' file
125
146
  Added 'tasks/cucumber.rake' file
126
- Added 'config/cucumber.yml' file
127
147
 
128
148
  """
129
149
  Then a directory named "test_automation" should exist
130
150
  Then the following files should exist:
131
- | test_automation/config/cucumber.yml |
151
+ | test_automation/config/boot.rb |
132
152
  | test_automation/config/custom.yml |
153
+ | test_automation/config/capybara.rb |
133
154
  | test_automation/config/default.yml |
134
155
  | test_automation/emails/example_email.rb |
135
156
  | test_automation/features/step_definitions/common_steps.rb |
136
157
  | test_automation/features/support/env.rb |
137
158
  | test_automation/features/support/transformers.rb |
138
159
  | test_automation/features/example.feature |
139
- | test_automation/pages/example_menu.rb |
140
- | test_automation/pages/example_page.rb |
160
+ | test_automation/web/sections/menu_section.rb |
161
+ | test_automation/web/pages/example_page.rb |
162
+ | test_automation/prerequisites/factory_girl.rb |
163
+ | test_automation/prerequisites/factories/users.rb |
164
+ | test_automation/prerequisites/models/base.rb |
165
+ | test_automation/prerequisites/models/user.rb |
141
166
  | test_automation/tasks/common.rake |
142
167
  | test_automation/tasks/cucumber.rake |
143
- | test_automation/boot.rb |
144
168
  | test_automation/Gemfile |
145
169
  | test_automation/Rakefile |
146
170
  | test_automation/.gitignore |
171
+ | test_automation/.rubocop.yml |
147
172
  And the exit status should be 0
148
173
  Examples:
149
174
  | option |
150
175
  | --cucumber |
151
176
  | -c |
152
177
 
153
- Scenario Outline: Run with new command with argument and with cucumber and rspec option
154
- When I run `howitzer new test_automation <options>`
178
+ Scenario Outline: Run with new command with argument and with turnip option
179
+ When I run `howitzer new test_automation <option>`
155
180
  Then the output should contain exactly:
156
181
  """
157
182
  * New project directory creation ...
158
183
  Created new './test_automation' folder
159
184
  * Config files generation ...
185
+ Added 'config/boot.rb' file
160
186
  Added 'config/custom.yml' file
187
+ Added 'config/capybara.rb' file
161
188
  Added 'config/default.yml' file
162
189
  * PageOriented pattern structure generation ...
163
- Added 'pages/example_page.rb' file
164
- Added 'pages/example_menu.rb' file
190
+ Added 'web/pages/example_page.rb' file
191
+ Added 'web/sections/menu_section.rb' file
165
192
  * Base rake task generation ...
166
193
  Added 'tasks/common.rake' file
167
194
  * Email example generation ...
168
195
  Added '/emails/example_email.rb' file
169
196
  * Root files generation ...
170
197
  Added '.gitignore' file
171
- Added 'Gemfile' file
198
+ Added '.rubocop.yml' file
172
199
  Added 'Rakefile' file
173
- Added 'boot.rb' file
174
- * Cucumber integration to the framework ...
175
- Added 'features/step_definitions/common_steps.rb' file
176
- Added 'features/support/env.rb' file
177
- Added 'features/support/transformers.rb' file
178
- Added 'features/example.feature' file
179
- Added 'tasks/cucumber.rake' file
180
- Added 'config/cucumber.yml' file
181
- * RSpec integration to the framework ...
200
+ Added template 'Gemfile.erb' with params '{:t=>true, :turnip=>true, :c=>false, :cucumber=>false, :r=>false, :rspec=>false}' to destination 'Gemfile'
201
+ * Pre-requisites integration to the framework ...
202
+ Added 'prerequisites/factory_girl.rb' file
203
+ Added 'prerequisites/factories/users.rb' file
204
+ Added 'prerequisites/models/base.rb' file
205
+ Added 'prerequisites/models/user.rb' file
206
+ * Turnip integration to the framework ...
207
+ Added '.rspec' file
182
208
  Added 'spec/spec_helper.rb' file
183
- Added 'spec/example_spec.rb' file
184
- Added 'tasks/rspec.rake' file
209
+ Added 'spec/turnip_helper.rb' file
210
+ Added 'spec/acceptance/example.feature' file
211
+ Added 'spec/steps/common_steps.rb' file
212
+ Added 'tasks/turnip.rake' file
185
213
 
186
214
  """
187
215
  Then a directory named "test_automation" should exist
188
216
  Then the following files should exist:
189
- | test_automation/config/cucumber.yml |
217
+ | test_automation/config/boot.rb |
190
218
  | test_automation/config/custom.yml |
219
+ | test_automation/config/capybara.rb |
191
220
  | test_automation/config/default.yml |
192
221
  | test_automation/emails/example_email.rb |
193
- | test_automation/features/step_definitions/common_steps.rb |
194
- | test_automation/features/support/env.rb |
195
- | test_automation/features/support/transformers.rb |
196
- | test_automation/features/example.feature |
197
- | test_automation/pages/example_menu.rb |
198
- | test_automation/pages/example_page.rb |
199
- | test_automation/spec/spec_helper.rb |
200
- | test_automation/spec/example_spec.rb |
222
+ | test_automation/web/sections/menu_section.rb |
223
+ | test_automation/web/pages/example_page.rb |
201
224
  | test_automation/tasks/common.rake |
202
- | test_automation/tasks/cucumber.rake |
203
- | test_automation/tasks/rspec.rake |
204
- | test_automation/boot.rb |
225
+ | test_automation/tasks/turnip.rake |
226
+ | test_automation/spec/spec_helper.rb |
227
+ | test_automation/spec/turnip_helper.rb |
228
+ | test_automation/spec/acceptance/example.feature |
229
+ | test_automation/spec/steps/common_steps.rb |
230
+ | test_automation/.rspec |
205
231
  | test_automation/Gemfile |
206
232
  | test_automation/Rakefile |
207
233
  | test_automation/.gitignore |
234
+ | test_automation/.rubocop.yml |
208
235
  And the exit status should be 0
236
+ Examples:
237
+ | option |
238
+ | --turnip |
239
+ | -t |
240
+
241
+ Scenario Outline: Run with new command with argument and option
242
+ When I run `howitzer new test_automation <options>`
243
+ Then the output should contain exactly:
244
+ """
245
+ error: Provide --cucumber, --rspec or --turnip option
246
+
247
+ """
248
+ And the exit status should be 64
209
249
  Examples:
210
- | options |
211
- | --cucumber --rspec |
212
- | --rspec --cucumber |
213
- | -c -r |
214
- | -r -c |
215
- | -cr |
216
- | -rc |
250
+ | options |
251
+ | --cucumber --rspec |
252
+ | --rspec --cucumber |
253
+ | --cucumber --turnip |
254
+ | --turnip --cucumber |
255
+ | --rspec --turnip |
256
+ | --turnip --rspec |
257
+ | -c -t |
258
+ | -t -c |
259
+ | -c -r |
260
+ | -r -c |
261
+ | -r -t |
262
+ | -t -r |
263
+ | -cr |
264
+ | -rc |
265
+ | -ct |
266
+ | -tc |
267
+ | -rt |
268
+ | -tr |
269
+ | --cucumber --rspec --turnip |
270
+ | --cucumber --turnip --rspec |
271
+ | --rspec --cucumber --turnip |
272
+ | --rspec --turnip --cucumber |
273
+ | --turnip --cucumber --rspec |
274
+ | --turnip --rspec --cucumber |
275
+ | -c -r -t |
276
+ | -c -t -r |
277
+ | -r -c -t |
278
+ | -r -t -c |
279
+ | -t -c -r |
280
+ | -t -r -c |
281
+ | -crt |
282
+ | -ctr |
283
+ | -rct |
284
+ | -rtc |
285
+ | -tcr |
286
+ | -trc |
217
287
 
218
288
  Scenario Outline: Run with new command with options and with rspec argument
219
289
  When I run `howitzer new <option> test_automation`
@@ -222,20 +292,27 @@ Feature: Howitzer CLI New Project Creation
222
292
  * New project directory creation ...
223
293
  Created new './test_automation' folder
224
294
  * Config files generation ...
295
+ Added 'config/boot.rb' file
225
296
  Added 'config/custom.yml' file
297
+ Added 'config/capybara.rb' file
226
298
  Added 'config/default.yml' file
227
299
  * PageOriented pattern structure generation ...
228
- Added 'pages/example_page.rb' file
229
- Added 'pages/example_menu.rb' file
300
+ Added 'web/pages/example_page.rb' file
301
+ Added 'web/sections/menu_section.rb' file
230
302
  * Base rake task generation ...
231
303
  Added 'tasks/common.rake' file
232
304
  * Email example generation ...
233
305
  Added '/emails/example_email.rb' file
234
306
  * Root files generation ...
235
307
  Added '.gitignore' file
236
- Added 'Gemfile' file
308
+ Added '.rubocop.yml' file
237
309
  Added 'Rakefile' file
238
- Added 'boot.rb' file
310
+ Added template 'Gemfile.erb' with params '{:r=>true, :rspec=>true, :c=>false, :cucumber=>false, :t=>false, :turnip=>false}' to destination 'Gemfile'
311
+ * Pre-requisites integration to the framework ...
312
+ Added 'prerequisites/factory_girl.rb' file
313
+ Added 'prerequisites/factories/users.rb' file
314
+ Added 'prerequisites/models/base.rb' file
315
+ Added 'prerequisites/models/user.rb' file
239
316
  * RSpec integration to the framework ...
240
317
  Added 'spec/spec_helper.rb' file
241
318
  Added 'spec/example_spec.rb' file
@@ -244,19 +321,25 @@ Feature: Howitzer CLI New Project Creation
244
321
  """
245
322
  Then a directory named "test_automation" should exist
246
323
  Then the following files should exist:
247
- | test_automation/config/custom.yml |
248
- | test_automation/config/default.yml |
249
- | test_automation/emails/example_email.rb |
250
- | test_automation/pages/example_menu.rb |
251
- | test_automation/pages/example_page.rb |
252
- | test_automation/spec/example_spec.rb |
253
- | test_automation/spec/spec_helper.rb |
254
- | test_automation/tasks/common.rake |
255
- | test_automation/tasks/rspec.rake |
256
- | test_automation/boot.rb |
257
- | test_automation/Gemfile |
258
- | test_automation/Rakefile |
259
- | test_automation/.gitignore |
324
+ | test_automation/config/boot.rb |
325
+ | test_automation/config/custom.yml |
326
+ | test_automation/config/capybara.rb |
327
+ | test_automation/config/default.yml |
328
+ | test_automation/emails/example_email.rb |
329
+ | test_automation/web/sections/menu_section.rb |
330
+ | test_automation/web/pages/example_page.rb |
331
+ | test_automation/prerequisites/factory_girl.rb |
332
+ | test_automation/prerequisites/factories/users.rb |
333
+ | test_automation/prerequisites/models/base.rb |
334
+ | test_automation/prerequisites/models/user.rb |
335
+ | test_automation/spec/example_spec.rb |
336
+ | test_automation/spec/spec_helper.rb |
337
+ | test_automation/tasks/common.rake |
338
+ | test_automation/tasks/rspec.rake |
339
+ | test_automation/Gemfile |
340
+ | test_automation/Rakefile |
341
+ | test_automation/.gitignore |
342
+ | test_automation/.rubocop.yml |
260
343
  And the exit status should be 0
261
344
  Examples:
262
345
  | option |
@@ -1,7 +1,7 @@
1
1
  Feature: Howitzer CLI Update Existing Project
2
2
 
3
- Scenario: Run with update command when project present
4
- Given created old howitzer project
3
+ Scenario: Run with update command when rspec based project present
4
+ Given created old howitzer project based on rspec
5
5
  When I run `howitzer update` interactively
6
6
  And I type "y"
7
7
  And I type "n"
@@ -9,22 +9,29 @@ Feature: Howitzer CLI Update Existing Project
9
9
  Then the output should contain:
10
10
  """
11
11
  * Config files generation ...
12
+ Identical 'config/boot.rb' file
12
13
  Identical 'config/custom.yml' file
14
+ Identical 'config/capybara.rb' file
13
15
  Added 'config/default.yml' file
16
+ * PageOriented pattern structure generation ...
17
+ Identical 'web/pages/example_page.rb' file
18
+ Identical 'web/sections/menu_section.rb' file
19
+ * Base rake task generation ...
20
+ Identical 'tasks/common.rake' file
21
+ * Email example generation ...
22
+ Identical '/emails/example_email.rb' file
23
+ * Pre-requisites integration to the framework ...
24
+ Identical 'prerequisites/factory_girl.rb' file
25
+ Identical 'prerequisites/factories/users.rb' file
26
+ Identical 'prerequisites/models/base.rb' file
27
+ Identical 'prerequisites/models/user.rb' file
14
28
  * Root files generation ...
15
29
  Added '.gitignore' file
16
- Conflict with 'Gemfile' file
17
- Overwrite 'Gemfile' file? [Yn]: Forced 'Gemfile' file
18
- Identical 'Rakefile' file
19
- Conflict with 'boot.rb' file
20
- Overwrite 'boot.rb' file? [Yn]: Skipped 'boot.rb' file
21
- * Cucumber integration to the framework ...
22
- Identical 'features/step_definitions/common_steps.rb' file
23
- Identical 'features/support/env.rb' file
24
- Identical 'features/support/transformers.rb' file
25
- Identical 'features/example.feature' file
26
- Identical 'tasks/cucumber.rake' file
27
- Identical 'config/cucumber.yml' file
30
+ Added '.rubocop.yml' file
31
+ Conflict with 'Rakefile' file
32
+ Overwrite 'Rakefile' file? [Yn]: Forced 'Rakefile' file
33
+ Conflict with 'Gemfile' template
34
+ Overwrite 'Gemfile' template? [Yn]: Skipped 'Gemfile' template
28
35
  * RSpec integration to the framework ...
29
36
  Identical 'spec/spec_helper.rb' file
30
37
  Identical 'spec/example_spec.rb' file
@@ -36,25 +43,111 @@ Feature: Howitzer CLI Update Existing Project
36
43
  Then the output should contain:
37
44
  """
38
45
  * Config files generation ...
46
+ Identical 'config/boot.rb' file
39
47
  Identical 'config/custom.yml' file
48
+ Identical 'config/capybara.rb' file
40
49
  Identical 'config/default.yml' file
50
+ * PageOriented pattern structure generation ...
51
+ Identical 'web/pages/example_page.rb' file
52
+ Identical 'web/sections/menu_section.rb' file
53
+ * Base rake task generation ...
54
+ Identical 'tasks/common.rake' file
55
+ * Email example generation ...
56
+ Identical '/emails/example_email.rb' file
57
+ * Pre-requisites integration to the framework ...
58
+ Identical 'prerequisites/factory_girl.rb' file
59
+ Identical 'prerequisites/factories/users.rb' file
60
+ Identical 'prerequisites/models/base.rb' file
61
+ Identical 'prerequisites/models/user.rb' file
41
62
  * Root files generation ...
42
63
  Identical '.gitignore' file
43
- Identical 'Gemfile' file
64
+ Identical '.rubocop.yml' file
44
65
  Identical 'Rakefile' file
45
- Conflict with 'boot.rb' file
46
- Overwrite 'boot.rb' file? [Yn]: Forced 'boot.rb' file
66
+ Conflict with 'Gemfile' template
67
+ Overwrite 'Gemfile' template? [Yn]: Forced 'Gemfile' template
68
+ * RSpec integration to the framework ...
69
+ Identical 'spec/spec_helper.rb' file
70
+ Identical 'spec/example_spec.rb' file
71
+ Identical 'tasks/rspec.rake' file
72
+ """
73
+ And the exit status should be 0
74
+
75
+ Scenario: Run with update command when cucumber based project present
76
+ Given created old howitzer project based on cucumber
77
+ When I run `howitzer update` interactively
78
+ And I type "y"
79
+ And I type "n"
80
+ And I type "i"
81
+ Then the output should contain:
82
+ """
83
+ * Config files generation ...
84
+ Identical 'config/boot.rb' file
85
+ Identical 'config/custom.yml' file
86
+ Identical 'config/capybara.rb' file
87
+ Added 'config/default.yml' file
88
+ * PageOriented pattern structure generation ...
89
+ Identical 'web/pages/example_page.rb' file
90
+ Identical 'web/sections/menu_section.rb' file
91
+ * Base rake task generation ...
92
+ Identical 'tasks/common.rake' file
93
+ * Email example generation ...
94
+ Identical '/emails/example_email.rb' file
95
+ * Pre-requisites integration to the framework ...
96
+ Identical 'prerequisites/factory_girl.rb' file
97
+ Identical 'prerequisites/factories/users.rb' file
98
+ Identical 'prerequisites/models/base.rb' file
99
+ Identical 'prerequisites/models/user.rb' file
100
+ * Root files generation ...
101
+ Added '.gitignore' file
102
+ Added '.rubocop.yml' file
103
+ Conflict with 'Rakefile' file
104
+ Overwrite 'Rakefile' file? [Yn]: Forced 'Rakefile' file
105
+ Conflict with 'Gemfile' template
106
+ Overwrite 'Gemfile' template? [Yn]: Skipped 'Gemfile' template
47
107
  * Cucumber integration to the framework ...
48
108
  Identical 'features/step_definitions/common_steps.rb' file
49
109
  Identical 'features/support/env.rb' file
50
110
  Identical 'features/support/transformers.rb' file
51
111
  Identical 'features/example.feature' file
52
112
  Identical 'tasks/cucumber.rake' file
53
- Identical 'config/cucumber.yml' file
54
- * RSpec integration to the framework ...
113
+ """
114
+ And the exit status should be 0
115
+
116
+ Scenario: Run with update command when turnip based project present
117
+ Given created old howitzer project based on turnip
118
+ When I run `howitzer update` interactively
119
+ And I type "y"
120
+ Then the output should contain:
121
+ """
122
+ * Config files generation ...
123
+ Identical 'config/boot.rb' file
124
+ Identical 'config/custom.yml' file
125
+ Identical 'config/capybara.rb' file
126
+ Identical 'config/default.yml' file
127
+ * PageOriented pattern structure generation ...
128
+ Identical 'web/pages/example_page.rb' file
129
+ Identical 'web/sections/menu_section.rb' file
130
+ * Base rake task generation ...
131
+ Identical 'tasks/common.rake' file
132
+ * Email example generation ...
133
+ Identical '/emails/example_email.rb' file
134
+ * Pre-requisites integration to the framework ...
135
+ Identical 'prerequisites/factory_girl.rb' file
136
+ Identical 'prerequisites/factories/users.rb' file
137
+ Identical 'prerequisites/models/base.rb' file
138
+ Identical 'prerequisites/models/user.rb' file
139
+ * Root files generation ...
140
+ Added '.gitignore' file
141
+ Added '.rubocop.yml' file
142
+ Identical 'Rakefile' file
143
+ Conflict with 'Gemfile' template
144
+ Overwrite 'Gemfile' template? [Yn]: Forced 'Gemfile' template
145
+ * Turnip integration to the framework ...
146
+ Added '.rspec' file
55
147
  Identical 'spec/spec_helper.rb' file
56
- Identical 'spec/example_spec.rb' file
57
- Identical 'tasks/rspec.rake' file
148
+ Identical 'spec/turnip_helper.rb' file
149
+ Identical 'spec/acceptance/example.feature' file
150
+ Identical 'spec/steps/common_steps.rb' file
58
151
  """
59
152
  And the exit status should be 0
60
153