ruby_raider 3.0.1 → 3.1.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 -62
- data/lib/commands/scaffolding_commands.rb +1 -192
- data/lib/commands/utility_commands.rb +0 -43
- 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 -5
- data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -5
- 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 -42
- 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 +0 -4
- 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/partials/debug_diagnostics.tt +1 -3
- data/lib/generators/templates/helpers/partials/debug_start.tt +1 -3
- 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/spec_helper.tt +2 -39
- 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 +23 -29
- data/lib/version +1 -1
- data/sig/commands/scaffolding_commands.rbs +0 -12
- data/sig/commands/utility_commands.rbs +0 -6
- data/sig/generators/cucumber/cucumber_generator.rbs +0 -4
- data/sig/generators/generator.rbs +0 -11
- data/sig/generators/helper_generator.rbs +1 -5
- 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 -4
- 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 +1 -51
- 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 +4 -240
- 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 -411
- 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/debug_helper_spec.rb +0 -20
- 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 -97
- 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/helpers/capybara_helper.tt +0 -32
- 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/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
|
@@ -4,10 +4,8 @@ require 'yaml'
|
|
|
4
4
|
require_relative 'content_helper'
|
|
5
5
|
|
|
6
6
|
describe 'CI pipeline content' do
|
|
7
|
-
# --- GitHub Actions ---
|
|
8
|
-
|
|
9
7
|
shared_examples 'valid github pipeline' do |project_name|
|
|
10
|
-
subject(:pipeline) { read_generated(
|
|
8
|
+
subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
|
|
11
9
|
|
|
12
10
|
it 'is valid YAML' do
|
|
13
11
|
expect { YAML.safe_load(pipeline) }.not_to raise_error
|
|
@@ -31,7 +29,7 @@ describe 'CI pipeline content' do
|
|
|
31
29
|
end
|
|
32
30
|
|
|
33
31
|
shared_examples 'github rspec pipeline' do |project_name|
|
|
34
|
-
subject(:pipeline) { read_generated(
|
|
32
|
+
subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
|
|
35
33
|
|
|
36
34
|
it 'runs rspec' do
|
|
37
35
|
expect(pipeline).to include('rspec')
|
|
@@ -39,81 +37,28 @@ describe 'CI pipeline content' do
|
|
|
39
37
|
end
|
|
40
38
|
|
|
41
39
|
shared_examples 'github cucumber pipeline' do |project_name|
|
|
42
|
-
subject(:pipeline) { read_generated(
|
|
40
|
+
subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
|
|
43
41
|
|
|
44
42
|
it 'runs cucumber' do
|
|
45
43
|
expect(pipeline).to include('cucumber')
|
|
46
44
|
end
|
|
47
45
|
end
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
subject(:pipeline) { read_generated("#{project_name}_github", '.github/workflows/test_pipeline.yml') }
|
|
51
|
-
|
|
52
|
-
it 'runs minitest' do
|
|
53
|
-
expect(pipeline).to match(/minitest|ruby.*test/)
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
context 'with rspec and selenium on github' do
|
|
47
|
+
context 'with rspec and selenium' do
|
|
58
48
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
59
49
|
include_examples 'valid github pipeline', name
|
|
60
50
|
include_examples 'github rspec pipeline', name
|
|
61
51
|
end
|
|
62
52
|
|
|
63
|
-
context 'with cucumber and selenium
|
|
53
|
+
context 'with cucumber and selenium' do
|
|
64
54
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
65
55
|
include_examples 'valid github pipeline', name
|
|
66
56
|
include_examples 'github cucumber pipeline', name
|
|
67
57
|
end
|
|
68
58
|
|
|
69
|
-
context 'with
|
|
70
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
71
|
-
include_examples 'valid github pipeline', name
|
|
72
|
-
include_examples 'github minitest pipeline', name
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
context 'with rspec and capybara on github' do
|
|
76
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
77
|
-
include_examples 'valid github pipeline', name
|
|
78
|
-
include_examples 'github rspec pipeline', name
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
context 'with rspec and watir on github' do
|
|
59
|
+
context 'with rspec and watir' do
|
|
82
60
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
83
61
|
include_examples 'valid github pipeline', name
|
|
84
62
|
include_examples 'github rspec pipeline', name
|
|
85
63
|
end
|
|
86
|
-
|
|
87
|
-
# --- GitLab CI ---
|
|
88
|
-
|
|
89
|
-
shared_examples 'valid gitlab pipeline' do |project_name|
|
|
90
|
-
subject(:pipeline) { read_generated("#{project_name}_gitlab", 'gitlab-ci.yml') }
|
|
91
|
-
|
|
92
|
-
it 'is valid YAML' do
|
|
93
|
-
expect { YAML.safe_load(pipeline) }.not_to raise_error
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'has stages' do
|
|
97
|
-
expect(pipeline).to include('stages:')
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
it 'has script section' do
|
|
101
|
-
expect(pipeline).to include('script:')
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
context 'with rspec and selenium on gitlab' do
|
|
106
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
107
|
-
include_examples 'valid gitlab pipeline', name
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
context 'with cucumber and selenium on gitlab' do
|
|
111
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
112
|
-
include_examples 'valid gitlab pipeline', name
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
context 'with minitest and selenium on gitlab' do
|
|
116
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
117
|
-
include_examples 'valid gitlab pipeline', name
|
|
118
|
-
end
|
|
119
64
|
end
|
|
@@ -73,22 +73,6 @@ describe 'Common file content' do
|
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
shared_examples 'minitest rakefile with default task' do |project_name|
|
|
77
|
-
subject(:rakefile) { read_generated(project_name, 'Rakefile') }
|
|
78
|
-
|
|
79
|
-
it 'requires rake/testtask' do
|
|
80
|
-
expect(rakefile).to include("require 'rake/testtask'")
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
it 'defines test task' do
|
|
84
|
-
expect(rakefile).to include('Rake::TestTask.new(:test)')
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
it 'sets default task to test' do
|
|
88
|
-
expect(rakefile).to include('task default: :test')
|
|
89
|
-
end
|
|
90
|
-
end
|
|
91
|
-
|
|
92
76
|
# --- .rspec file ---
|
|
93
77
|
|
|
94
78
|
shared_examples 'has rspec dotfile' do |project_name|
|
|
@@ -215,16 +199,6 @@ describe 'Common file content' do
|
|
|
215
199
|
it_behaves_like 'gemfile with rspec-retry', name
|
|
216
200
|
end
|
|
217
201
|
|
|
218
|
-
context 'with rspec and capybara' do
|
|
219
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
220
|
-
it_behaves_like 'valid rakefile', name
|
|
221
|
-
it_behaves_like 'rspec rakefile with tag tasks', name
|
|
222
|
-
it_behaves_like 'has rspec dotfile', name
|
|
223
|
-
it_behaves_like 'rspec gitignore', name
|
|
224
|
-
it_behaves_like 'spec helper with retry config', name
|
|
225
|
-
it_behaves_like 'gemfile with rspec-retry', name
|
|
226
|
-
end
|
|
227
|
-
|
|
228
202
|
# --- Cucumber contexts ---
|
|
229
203
|
|
|
230
204
|
context 'with cucumber and selenium' do
|
|
@@ -247,42 +221,4 @@ describe 'Common file content' do
|
|
|
247
221
|
it_behaves_like 'cucumber config with retry', name
|
|
248
222
|
end
|
|
249
223
|
|
|
250
|
-
context 'with cucumber and capybara' do
|
|
251
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
252
|
-
it_behaves_like 'valid rakefile', name
|
|
253
|
-
it_behaves_like 'cucumber rakefile with tag tasks', name
|
|
254
|
-
it_behaves_like 'no rspec dotfile', name
|
|
255
|
-
it_behaves_like 'non-rspec gitignore', name
|
|
256
|
-
it_behaves_like 'gemfile without rspec-retry', name
|
|
257
|
-
it_behaves_like 'cucumber config with retry', name
|
|
258
|
-
end
|
|
259
|
-
|
|
260
|
-
# --- Minitest contexts ---
|
|
261
|
-
|
|
262
|
-
context 'with minitest and selenium' do
|
|
263
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
264
|
-
it_behaves_like 'valid rakefile', name
|
|
265
|
-
it_behaves_like 'minitest rakefile with default task', name
|
|
266
|
-
it_behaves_like 'no rspec dotfile', name
|
|
267
|
-
it_behaves_like 'non-rspec gitignore', name
|
|
268
|
-
it_behaves_like 'gemfile without rspec-retry', name
|
|
269
|
-
end
|
|
270
|
-
|
|
271
|
-
context 'with minitest and watir' do
|
|
272
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
273
|
-
it_behaves_like 'valid rakefile', name
|
|
274
|
-
it_behaves_like 'minitest rakefile with default task', name
|
|
275
|
-
it_behaves_like 'no rspec dotfile', name
|
|
276
|
-
it_behaves_like 'non-rspec gitignore', name
|
|
277
|
-
it_behaves_like 'gemfile without rspec-retry', name
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
context 'with minitest and capybara' do
|
|
281
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
282
|
-
it_behaves_like 'valid rakefile', name
|
|
283
|
-
it_behaves_like 'minitest rakefile with default task', name
|
|
284
|
-
it_behaves_like 'no rspec dotfile', name
|
|
285
|
-
it_behaves_like 'non-rspec gitignore', name
|
|
286
|
-
it_behaves_like 'gemfile without rspec-retry', name
|
|
287
|
-
end
|
|
288
224
|
end
|
|
@@ -51,24 +51,6 @@ describe 'Config file content' do
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
shared_examples 'config with video section' do |project_name|
|
|
55
|
-
subject(:config_content) { read_generated(project_name, 'config/config.yml') }
|
|
56
|
-
|
|
57
|
-
let(:config) { YAML.safe_load(config_content, permitted_classes: [Symbol]) }
|
|
58
|
-
|
|
59
|
-
it 'has video section' do
|
|
60
|
-
expect(config).to have_key('video')
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it 'has video enabled key defaulting to false' do
|
|
64
|
-
expect(config['video']['enabled']).to be false
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
it 'has video strategy key' do
|
|
68
|
-
expect(config['video']['strategy']).to eq('auto')
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
|
|
72
54
|
shared_examples 'config with debug section' do |project_name|
|
|
73
55
|
subject(:config_content) { read_generated(project_name, 'config/config.yml') }
|
|
74
56
|
|
|
@@ -105,7 +87,7 @@ describe 'Config file content' do
|
|
|
105
87
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
106
88
|
include_examples 'valid web config', name
|
|
107
89
|
include_examples 'selenium config with timeout', name
|
|
108
|
-
|
|
90
|
+
|
|
109
91
|
include_examples 'config with debug section', name
|
|
110
92
|
end
|
|
111
93
|
|
|
@@ -113,15 +95,7 @@ describe 'Config file content' do
|
|
|
113
95
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
114
96
|
include_examples 'valid web config', name
|
|
115
97
|
include_examples 'config without driver_options', name
|
|
116
|
-
include_examples 'config with video section', name
|
|
117
|
-
include_examples 'config with debug section', name
|
|
118
|
-
end
|
|
119
98
|
|
|
120
|
-
context 'with rspec and capybara' do
|
|
121
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
122
|
-
include_examples 'valid web config', name
|
|
123
|
-
include_examples 'config without driver_options', name
|
|
124
|
-
include_examples 'config with video section', name
|
|
125
99
|
include_examples 'config with debug section', name
|
|
126
100
|
end
|
|
127
101
|
|
|
@@ -129,31 +103,7 @@ describe 'Config file content' do
|
|
|
129
103
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
130
104
|
include_examples 'valid web config', name
|
|
131
105
|
include_examples 'selenium config with timeout', name
|
|
132
|
-
include_examples 'config with video section', name
|
|
133
|
-
include_examples 'config with debug section', name
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
context 'with minitest and selenium' do
|
|
137
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
138
|
-
include_examples 'valid web config', name
|
|
139
|
-
include_examples 'selenium config with timeout', name
|
|
140
|
-
include_examples 'config with video section', name
|
|
141
|
-
include_examples 'config with debug section', name
|
|
142
|
-
end
|
|
143
106
|
|
|
144
|
-
context 'with minitest and watir' do
|
|
145
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
146
|
-
include_examples 'valid web config', name
|
|
147
|
-
include_examples 'config without driver_options', name
|
|
148
|
-
include_examples 'config with video section', name
|
|
149
|
-
include_examples 'config with debug section', name
|
|
150
|
-
end
|
|
151
|
-
|
|
152
|
-
context 'with minitest and capybara' do
|
|
153
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
154
|
-
include_examples 'valid web config', name
|
|
155
|
-
include_examples 'config without driver_options', name
|
|
156
|
-
include_examples 'config with video section', name
|
|
157
107
|
include_examples 'config with debug section', name
|
|
158
108
|
end
|
|
159
109
|
|
|
@@ -7,8 +7,8 @@ module ContentHelper
|
|
|
7
7
|
File.read(File.join(project, relative_path))
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def project(framework, automation
|
|
11
|
-
|
|
10
|
+
def project(framework, automation)
|
|
11
|
+
"#{framework}_#{automation}"
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -67,22 +67,6 @@ describe 'Gemfile content' do
|
|
|
67
67
|
end
|
|
68
68
|
end
|
|
69
69
|
|
|
70
|
-
shared_examples 'contains minitest gems' do |project_name|
|
|
71
|
-
subject(:gemfile) { read_generated(project_name, 'Gemfile') }
|
|
72
|
-
|
|
73
|
-
it 'includes minitest' do
|
|
74
|
-
expect(gemfile).to include("gem 'minitest'")
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it 'includes minitest-reporters' do
|
|
78
|
-
expect(gemfile).to include("gem 'minitest-reporters'")
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it 'includes rubocop-minitest' do
|
|
82
|
-
expect(gemfile).to include("gem 'rubocop-minitest'")
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
|
|
86
70
|
shared_examples 'contains selenium gems' do |project_name|
|
|
87
71
|
subject(:gemfile) { read_generated(project_name, 'Gemfile') }
|
|
88
72
|
|
|
@@ -107,22 +91,6 @@ describe 'Gemfile content' do
|
|
|
107
91
|
end
|
|
108
92
|
end
|
|
109
93
|
|
|
110
|
-
shared_examples 'contains capybara gems' do |project_name|
|
|
111
|
-
subject(:gemfile) { read_generated(project_name, 'Gemfile') }
|
|
112
|
-
|
|
113
|
-
it 'includes capybara' do
|
|
114
|
-
expect(gemfile).to include("gem 'capybara'")
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
it 'includes selenium-webdriver as capybara driver' do
|
|
118
|
-
expect(gemfile).to include("gem 'selenium-webdriver'")
|
|
119
|
-
end
|
|
120
|
-
|
|
121
|
-
it 'does not include watir' do
|
|
122
|
-
expect(gemfile).not_to include("gem 'watir'")
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
94
|
shared_examples 'contains debug gems' do |project_name|
|
|
127
95
|
subject(:gemfile) { read_generated(project_name, 'Gemfile') }
|
|
128
96
|
|
|
@@ -151,14 +119,6 @@ describe 'Gemfile content' do
|
|
|
151
119
|
include_examples 'contains debug gems', name
|
|
152
120
|
end
|
|
153
121
|
|
|
154
|
-
context 'with rspec and capybara' do
|
|
155
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
156
|
-
include_examples 'contains common gems', name
|
|
157
|
-
include_examples 'contains rspec gems', name
|
|
158
|
-
include_examples 'contains capybara gems', name
|
|
159
|
-
include_examples 'contains debug gems', name
|
|
160
|
-
end
|
|
161
|
-
|
|
162
122
|
context 'with cucumber and selenium' do
|
|
163
123
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
164
124
|
include_examples 'contains common gems', name
|
|
@@ -175,35 +135,4 @@ describe 'Gemfile content' do
|
|
|
175
135
|
include_examples 'contains debug gems', name
|
|
176
136
|
end
|
|
177
137
|
|
|
178
|
-
context 'with cucumber and capybara' do
|
|
179
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
180
|
-
include_examples 'contains common gems', name
|
|
181
|
-
include_examples 'contains cucumber gems', name
|
|
182
|
-
include_examples 'contains capybara gems', name
|
|
183
|
-
include_examples 'contains debug gems', name
|
|
184
|
-
end
|
|
185
|
-
|
|
186
|
-
context 'with minitest and selenium' do
|
|
187
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
188
|
-
include_examples 'contains common gems', name
|
|
189
|
-
include_examples 'contains minitest gems', name
|
|
190
|
-
include_examples 'contains selenium gems', name
|
|
191
|
-
include_examples 'contains debug gems', name
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
context 'with minitest and watir' do
|
|
195
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
196
|
-
include_examples 'contains common gems', name
|
|
197
|
-
include_examples 'contains minitest gems', name
|
|
198
|
-
include_examples 'contains watir gems', name
|
|
199
|
-
include_examples 'contains debug gems', name
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
context 'with minitest and capybara' do
|
|
203
|
-
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
204
|
-
include_examples 'contains common gems', name
|
|
205
|
-
include_examples 'contains minitest gems', name
|
|
206
|
-
include_examples 'contains capybara gems', name
|
|
207
|
-
include_examples 'contains debug gems', name
|
|
208
|
-
end
|
|
209
138
|
end
|
|
@@ -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|
|
|
@@ -376,8 +202,7 @@ describe 'Helper file content' do
|
|
|
376
202
|
it_behaves_like 'valid spec helper', name
|
|
377
203
|
it_behaves_like 'selenium spec helper', name
|
|
378
204
|
it_behaves_like 'valid allure helper', name
|
|
379
|
-
|
|
380
|
-
it_behaves_like 'web-only video helper', name
|
|
205
|
+
|
|
381
206
|
it_behaves_like 'valid debug helper', name
|
|
382
207
|
end
|
|
383
208
|
|
|
@@ -387,55 +212,7 @@ describe 'Helper file content' do
|
|
|
387
212
|
it_behaves_like 'valid spec helper', name
|
|
388
213
|
it_behaves_like 'watir spec helper', name
|
|
389
214
|
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
215
|
|
|
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
216
|
it_behaves_like 'valid debug helper', name
|
|
440
217
|
end
|
|
441
218
|
|
|
@@ -446,8 +223,7 @@ describe 'Helper file content' do
|
|
|
446
223
|
it_behaves_like 'valid driver helper', name
|
|
447
224
|
it_behaves_like 'selenium driver helper', name
|
|
448
225
|
it_behaves_like 'valid allure helper', name
|
|
449
|
-
|
|
450
|
-
it_behaves_like 'web-only video helper', name
|
|
226
|
+
|
|
451
227
|
it_behaves_like 'valid debug helper', name
|
|
452
228
|
end
|
|
453
229
|
|
|
@@ -455,17 +231,7 @@ describe 'Helper file content' do
|
|
|
455
231
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
456
232
|
it_behaves_like 'valid browser helper', name
|
|
457
233
|
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
234
|
|
|
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
235
|
it_behaves_like 'valid debug helper', name
|
|
470
236
|
end
|
|
471
237
|
|
|
@@ -473,13 +239,11 @@ describe 'Helper file content' do
|
|
|
473
239
|
|
|
474
240
|
context 'with cucumber and appium android' do
|
|
475
241
|
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
|
|
476
|
-
|
|
477
|
-
it_behaves_like 'mobile video helper', name
|
|
242
|
+
|
|
478
243
|
end
|
|
479
244
|
|
|
480
245
|
context 'with rspec and appium ios' do
|
|
481
246
|
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
|
|
482
|
-
|
|
483
|
-
it_behaves_like 'mobile video helper', name
|
|
247
|
+
|
|
484
248
|
end
|
|
485
249
|
end
|