ruby_raider 3.0.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/e2e_tests.yml +0 -17
- data/.github/workflows/system_tests.yml +0 -22
- data/README.md +8 -63
- data/lib/commands/scaffolding_commands.rb +1 -192
- data/lib/commands/utility_commands.rb +0 -52
- data/lib/generators/automation/templates/login.tt +1 -9
- data/lib/generators/automation/templates/page.tt +1 -7
- data/lib/generators/automation/templates/partials/initialize_selector.tt +1 -3
- data/lib/generators/automation/templates/partials/visit_method.tt +2 -6
- data/lib/generators/common_generator.rb +0 -6
- data/lib/generators/cucumber/cucumber_generator.rb +0 -24
- data/lib/generators/cucumber/templates/accessibility_steps.tt +2 -6
- data/lib/generators/cucumber/templates/cucumber.tt +0 -7
- data/lib/generators/cucumber/templates/env.tt +1 -3
- data/lib/generators/cucumber/templates/partials/appium_env.tt +1 -6
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +0 -13
- data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -13
- data/lib/generators/cucumber/templates/partials/web_steps.tt +4 -4
- data/lib/generators/cucumber/templates/world.tt +1 -3
- data/lib/generators/generator.rb +2 -46
- data/lib/generators/helper_generator.rb +4 -49
- data/lib/generators/infrastructure/templates/github.tt +2 -2
- data/lib/generators/infrastructure/templates/github_appium.tt +2 -6
- data/lib/generators/invoke_generators.rb +4 -25
- data/lib/generators/menu_generator.rb +10 -100
- data/lib/generators/rspec/rspec_generator.rb +0 -11
- data/lib/generators/rspec/templates/accessibility_spec.tt +2 -6
- data/lib/generators/rspec/templates/spec.tt +6 -8
- data/lib/generators/templates/common/gemfile.tt +0 -26
- data/lib/generators/templates/common/git_ignore.tt +0 -2
- data/lib/generators/templates/common/partials/mobile_config.tt +0 -4
- data/lib/generators/templates/common/partials/web_config.tt +1 -12
- data/lib/generators/templates/common/rakefile.tt +0 -9
- data/lib/generators/templates/common/read_me.tt +4 -10
- data/lib/generators/templates/helpers/allure_helper.tt +0 -10
- data/lib/generators/templates/helpers/browser_helper.tt +0 -5
- data/lib/generators/templates/helpers/partials/quit_driver.tt +1 -3
- data/lib/generators/templates/helpers/partials/screenshot.tt +1 -3
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +0 -5
- data/lib/generators/templates/helpers/spec_helper.tt +2 -44
- data/lib/generators/templates/helpers/test_helper.tt +0 -7
- data/lib/ruby_raider.rb +2 -50
- data/lib/scaffolding/project_detector.rb +2 -9
- data/lib/scaffolding/scaffolding.rb +0 -109
- data/lib/scaffolding/templates/component.tt +1 -4
- data/lib/scaffolding/templates/page_object.tt +0 -10
- data/lib/scaffolding/templates/spec.tt +2 -6
- data/lib/scaffolding/templates/steps.tt +0 -2
- data/lib/utilities/utilities.rb +20 -33
- data/lib/version +1 -1
- data/sig/commands/scaffolding_commands.rbs +0 -12
- data/sig/commands/utility_commands.rbs +0 -7
- data/sig/generators/cucumber/cucumber_generator.rbs +0 -4
- data/sig/generators/generator.rbs +0 -11
- data/sig/generators/helper_generator.rbs +1 -6
- data/sig/generators/invoke_generators.rbs +1 -2
- data/sig/generators/menu_generator.rbs +2 -6
- data/sig/generators/rspec/rspec_generator.rbs +0 -2
- data/sig/ruby_raider.rbs +1 -3
- data/sig/scaffolding/project_detector.rbs +0 -1
- data/sig/scaffolding/scaffolding.rbs +0 -23
- data/sig/utilities/utilities.rbs +0 -5
- data/spec/commands/raider_commands_spec.rb +0 -61
- data/spec/integration/commands/browser_update_after_creation_spec.rb +123 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +0 -20
- data/spec/integration/commands/utility_commands_spec.rb +5 -5
- data/spec/integration/content/ci_content_spec.rb +6 -61
- data/spec/integration/content/common_content_spec.rb +0 -64
- data/spec/integration/content/config_content_spec.rb +0 -86
- data/spec/integration/content/content_helper.rb +2 -2
- data/spec/integration/content/gemfile_content_spec.rb +0 -71
- data/spec/integration/content/helper_content_spec.rb +2 -284
- data/spec/integration/content/page_content_spec.rb +0 -89
- data/spec/integration/content/syntax_validation_spec.rb +2 -2
- data/spec/integration/content/test_content_spec.rb +0 -119
- data/spec/integration/end_to_end_features_spec.rb +13 -435
- data/spec/integration/end_to_end_spec.rb +0 -96
- data/spec/integration/generators/axe_addon_spec.rb +2 -52
- data/spec/integration/generators/common_generator_spec.rb +1 -13
- data/spec/integration/generators/config_features_spec.rb +3 -81
- data/spec/integration/generators/github_generator_spec.rb +5 -15
- data/spec/integration/generators/helpers_generator_spec.rb +0 -37
- data/spec/integration/scaffolding_e2e_spec.rb +2 -237
- data/spec/integration/settings_helper.rb +1 -3
- data/spec/integration/spec_helper.rb +6 -11
- data/spec/menus/menu_generator_spec.rb +4 -107
- data/spec/scaffolding/scaffold_project_detector_spec.rb +4 -26
- data/spec/scaffolding/scaffolding_features_spec.rb +0 -183
- data/spec/system/selenium_spec.rb +1 -4
- data/spec/system/support/system_test_helper.rb +0 -1
- data/spec/system/watir_spec.rb +1 -4
- data/spec/utilities/headless_config_spec.rb +0 -7
- metadata +3 -102
- data/lib/adopter/adopt_menu.rb +0 -146
- data/lib/adopter/converters/base_converter.rb +0 -84
- data/lib/adopter/converters/identity_converter.rb +0 -53
- data/lib/adopter/migration_plan.rb +0 -74
- data/lib/adopter/migrator.rb +0 -96
- data/lib/adopter/plan_builder.rb +0 -275
- data/lib/adopter/project_analyzer.rb +0 -252
- data/lib/adopter/project_detector.rb +0 -157
- data/lib/generators/cucumber/templates/partials/capybara_env.tt +0 -38
- data/lib/generators/cucumber/templates/partials/capybara_world.tt +0 -6
- data/lib/generators/cucumber/templates/performance_feature.tt +0 -5
- data/lib/generators/cucumber/templates/performance_steps.tt +0 -17
- data/lib/generators/cucumber/templates/visual_feature.tt +0 -5
- data/lib/generators/cucumber/templates/visual_steps.tt +0 -19
- data/lib/generators/infrastructure/gitlab_generator.rb +0 -11
- data/lib/generators/infrastructure/templates/gitlab.tt +0 -46
- data/lib/generators/minitest/minitest_generator.rb +0 -35
- data/lib/generators/minitest/templates/accessibility_test.tt +0 -26
- data/lib/generators/minitest/templates/performance_test.tt +0 -18
- data/lib/generators/minitest/templates/test.tt +0 -64
- data/lib/generators/minitest/templates/visual_test.tt +0 -23
- data/lib/generators/rspec/templates/performance_spec.tt +0 -18
- data/lib/generators/rspec/templates/visual_spec.tt +0 -20
- data/lib/generators/templates/common/ruby_version.tt +0 -1
- data/lib/generators/templates/helpers/capybara_helper.tt +0 -32
- data/lib/generators/templates/helpers/debug_helper.tt +0 -190
- data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +0 -7
- data/lib/generators/templates/helpers/partials/debug_start.tt +0 -7
- data/lib/generators/templates/helpers/performance_helper.tt +0 -57
- data/lib/generators/templates/helpers/visual_helper.tt +0 -58
- data/lib/llm/client.rb +0 -79
- data/lib/llm/config.rb +0 -57
- data/lib/llm/prompts.rb +0 -84
- data/lib/llm/provider.rb +0 -27
- data/lib/llm/providers/anthropic_provider.rb +0 -43
- data/lib/llm/providers/ollama_provider.rb +0 -56
- data/lib/llm/providers/openai_provider.rb +0 -42
- data/lib/llm/response_parser.rb +0 -67
- data/lib/plugin/plugin.rb +0 -111
- data/lib/plugin/plugin_exposer.rb +0 -55
- data/lib/scaffolding/crud_generator.rb +0 -94
- data/lib/scaffolding/dry_run_presenter.rb +0 -16
- data/lib/scaffolding/page_introspector.rb +0 -45
- data/lib/scaffolding/scaffold_menu.rb +0 -103
- data/lib/scaffolding/templates/page_from_url.tt +0 -75
- data/lib/scaffolding/templates/spec_from_page.tt +0 -31
- data/lib/scaffolding/templates/spec_from_url.tt +0 -46
- data/lib/scaffolding/url_analyzer.rb +0 -179
- data/sig/adopter/adopt_menu.rbs +0 -25
- data/sig/adopter/converters/base_converter.rbs +0 -23
- data/sig/adopter/converters/identity_converter.rbs +0 -16
- data/sig/adopter/migration_plan.rbs +0 -34
- data/sig/adopter/migrator.rbs +0 -21
- data/sig/adopter/plan_builder.rbs +0 -38
- data/sig/adopter/project_analyzer.rbs +0 -39
- data/sig/adopter/project_detector.rbs +0 -26
- data/sig/generators/infrastructure/gitlab_generator.rbs +0 -4
- data/sig/generators/minitest/minitest_generator.rbs +0 -8
- data/sig/llm/client.rbs +0 -15
- data/sig/llm/config.rbs +0 -20
- data/sig/llm/prompts.rbs +0 -8
- data/sig/llm/provider.rbs +0 -12
- data/sig/llm/providers/anthropic_provider.rbs +0 -16
- data/sig/llm/providers/ollama_provider.rbs +0 -18
- data/sig/llm/providers/openai_provider.rbs +0 -16
- data/sig/llm/response_parser.rbs +0 -13
- data/sig/plugin/plugin.rbs +0 -24
- data/sig/plugin/plugin_exposer.rbs +0 -20
- data/sig/scaffolding/crud_generator.rbs +0 -16
- data/sig/scaffolding/dry_run_presenter.rbs +0 -4
- data/sig/scaffolding/page_introspector.rbs +0 -14
- data/sig/scaffolding/scaffold_menu.rbs +0 -18
- data/sig/scaffolding/url_analyzer.rbs +0 -28
- data/spec/adopter/adopt_menu_spec.rb +0 -176
- data/spec/adopter/converters/identity_converter_spec.rb +0 -145
- data/spec/adopter/migration_plan_spec.rb +0 -113
- data/spec/adopter/migrator_spec.rb +0 -277
- data/spec/adopter/plan_builder_spec.rb +0 -298
- data/spec/adopter/project_analyzer_spec.rb +0 -337
- data/spec/adopter/project_detector_spec.rb +0 -295
- data/spec/generators/generator_spec.rb +0 -23
- data/spec/integration/content/reporter_content_spec.rb +0 -236
- data/spec/integration/content/skip_flags_content_spec.rb +0 -206
- data/spec/integration/generators/debug_helper_spec.rb +0 -68
- data/spec/integration/generators/gitlab_generator_spec.rb +0 -38
- data/spec/integration/generators/lighthouse_addon_spec.rb +0 -132
- data/spec/integration/generators/minitest_generator_spec.rb +0 -64
- data/spec/integration/generators/reporter_spec.rb +0 -159
- data/spec/integration/generators/skip_flags_spec.rb +0 -134
- data/spec/integration/generators/visual_addon_spec.rb +0 -148
- data/spec/llm/client_spec.rb +0 -79
- data/spec/llm/config_spec.rb +0 -92
- data/spec/llm/prompts_spec.rb +0 -49
- data/spec/llm/response_parser_spec.rb +0 -92
- data/spec/menus/adopter_adopt_menu_spec.rb +0 -97
- data/spec/scaffolding/page_introspector_spec.rb +0 -82
- data/spec/scaffolding/url_analyzer_spec.rb +0 -110
- data/spec/system/adopt_matrix_spec.rb +0 -537
- data/spec/system/adopt_spec.rb +0 -225
- data/spec/system/capybara_spec.rb +0 -42
|
@@ -79,44 +79,6 @@ describe 'Helper file content' do
|
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
# --- Capybara helper ---
|
|
83
|
-
|
|
84
|
-
shared_examples 'valid capybara helper' do |project_name|
|
|
85
|
-
subject(:helper) { read_generated(project_name, 'helpers/capybara_helper.rb') }
|
|
86
|
-
|
|
87
|
-
it 'has frozen_string_literal' do
|
|
88
|
-
expect(helper).to have_frozen_string_literal
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
it 'has valid Ruby syntax' do
|
|
92
|
-
expect(helper).to have_valid_ruby_syntax
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
it 'defines CapybaraHelper module' do
|
|
96
|
-
expect(helper).to match(/module CapybaraHelper/)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
|
-
it 'requires capybara' do
|
|
100
|
-
expect(helper).to include("require 'capybara'")
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it 'configures Capybara' do
|
|
104
|
-
expect(helper).to include('Capybara.configure')
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
it 'registers Selenium driver' do
|
|
108
|
-
expect(helper).to include('Capybara.register_driver')
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
it 'reads from config.yml' do
|
|
112
|
-
expect(helper).to include("YAML.load_file('config/config.yml')")
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
it 'does not require watir' do
|
|
116
|
-
expect(helper).not_to include("require 'watir'")
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
82
|
# --- Spec helper ---
|
|
121
83
|
|
|
122
84
|
shared_examples 'valid spec helper' do |project_name|
|
|
@@ -179,142 +141,6 @@ describe 'Helper file content' do
|
|
|
179
141
|
end
|
|
180
142
|
end
|
|
181
143
|
|
|
182
|
-
shared_examples 'capybara spec helper' do |project_name|
|
|
183
|
-
subject(:helper) { read_generated(project_name, 'helpers/spec_helper.rb') }
|
|
184
|
-
|
|
185
|
-
it 'includes Capybara::DSL' do
|
|
186
|
-
expect(helper).to include('include(Capybara::DSL)')
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
it 'requires capybara_helper' do
|
|
190
|
-
expect(helper).to include("require_relative 'capybara_helper'")
|
|
191
|
-
end
|
|
192
|
-
|
|
193
|
-
it 'calls CapybaraHelper.configure' do
|
|
194
|
-
expect(helper).to include('CapybaraHelper.configure')
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
# --- Test helper (Minitest) ---
|
|
199
|
-
|
|
200
|
-
shared_examples 'valid test helper' do |project_name|
|
|
201
|
-
subject(:helper) { read_generated(project_name, 'helpers/test_helper.rb') }
|
|
202
|
-
|
|
203
|
-
it 'has frozen_string_literal' do
|
|
204
|
-
expect(helper).to have_frozen_string_literal
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
it 'has valid Ruby syntax' do
|
|
208
|
-
expect(helper).to have_valid_ruby_syntax
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
it 'requires minitest/autorun' do
|
|
212
|
-
expect(helper).to include("require 'minitest/autorun'")
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
it 'defines TestHelper module' do
|
|
216
|
-
expect(helper).to match(/module TestHelper/)
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
it 'includes TestHelper into Minitest::Test' do
|
|
220
|
-
expect(helper).to include('Minitest::Test.include(TestHelper)')
|
|
221
|
-
end
|
|
222
|
-
end
|
|
223
|
-
|
|
224
|
-
shared_examples 'selenium test helper' do |project_name|
|
|
225
|
-
subject(:helper) { read_generated(project_name, 'helpers/test_helper.rb') }
|
|
226
|
-
|
|
227
|
-
it 'includes DriverHelper' do
|
|
228
|
-
expect(helper).to include('include DriverHelper')
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
it 'requires driver_helper' do
|
|
232
|
-
expect(helper).to include("require_relative 'driver_helper'")
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
shared_examples 'watir test helper' do |project_name|
|
|
237
|
-
subject(:helper) { read_generated(project_name, 'helpers/test_helper.rb') }
|
|
238
|
-
|
|
239
|
-
it 'includes BrowserHelper' do
|
|
240
|
-
expect(helper).to include('include BrowserHelper')
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
it 'requires browser_helper' do
|
|
244
|
-
expect(helper).to include("require_relative 'browser_helper'")
|
|
245
|
-
end
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
shared_examples 'capybara test helper' do |project_name|
|
|
249
|
-
subject(:helper) { read_generated(project_name, 'helpers/test_helper.rb') }
|
|
250
|
-
|
|
251
|
-
it 'includes Capybara::DSL' do
|
|
252
|
-
expect(helper).to include('include Capybara::DSL')
|
|
253
|
-
end
|
|
254
|
-
|
|
255
|
-
it 'requires capybara_helper' do
|
|
256
|
-
expect(helper).to include("require_relative 'capybara_helper'")
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
it 'calls CapybaraHelper.configure' do
|
|
260
|
-
expect(helper).to include('CapybaraHelper.configure')
|
|
261
|
-
end
|
|
262
|
-
end
|
|
263
|
-
|
|
264
|
-
# --- Video helper ---
|
|
265
|
-
|
|
266
|
-
shared_examples 'valid video helper' do |project_name|
|
|
267
|
-
subject(:helper) { read_generated(project_name, 'helpers/video_helper.rb') }
|
|
268
|
-
|
|
269
|
-
it 'has frozen_string_literal' do
|
|
270
|
-
expect(helper).to have_frozen_string_literal
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
it 'has valid Ruby syntax' do
|
|
274
|
-
expect(helper).to have_valid_ruby_syntax
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
it 'defines VideoHelper module' do
|
|
278
|
-
expect(helper).to match(/module VideoHelper/)
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
it 'defines recorder_for method' do
|
|
282
|
-
expect(helper).to include('def recorder_for')
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
it 'defines CdpRecorder class' do
|
|
286
|
-
expect(helper).to include('class CdpRecorder')
|
|
287
|
-
end
|
|
288
|
-
|
|
289
|
-
it 'defines ScreenCaptureRecorder class' do
|
|
290
|
-
expect(helper).to include('class ScreenCaptureRecorder')
|
|
291
|
-
end
|
|
292
|
-
|
|
293
|
-
it 'defines NullRecorder class' do
|
|
294
|
-
expect(helper).to include('class NullRecorder')
|
|
295
|
-
end
|
|
296
|
-
|
|
297
|
-
it 'reads config from YAML' do
|
|
298
|
-
expect(helper).to include('YAML.load_file')
|
|
299
|
-
end
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
shared_examples 'mobile video helper' do |project_name|
|
|
303
|
-
subject(:helper) { read_generated(project_name, 'helpers/video_helper.rb') }
|
|
304
|
-
|
|
305
|
-
it 'defines AppiumRecorder class' do
|
|
306
|
-
expect(helper).to include('class AppiumRecorder')
|
|
307
|
-
end
|
|
308
|
-
end
|
|
309
|
-
|
|
310
|
-
shared_examples 'web-only video helper' do |project_name|
|
|
311
|
-
subject(:helper) { read_generated(project_name, 'helpers/video_helper.rb') }
|
|
312
|
-
|
|
313
|
-
it 'does not include AppiumRecorder' do
|
|
314
|
-
expect(helper).not_to include('class AppiumRecorder')
|
|
315
|
-
end
|
|
316
|
-
end
|
|
317
|
-
|
|
318
144
|
# --- Allure helper ---
|
|
319
145
|
|
|
320
146
|
shared_examples 'valid allure helper' do |project_name|
|
|
@@ -329,44 +155,6 @@ describe 'Helper file content' do
|
|
|
329
155
|
end
|
|
330
156
|
end
|
|
331
157
|
|
|
332
|
-
# --- Debug helper ---
|
|
333
|
-
|
|
334
|
-
shared_examples 'valid debug helper' do |project_name|
|
|
335
|
-
subject(:helper) { read_generated(project_name, 'helpers/debug_helper.rb') }
|
|
336
|
-
|
|
337
|
-
it 'has frozen_string_literal' do
|
|
338
|
-
expect(helper).to have_frozen_string_literal
|
|
339
|
-
end
|
|
340
|
-
|
|
341
|
-
it 'has valid Ruby syntax' do
|
|
342
|
-
expect(helper).to have_valid_ruby_syntax
|
|
343
|
-
end
|
|
344
|
-
|
|
345
|
-
it 'defines DebugHelper module' do
|
|
346
|
-
expect(helper).to match(/module DebugHelper/)
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
it 'defines enabled? method' do
|
|
350
|
-
expect(helper).to include('def enabled?')
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
it 'defines capture_failure_diagnostics method' do
|
|
354
|
-
expect(helper).to include('def capture_failure_diagnostics')
|
|
355
|
-
end
|
|
356
|
-
|
|
357
|
-
it 'defines ActionLogger class' do
|
|
358
|
-
expect(helper).to include('class ActionLogger')
|
|
359
|
-
end
|
|
360
|
-
|
|
361
|
-
it 'defines NullActionLogger class' do
|
|
362
|
-
expect(helper).to include('class NullActionLogger')
|
|
363
|
-
end
|
|
364
|
-
|
|
365
|
-
it 'reads config from YAML' do
|
|
366
|
-
expect(helper).to include('YAML.load_file')
|
|
367
|
-
end
|
|
368
|
-
end
|
|
369
|
-
|
|
370
158
|
# --- RSpec + automation contexts ---
|
|
371
159
|
|
|
372
160
|
context 'with rspec and selenium' do
|
|
@@ -376,9 +164,6 @@ describe 'Helper file content' do
|
|
|
376
164
|
it_behaves_like 'valid spec helper', name
|
|
377
165
|
it_behaves_like 'selenium spec helper', name
|
|
378
166
|
it_behaves_like 'valid allure helper', name
|
|
379
|
-
it_behaves_like 'valid video helper', name
|
|
380
|
-
it_behaves_like 'web-only video helper', name
|
|
381
|
-
it_behaves_like 'valid debug helper', name
|
|
382
167
|
end
|
|
383
168
|
|
|
384
169
|
context 'with rspec and watir' do
|
|
@@ -387,56 +172,6 @@ describe 'Helper file content' do
|
|
|
387
172
|
it_behaves_like 'valid spec helper', name
|
|
388
173
|
it_behaves_like 'watir spec helper', name
|
|
389
174
|
it_behaves_like 'valid allure helper', name
|
|
390
|
-
it_behaves_like 'valid video helper', name
|
|
391
|
-
it_behaves_like 'web-only video helper', name
|
|
392
|
-
it_behaves_like 'valid debug helper', name
|
|
393
|
-
end
|
|
394
|
-
|
|
395
|
-
context 'with rspec and capybara' do
|
|
396
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
397
|
-
it_behaves_like 'valid capybara helper', name
|
|
398
|
-
it_behaves_like 'valid spec helper', name
|
|
399
|
-
it_behaves_like 'capybara spec helper', name
|
|
400
|
-
it_behaves_like 'valid allure helper', name
|
|
401
|
-
it_behaves_like 'valid video helper', name
|
|
402
|
-
it_behaves_like 'web-only video helper', name
|
|
403
|
-
it_behaves_like 'valid debug helper', name
|
|
404
|
-
end
|
|
405
|
-
|
|
406
|
-
# --- Minitest + automation contexts ---
|
|
407
|
-
|
|
408
|
-
context 'with minitest and selenium' do
|
|
409
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
410
|
-
it_behaves_like 'valid driver helper', name
|
|
411
|
-
it_behaves_like 'selenium driver helper', name
|
|
412
|
-
it_behaves_like 'valid test helper', name
|
|
413
|
-
it_behaves_like 'selenium test helper', name
|
|
414
|
-
it_behaves_like 'valid allure helper', name
|
|
415
|
-
it_behaves_like 'valid video helper', name
|
|
416
|
-
it_behaves_like 'web-only video helper', name
|
|
417
|
-
it_behaves_like 'valid debug helper', name
|
|
418
|
-
end
|
|
419
|
-
|
|
420
|
-
context 'with minitest and watir' do
|
|
421
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
422
|
-
it_behaves_like 'valid browser helper', name
|
|
423
|
-
it_behaves_like 'valid test helper', name
|
|
424
|
-
it_behaves_like 'watir test helper', name
|
|
425
|
-
it_behaves_like 'valid allure helper', name
|
|
426
|
-
it_behaves_like 'valid video helper', name
|
|
427
|
-
it_behaves_like 'web-only video helper', name
|
|
428
|
-
it_behaves_like 'valid debug helper', name
|
|
429
|
-
end
|
|
430
|
-
|
|
431
|
-
context 'with minitest and capybara' do
|
|
432
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
433
|
-
it_behaves_like 'valid capybara helper', name
|
|
434
|
-
it_behaves_like 'valid test helper', name
|
|
435
|
-
it_behaves_like 'capybara test helper', name
|
|
436
|
-
it_behaves_like 'valid allure helper', name
|
|
437
|
-
it_behaves_like 'valid video helper', name
|
|
438
|
-
it_behaves_like 'web-only video helper', name
|
|
439
|
-
it_behaves_like 'valid debug helper', name
|
|
440
175
|
end
|
|
441
176
|
|
|
442
177
|
# --- Cucumber + automation contexts (no spec_helper/test_helper) ---
|
|
@@ -446,40 +181,23 @@ describe 'Helper file content' do
|
|
|
446
181
|
it_behaves_like 'valid driver helper', name
|
|
447
182
|
it_behaves_like 'selenium driver helper', name
|
|
448
183
|
it_behaves_like 'valid allure helper', name
|
|
449
|
-
it_behaves_like 'valid video helper', name
|
|
450
|
-
it_behaves_like 'web-only video helper', name
|
|
451
|
-
it_behaves_like 'valid debug helper', name
|
|
452
184
|
end
|
|
453
185
|
|
|
454
186
|
context 'with cucumber and watir' do
|
|
455
187
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
456
188
|
it_behaves_like 'valid browser helper', name
|
|
457
189
|
it_behaves_like 'valid allure helper', name
|
|
458
|
-
it_behaves_like 'valid video helper', name
|
|
459
|
-
it_behaves_like 'web-only video helper', name
|
|
460
|
-
it_behaves_like 'valid debug helper', name
|
|
461
|
-
end
|
|
462
|
-
|
|
463
|
-
context 'with cucumber and capybara' do
|
|
464
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
465
|
-
it_behaves_like 'valid capybara helper', name
|
|
466
|
-
it_behaves_like 'valid allure helper', name
|
|
467
|
-
it_behaves_like 'valid video helper', name
|
|
468
|
-
it_behaves_like 'web-only video helper', name
|
|
469
|
-
it_behaves_like 'valid debug helper', name
|
|
470
190
|
end
|
|
471
191
|
|
|
472
192
|
# --- Mobile contexts (with AppiumRecorder) ---
|
|
473
193
|
|
|
474
194
|
context 'with cucumber and appium android' do
|
|
475
195
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
|
|
476
|
-
|
|
477
|
-
it_behaves_like 'mobile video helper', name
|
|
196
|
+
|
|
478
197
|
end
|
|
479
198
|
|
|
480
199
|
context 'with rspec and appium ios' do
|
|
481
200
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
|
|
482
|
-
|
|
483
|
-
it_behaves_like 'mobile video helper', name
|
|
201
|
+
|
|
484
202
|
end
|
|
485
203
|
end
|
|
@@ -79,32 +79,6 @@ describe 'Page object content' do
|
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
-
shared_examples 'capybara login page' do |project_name|
|
|
83
|
-
subject(:login) { read_generated(project_name, 'page_objects/pages/login.rb') }
|
|
84
|
-
|
|
85
|
-
it 'uses fill_in for input' do
|
|
86
|
-
expect(login).to include('fill_in')
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it 'uses click_button' do
|
|
90
|
-
expect(login).to include('click_button')
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it 'has no private element methods' do
|
|
94
|
-
expect(login).not_to include('private')
|
|
95
|
-
expect(login).not_to match(/def username_field/)
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'does not include Selenium methods' do
|
|
99
|
-
expect(login).not_to include('find_element')
|
|
100
|
-
expect(login).not_to include('send_keys')
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it 'does not include Watir methods' do
|
|
104
|
-
expect(login).not_to include('browser.text_field')
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
|
|
108
82
|
# --- Abstract page ---
|
|
109
83
|
|
|
110
84
|
shared_examples 'valid abstract page' do |project_name|
|
|
@@ -159,30 +133,6 @@ describe 'Page object content' do
|
|
|
159
133
|
end
|
|
160
134
|
end
|
|
161
135
|
|
|
162
|
-
shared_examples 'capybara abstract page' do |project_name|
|
|
163
|
-
subject(:page) { read_generated(project_name, 'page_objects/abstract/page.rb') }
|
|
164
|
-
|
|
165
|
-
it 'includes Capybara::DSL' do
|
|
166
|
-
expect(page).to include('include Capybara::DSL')
|
|
167
|
-
end
|
|
168
|
-
|
|
169
|
-
it 'uses visit_page method' do
|
|
170
|
-
expect(page).to match(/def visit_page/)
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
it 'uses Capybara.visit' do
|
|
174
|
-
expect(page).to include('Capybara.visit')
|
|
175
|
-
end
|
|
176
|
-
|
|
177
|
-
it 'does not have attr_reader :driver' do
|
|
178
|
-
expect(page).not_to include('attr_reader :driver')
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
it 'does not have initialize with driver' do
|
|
182
|
-
expect(page).not_to match(/def initialize\(driver\)/)
|
|
183
|
-
end
|
|
184
|
-
end
|
|
185
|
-
|
|
186
136
|
# --- Contexts ---
|
|
187
137
|
|
|
188
138
|
context 'with rspec and selenium' do
|
|
@@ -201,14 +151,6 @@ describe 'Page object content' do
|
|
|
201
151
|
include_examples 'watir abstract page', name
|
|
202
152
|
end
|
|
203
153
|
|
|
204
|
-
context 'with rspec and capybara' do
|
|
205
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
206
|
-
include_examples 'valid login page', name
|
|
207
|
-
include_examples 'capybara login page', name
|
|
208
|
-
include_examples 'valid abstract page', name
|
|
209
|
-
include_examples 'capybara abstract page', name
|
|
210
|
-
end
|
|
211
|
-
|
|
212
154
|
context 'with cucumber and selenium' do
|
|
213
155
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
214
156
|
include_examples 'valid login page', name
|
|
@@ -225,35 +167,4 @@ describe 'Page object content' do
|
|
|
225
167
|
include_examples 'watir abstract page', name
|
|
226
168
|
end
|
|
227
169
|
|
|
228
|
-
context 'with cucumber and capybara' do
|
|
229
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
230
|
-
include_examples 'valid login page', name
|
|
231
|
-
include_examples 'capybara login page', name
|
|
232
|
-
include_examples 'valid abstract page', name
|
|
233
|
-
include_examples 'capybara abstract page', name
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
context 'with minitest and selenium' do
|
|
237
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
238
|
-
include_examples 'valid login page', name
|
|
239
|
-
include_examples 'selenium login page', name
|
|
240
|
-
include_examples 'valid abstract page', name
|
|
241
|
-
include_examples 'selenium abstract page', name
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
context 'with minitest and watir' do
|
|
245
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
246
|
-
include_examples 'valid login page', name
|
|
247
|
-
include_examples 'watir login page', name
|
|
248
|
-
include_examples 'valid abstract page', name
|
|
249
|
-
include_examples 'watir abstract page', name
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
context 'with minitest and capybara' do
|
|
253
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
254
|
-
include_examples 'valid login page', name
|
|
255
|
-
include_examples 'capybara login page', name
|
|
256
|
-
include_examples 'valid abstract page', name
|
|
257
|
-
include_examples 'capybara abstract page', name
|
|
258
|
-
end
|
|
259
170
|
end
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative 'content_helper'
|
|
4
4
|
|
|
5
|
-
SYNTAX_WEB_AUTOMATIONS = %w[selenium watir
|
|
6
|
-
SYNTAX_ALL_FRAMEWORKS = %w[cucumber rspec
|
|
5
|
+
SYNTAX_WEB_AUTOMATIONS = %w[selenium watir].freeze
|
|
6
|
+
SYNTAX_ALL_FRAMEWORKS = %w[cucumber rspec].freeze
|
|
7
7
|
|
|
8
8
|
describe 'Ruby syntax validation' do
|
|
9
9
|
SYNTAX_ALL_FRAMEWORKS.each do |framework|
|
|
@@ -68,92 +68,6 @@ describe 'Test file content' do
|
|
|
68
68
|
end
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
shared_examples 'capybara rspec spec' do |project_name|
|
|
72
|
-
subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
|
|
73
|
-
|
|
74
|
-
it 'instantiates Login without arguments' do
|
|
75
|
-
expect(spec).to include('Login.new')
|
|
76
|
-
expect(spec).not_to match(/Login\.new\((?:driver|browser)\)/)
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
it 'uses visit_page method' do
|
|
80
|
-
expect(spec).to include('.visit_page')
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
# --- Minitest tests ---
|
|
85
|
-
|
|
86
|
-
shared_examples 'valid minitest test' do |project_name|
|
|
87
|
-
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
88
|
-
|
|
89
|
-
it 'has frozen_string_literal' do
|
|
90
|
-
expect(test).to have_frozen_string_literal
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
it 'has valid Ruby syntax' do
|
|
94
|
-
expect(test).to have_valid_ruby_syntax
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
it 'defines class inheriting from Minitest::Test' do
|
|
98
|
-
expect(test).to match(/class TestLogin < Minitest::Test/)
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
it 'requires test_helper' do
|
|
102
|
-
expect(test).to include("require_relative '../helpers/test_helper'")
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
it 'has setup method' do
|
|
106
|
-
expect(test).to match(/def setup/)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
it 'has teardown method' do
|
|
110
|
-
expect(test).to match(/def teardown/)
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
it 'has test methods' do
|
|
114
|
-
expect(test).to match(/def test_login_with_right_credentials/)
|
|
115
|
-
expect(test).to match(/def test_login_with_wrong_credentials/)
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it 'uses assert_equal' do
|
|
119
|
-
expect(test).to include('assert_equal')
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
shared_examples 'selenium minitest test' do |project_name|
|
|
124
|
-
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
125
|
-
|
|
126
|
-
it 'instantiates Login with driver' do
|
|
127
|
-
expect(test).to include('Login.new(driver)')
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
it 'uses visit method' do
|
|
131
|
-
expect(test).to include('.visit')
|
|
132
|
-
expect(test).not_to include('.visit_page')
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
shared_examples 'watir minitest test' do |project_name|
|
|
137
|
-
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
138
|
-
|
|
139
|
-
it 'instantiates Login with browser' do
|
|
140
|
-
expect(test).to include('Login.new(browser)')
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
shared_examples 'capybara minitest test' do |project_name|
|
|
145
|
-
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
146
|
-
|
|
147
|
-
it 'instantiates Login without arguments' do
|
|
148
|
-
expect(test).to include('Login.new')
|
|
149
|
-
expect(test).not_to match(/Login\.new\((?:driver|browser)\)/)
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
it 'uses visit_page method' do
|
|
153
|
-
expect(test).to include('.visit_page')
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
|
|
157
71
|
# --- Cucumber features and steps ---
|
|
158
72
|
|
|
159
73
|
shared_examples 'valid cucumber feature' do |project_name|
|
|
@@ -212,32 +126,6 @@ describe 'Test file content' do
|
|
|
212
126
|
include_examples 'watir rspec spec', name
|
|
213
127
|
end
|
|
214
128
|
|
|
215
|
-
context 'with rspec and capybara' do
|
|
216
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
217
|
-
include_examples 'valid rspec spec', name
|
|
218
|
-
include_examples 'capybara rspec spec', name
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
# --- Minitest contexts ---
|
|
222
|
-
|
|
223
|
-
context 'with minitest and selenium' do
|
|
224
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
225
|
-
include_examples 'valid minitest test', name
|
|
226
|
-
include_examples 'selenium minitest test', name
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
context 'with minitest and watir' do
|
|
230
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
231
|
-
include_examples 'valid minitest test', name
|
|
232
|
-
include_examples 'watir minitest test', name
|
|
233
|
-
end
|
|
234
|
-
|
|
235
|
-
context 'with minitest and capybara' do
|
|
236
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
237
|
-
include_examples 'valid minitest test', name
|
|
238
|
-
include_examples 'capybara minitest test', name
|
|
239
|
-
end
|
|
240
|
-
|
|
241
129
|
# --- Cucumber contexts ---
|
|
242
130
|
|
|
243
131
|
context 'with cucumber and selenium' do
|
|
@@ -256,11 +144,4 @@ describe 'Test file content' do
|
|
|
256
144
|
include_examples 'valid cucumber config', name
|
|
257
145
|
end
|
|
258
146
|
|
|
259
|
-
context 'with cucumber and capybara' do
|
|
260
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
261
|
-
include_examples 'valid cucumber feature', name
|
|
262
|
-
include_examples 'valid cucumber env', name
|
|
263
|
-
include_examples 'valid cucumber world', name
|
|
264
|
-
include_examples 'valid cucumber config', name
|
|
265
|
-
end
|
|
266
147
|
end
|