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
|
@@ -18,17 +18,7 @@ describe CommonGenerator do
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
it 'creates a .ruby-version file' do
|
|
23
|
-
expect(File).to exist("#{name}/.ruby-version")
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'contains the default ruby version' do
|
|
27
|
-
expect(File.read("#{name}/.ruby-version").strip).to eq('3.4')
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
shared_examples 'creates a config file' do |name|
|
|
21
|
+
shared_examples 'creates a config file' do |name|
|
|
32
22
|
it 'creates a config file' do
|
|
33
23
|
expect(File).to exist("#{name}/config/config.yml")
|
|
34
24
|
end
|
|
@@ -56,7 +46,6 @@ describe CommonGenerator do
|
|
|
56
46
|
include_examples 'creates common files', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
57
47
|
include_examples 'creates a config file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
58
48
|
include_examples 'creates a gitignore file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
59
|
-
include_examples 'creates a ruby-version file', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
60
49
|
end
|
|
61
50
|
|
|
62
51
|
context 'with rspec and watir' do
|
|
@@ -69,7 +58,6 @@ describe CommonGenerator do
|
|
|
69
58
|
include_examples 'creates common files', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
70
59
|
include_examples 'creates a config file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
71
60
|
include_examples 'creates a gitignore file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
72
|
-
include_examples 'creates a ruby-version file', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
73
61
|
end
|
|
74
62
|
|
|
75
63
|
context 'with cucumber and watir' do
|
|
@@ -8,8 +8,7 @@ describe 'Config features for generated projects' do
|
|
|
8
8
|
include InvokeGenerators
|
|
9
9
|
|
|
10
10
|
after(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
11
|
-
%w[config_selenium_test
|
|
12
|
-
reporter_json_rspec_test reporter_json_cucumber_test reporter_json_minitest_test].each do |name|
|
|
11
|
+
%w[config_selenium_test config_watir_test].each do |name|
|
|
13
12
|
FileUtils.rm_rf(name)
|
|
14
13
|
end
|
|
15
14
|
end
|
|
@@ -17,7 +16,7 @@ describe 'Config features for generated projects' do
|
|
|
17
16
|
describe 'timeout and viewport in config.yml' do
|
|
18
17
|
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
19
18
|
InvokeGenerators.generate_framework(
|
|
20
|
-
automation: 'selenium', framework: 'rspec', name: 'config_selenium_test'
|
|
19
|
+
automation: 'selenium', framework: 'rspec', name: 'config_selenium_test'
|
|
21
20
|
)
|
|
22
21
|
end
|
|
23
22
|
|
|
@@ -53,33 +52,10 @@ describe 'Config features for generated projects' do
|
|
|
53
52
|
end
|
|
54
53
|
end
|
|
55
54
|
|
|
56
|
-
describe 'timeout in Capybara helper' do
|
|
57
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
58
|
-
InvokeGenerators.generate_framework(
|
|
59
|
-
automation: 'capybara', framework: 'rspec', name: 'config_capybara_test', reporter: 'none'
|
|
60
|
-
)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it 'reads timeout from config in capybara_helper' do
|
|
64
|
-
helper = File.read('config_capybara_test/helpers/capybara_helper.rb')
|
|
65
|
-
expect(helper).to include("config.fetch('timeout', 10)")
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
it 'generates spec_helper with viewport-aware window setup' do
|
|
69
|
-
helper = File.read('config_capybara_test/helpers/spec_helper.rb')
|
|
70
|
-
expect(helper).to include('viewport')
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it 'generates spec_helper with valid Ruby syntax' do
|
|
74
|
-
helper = File.read('config_capybara_test/helpers/spec_helper.rb')
|
|
75
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
76
|
-
end
|
|
77
|
-
end
|
|
78
|
-
|
|
79
55
|
describe 'timeout in Watir helper' do
|
|
80
56
|
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
81
57
|
InvokeGenerators.generate_framework(
|
|
82
|
-
automation: 'watir', framework: 'rspec', name: 'config_watir_test'
|
|
58
|
+
automation: 'watir', framework: 'rspec', name: 'config_watir_test'
|
|
83
59
|
)
|
|
84
60
|
end
|
|
85
61
|
|
|
@@ -98,58 +74,4 @@ describe 'Config features for generated projects' do
|
|
|
98
74
|
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
99
75
|
end
|
|
100
76
|
end
|
|
101
|
-
|
|
102
|
-
describe 'reporter: json with RSpec' do
|
|
103
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
104
|
-
InvokeGenerators.generate_framework(
|
|
105
|
-
automation: 'selenium', framework: 'rspec', name: 'reporter_json_rspec_test', reporter: 'json'
|
|
106
|
-
)
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
it 'includes json formatter in spec_helper' do
|
|
110
|
-
helper = File.read('reporter_json_rspec_test/helpers/spec_helper.rb')
|
|
111
|
-
expect(helper).to include("config.add_formatter('json', 'results/results.json')")
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
it 'does not include allure in spec_helper' do
|
|
115
|
-
helper = File.read('reporter_json_rspec_test/helpers/spec_helper.rb')
|
|
116
|
-
expect(helper).not_to include('AllureHelper')
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
it 'generates spec_helper with valid Ruby syntax' do
|
|
120
|
-
helper = File.read('reporter_json_rspec_test/helpers/spec_helper.rb')
|
|
121
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
describe 'reporter: json with Cucumber' do
|
|
126
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
127
|
-
InvokeGenerators.generate_framework(
|
|
128
|
-
automation: 'selenium', framework: 'cucumber', name: 'reporter_json_cucumber_test', reporter: 'json'
|
|
129
|
-
)
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it 'includes json profile in cucumber.yml' do
|
|
133
|
-
cucumber_yml = File.read('reporter_json_cucumber_test/cucumber.yml')
|
|
134
|
-
expect(cucumber_yml).to include('--format json --out results/results.json')
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
describe 'reporter: json with Minitest' do
|
|
139
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
140
|
-
InvokeGenerators.generate_framework(
|
|
141
|
-
automation: 'selenium', framework: 'minitest', name: 'reporter_json_minitest_test', reporter: 'json'
|
|
142
|
-
)
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
it 'includes JsonReporter in test_helper' do
|
|
146
|
-
helper = File.read('reporter_json_minitest_test/helpers/test_helper.rb')
|
|
147
|
-
expect(helper).to include('Minitest::Reporters::JsonReporter')
|
|
148
|
-
end
|
|
149
|
-
|
|
150
|
-
it 'generates test_helper with valid Ruby syntax' do
|
|
151
|
-
helper = File.read('reporter_json_minitest_test/helpers/test_helper.rb')
|
|
152
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
153
|
-
end
|
|
154
|
-
end
|
|
155
77
|
end
|
|
@@ -25,10 +25,6 @@ describe 'Debug helper generation' do
|
|
|
25
25
|
include_examples 'creates debug helper', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
context 'with rspec and capybara' do
|
|
29
|
-
include_examples 'creates debug helper', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
30
|
-
end
|
|
31
|
-
|
|
32
28
|
context 'with cucumber and selenium' do
|
|
33
29
|
include_examples 'creates debug helper', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
34
30
|
end
|
|
@@ -37,22 +33,6 @@ describe 'Debug helper generation' do
|
|
|
37
33
|
include_examples 'creates debug helper', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
38
34
|
end
|
|
39
35
|
|
|
40
|
-
context 'with cucumber and capybara' do
|
|
41
|
-
include_examples 'creates debug helper', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
context 'with minitest and selenium' do
|
|
45
|
-
include_examples 'creates debug helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
context 'with minitest and watir' do
|
|
49
|
-
include_examples 'creates debug helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
context 'with minitest and capybara' do
|
|
53
|
-
include_examples 'creates debug helper', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
54
|
-
end
|
|
55
|
-
|
|
56
36
|
# Mobile frameworks should NOT get debug_helper
|
|
57
37
|
context 'with rspec and appium android' do
|
|
58
38
|
include_examples 'does not create debug helper', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::ANDROID}"
|
|
@@ -4,35 +4,25 @@ require_relative '../../../lib/generators/infrastructure/github_generator'
|
|
|
4
4
|
require_relative '../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe GithubGenerator do
|
|
7
|
-
shared_examples '
|
|
7
|
+
shared_examples 'generates github actions' do |name|
|
|
8
8
|
it 'creates a github infrastructure file' do
|
|
9
9
|
expect(File).to exist("#{name}/.github/workflows/test_pipeline.yml")
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
shared_examples 'does not select any infrastructure option' do |name|
|
|
14
|
-
it 'does not create a github infrastructure file' do
|
|
15
|
-
expect(File).not_to exist("#{name}/.github/workflows/test_pipeline.yml")
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
13
|
context 'with rspec and selenium' do
|
|
20
|
-
include_examples '
|
|
21
|
-
include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
14
|
+
include_examples 'generates github actions', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
22
15
|
end
|
|
23
16
|
|
|
24
17
|
context 'with rspec and watir' do
|
|
25
|
-
include_examples '
|
|
26
|
-
include_examples 'does not select any infrastructure option', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
18
|
+
include_examples 'generates github actions', "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
27
19
|
end
|
|
28
20
|
|
|
29
21
|
context 'with cucumber and selenium' do
|
|
30
|
-
include_examples '
|
|
31
|
-
include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
22
|
+
include_examples 'generates github actions', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
32
23
|
end
|
|
33
24
|
|
|
34
25
|
context 'with cucumber and watir' do
|
|
35
|
-
include_examples '
|
|
36
|
-
include_examples 'does not select any infrastructure option', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
26
|
+
include_examples 'generates github actions', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
37
27
|
end
|
|
38
28
|
end
|
|
@@ -102,41 +102,4 @@ describe HelpersGenerator do
|
|
|
102
102
|
include_examples 'creates cross platform helpers', "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CROSS_PLATFORM}"
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
-
shared_examples 'creates minitest helpers' do |name|
|
|
106
|
-
it 'creates a test helper file' do
|
|
107
|
-
expect(File).to exist("#{name}/helpers/test_helper.rb")
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
it 'does not create a spec helper' do
|
|
111
|
-
expect(File).not_to exist("#{name}/helpers/spec_helper.rb")
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
shared_examples 'creates capybara helpers' do |name|
|
|
116
|
-
it 'creates a capybara helper file' do
|
|
117
|
-
expect(File).to exist("#{name}/helpers/capybara_helper.rb")
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
it 'does not create a driver helper' do
|
|
121
|
-
expect(File).not_to exist("#{name}/helpers/driver_helper.rb")
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
context 'with minitest and selenium' do
|
|
126
|
-
include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
127
|
-
include_examples 'creates selenium helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
128
|
-
include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
context 'with minitest and watir' do
|
|
132
|
-
include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
133
|
-
include_examples 'creates watir helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
134
|
-
include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
context 'with minitest and capybara' do
|
|
138
|
-
include_examples 'creates common helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
139
|
-
include_examples 'creates capybara helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
140
|
-
include_examples 'creates minitest helpers', "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
141
|
-
end
|
|
142
105
|
end
|
|
@@ -25,16 +25,13 @@ end
|
|
|
25
25
|
# files with the right content across all automation × framework combinations.
|
|
26
26
|
describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
27
27
|
|
|
28
|
-
WEB_AUTOMATIONS = %w[selenium
|
|
29
|
-
TEST_FRAMEWORKS = %w[rspec cucumber
|
|
28
|
+
WEB_AUTOMATIONS = %w[selenium watir].freeze
|
|
29
|
+
TEST_FRAMEWORKS = %w[rspec cucumber].freeze
|
|
30
30
|
|
|
31
|
-
# The scaffolding system's generate_default_scaffold checks for spec/ or features/.
|
|
32
|
-
# Minitest projects have test/ only — so the scaffold falls through to feature+steps.
|
|
33
31
|
def self.scaffold_style(framework)
|
|
34
32
|
case framework
|
|
35
33
|
when 'rspec' then :spec
|
|
36
34
|
when 'cucumber' then :feature
|
|
37
|
-
when 'minitest' then :feature # no spec/ dir → falls to else clause
|
|
38
35
|
end
|
|
39
36
|
end
|
|
40
37
|
|
|
@@ -53,19 +50,16 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
53
50
|
when 'rspec' then FileUtils.mkdir_p("#{dir}/spec")
|
|
54
51
|
when 'cucumber' then FileUtils.mkdir_p("#{dir}/features/step_definitions")
|
|
55
52
|
FileUtils.mkdir_p("#{dir}/features/support")
|
|
56
|
-
when 'minitest' then FileUtils.mkdir_p("#{dir}/test")
|
|
57
53
|
end
|
|
58
54
|
|
|
59
55
|
gems = []
|
|
60
56
|
case automation
|
|
61
57
|
when 'selenium' then gems << "gem 'selenium-webdriver'"
|
|
62
|
-
when 'capybara' then gems << "gem 'capybara'"
|
|
63
58
|
when 'watir' then gems << "gem 'watir'"
|
|
64
59
|
end
|
|
65
60
|
case framework
|
|
66
61
|
when 'rspec' then gems << "gem 'rspec'"
|
|
67
62
|
when 'cucumber' then gems << "gem 'cucumber'"
|
|
68
|
-
when 'minitest' then gems << "gem 'minitest'"
|
|
69
63
|
end
|
|
70
64
|
File.write("#{dir}/Gemfile", gems.join("\n") + "\n")
|
|
71
65
|
File.write("#{dir}/config/config.yml", "browser: chrome\nurl: http://localhost:3000\n")
|
|
@@ -120,24 +114,6 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
120
114
|
end
|
|
121
115
|
end
|
|
122
116
|
|
|
123
|
-
shared_examples 'capybara scaffolded page' do
|
|
124
|
-
it 'has fill_in example' do
|
|
125
|
-
expect(page_content).to include('fill_in')
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it 'has no private section' do
|
|
129
|
-
expect(page_content).not_to include('private')
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it 'does not have selenium find_element' do
|
|
133
|
-
expect(page_content).not_to include('driver.find_element')
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
it 'does not have watir browser.text_field' do
|
|
137
|
-
expect(page_content).not_to include('browser.text_field')
|
|
138
|
-
end
|
|
139
|
-
end
|
|
140
|
-
|
|
141
117
|
shared_examples 'watir scaffolded page' do
|
|
142
118
|
it 'has browser.text_field example' do
|
|
143
119
|
expect(page_content).to include('browser.text_field')
|
|
@@ -200,18 +176,6 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
200
176
|
end
|
|
201
177
|
end
|
|
202
178
|
|
|
203
|
-
shared_examples 'capybara scaffolded spec' do
|
|
204
|
-
it 'instantiates page without arguments' do
|
|
205
|
-
expect(spec_content).to include('CheckoutPage.new')
|
|
206
|
-
expect(spec_content).not_to include('CheckoutPage.new(driver)')
|
|
207
|
-
expect(spec_content).not_to include('CheckoutPage.new(browser)')
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
it 'uses visit for navigation' do
|
|
211
|
-
expect(spec_content).to include("visit 'checkout'")
|
|
212
|
-
end
|
|
213
|
-
end
|
|
214
|
-
|
|
215
179
|
shared_examples 'watir scaffolded spec' do
|
|
216
180
|
it 'instantiates page with browser' do
|
|
217
181
|
expect(spec_content).to include('CheckoutPage.new(browser)')
|
|
@@ -280,16 +244,6 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
280
244
|
end
|
|
281
245
|
end
|
|
282
246
|
|
|
283
|
-
shared_examples 'capybara scaffolded steps' do
|
|
284
|
-
it 'uses visit for Given step' do
|
|
285
|
-
expect(steps_content).to include("visit 'checkout'")
|
|
286
|
-
end
|
|
287
|
-
|
|
288
|
-
it 'does not instantiate with driver' do
|
|
289
|
-
expect(steps_content).not_to include('.new(driver)')
|
|
290
|
-
end
|
|
291
|
-
end
|
|
292
|
-
|
|
293
247
|
shared_examples 'watir scaffolded steps' do
|
|
294
248
|
it 'instantiates page with browser' do
|
|
295
249
|
expect(steps_content).to include('CheckoutPage.new(browser)')
|
|
@@ -354,20 +308,6 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
354
308
|
end
|
|
355
309
|
end
|
|
356
310
|
|
|
357
|
-
shared_examples 'capybara scaffolded component' do
|
|
358
|
-
it 'has find(.selector) example' do
|
|
359
|
-
expect(component_content).to include("find('.selector')")
|
|
360
|
-
end
|
|
361
|
-
|
|
362
|
-
it 'has no private section' do
|
|
363
|
-
expect(component_content).not_to include('private')
|
|
364
|
-
end
|
|
365
|
-
|
|
366
|
-
it 'does not have driver.find_element' do
|
|
367
|
-
expect(component_content).not_to include('driver.find_element')
|
|
368
|
-
end
|
|
369
|
-
end
|
|
370
|
-
|
|
371
311
|
shared_examples 'watir scaffolded component' do
|
|
372
312
|
it 'has browser.element example' do
|
|
373
313
|
expect(component_content).to include('browser.element')
|
|
@@ -503,136 +443,6 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
503
443
|
include_examples 'valid scaffolded helper'
|
|
504
444
|
end
|
|
505
445
|
|
|
506
|
-
# ── CRUD scaffold ──────────────────────
|
|
507
|
-
# CrudGenerator checks Dir.exist?('features'), Dir.exist?('test') separately.
|
|
508
|
-
|
|
509
|
-
describe 'CRUD scaffold' do
|
|
510
|
-
before do
|
|
511
|
-
scaffold.new.invoke(:scaffold, nil, %w[product --crud])
|
|
512
|
-
end
|
|
513
|
-
|
|
514
|
-
after do
|
|
515
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
516
|
-
FileUtils.rm_f("page_objects/pages/#{page}.rb")
|
|
517
|
-
FileUtils.rm_f("spec/#{page}_page_spec.rb")
|
|
518
|
-
FileUtils.rm_f("features/#{page}.feature")
|
|
519
|
-
FileUtils.rm_f("features/step_definitions/#{page}_steps.rb")
|
|
520
|
-
end
|
|
521
|
-
FileUtils.rm_rf('features') unless framework == 'cucumber'
|
|
522
|
-
FileUtils.rm_rf('spec') unless framework == 'rspec'
|
|
523
|
-
FileUtils.rm_f('models/data/product.yml')
|
|
524
|
-
end
|
|
525
|
-
|
|
526
|
-
it 'creates pages for all CRUD actions' do
|
|
527
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
528
|
-
expect(Pathname.new("page_objects/pages/#{page}.rb")).to be_file
|
|
529
|
-
end
|
|
530
|
-
end
|
|
531
|
-
|
|
532
|
-
it 'creates model data file' do
|
|
533
|
-
expect(Pathname.new('models/data/product.yml')).to be_file
|
|
534
|
-
end
|
|
535
|
-
|
|
536
|
-
it 'model data has expected sections' do
|
|
537
|
-
content = File.read('models/data/product.yml')
|
|
538
|
-
expect(content).to include('default:')
|
|
539
|
-
expect(content).to include('valid:')
|
|
540
|
-
expect(content).to include('invalid:')
|
|
541
|
-
end
|
|
542
|
-
|
|
543
|
-
if framework == 'cucumber'
|
|
544
|
-
it 'creates feature files for all CRUD actions' do
|
|
545
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
546
|
-
expect(Pathname.new("features/#{page}.feature")).to be_file
|
|
547
|
-
end
|
|
548
|
-
end
|
|
549
|
-
|
|
550
|
-
it 'creates step files for all CRUD actions' do
|
|
551
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
552
|
-
expect(Pathname.new("features/step_definitions/#{page}_steps.rb")).to be_file
|
|
553
|
-
end
|
|
554
|
-
end
|
|
555
|
-
elsif framework == 'rspec'
|
|
556
|
-
it 'creates spec files for all CRUD actions' do
|
|
557
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
558
|
-
expect(Pathname.new("spec/#{page}_page_spec.rb")).to be_file
|
|
559
|
-
end
|
|
560
|
-
end
|
|
561
|
-
else # minitest — CrudGenerator checks test/ and generates specs
|
|
562
|
-
it 'creates spec files for all CRUD actions' do
|
|
563
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
564
|
-
expect(Pathname.new("spec/#{page}_page_spec.rb")).to be_file
|
|
565
|
-
end
|
|
566
|
-
end
|
|
567
|
-
end
|
|
568
|
-
|
|
569
|
-
it 'all CRUD pages have valid Ruby syntax' do
|
|
570
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
571
|
-
content = File.read("page_objects/pages/#{page}.rb")
|
|
572
|
-
expect(content).to have_valid_ruby_syntax
|
|
573
|
-
end
|
|
574
|
-
end
|
|
575
|
-
|
|
576
|
-
it 'all CRUD pages have frozen_string_literal' do
|
|
577
|
-
%w[product_list product_create product_detail product_edit].each do |page|
|
|
578
|
-
content = File.read("page_objects/pages/#{page}.rb")
|
|
579
|
-
expect(content).to have_frozen_string_literal
|
|
580
|
-
end
|
|
581
|
-
end
|
|
582
|
-
end
|
|
583
|
-
|
|
584
|
-
# ── Selective --with ───────────────────
|
|
585
|
-
|
|
586
|
-
describe 'selective scaffold' do
|
|
587
|
-
after do
|
|
588
|
-
%w[settings payment order].each do |name|
|
|
589
|
-
FileUtils.rm_f("page_objects/pages/#{name}.rb")
|
|
590
|
-
FileUtils.rm_f("spec/#{name}_page_spec.rb")
|
|
591
|
-
FileUtils.rm_f("helpers/#{name}_helper.rb")
|
|
592
|
-
FileUtils.rm_f("models/data/#{name}.yml")
|
|
593
|
-
end
|
|
594
|
-
FileUtils.rm_rf('features') unless framework == 'cucumber'
|
|
595
|
-
FileUtils.rm_rf('spec') unless framework == 'rspec'
|
|
596
|
-
end
|
|
597
|
-
|
|
598
|
-
it 'generates only page when --with page' do
|
|
599
|
-
scaffold.new.invoke(:scaffold, nil, %w[settings --with page])
|
|
600
|
-
expect(Pathname.new('page_objects/pages/settings.rb')).to be_file
|
|
601
|
-
expect(Pathname.new('spec/settings_page_spec.rb')).not_to be_file
|
|
602
|
-
expect(Pathname.new('features/settings.feature')).not_to be_file
|
|
603
|
-
end
|
|
604
|
-
|
|
605
|
-
it 'generates page and helper with --with page helper' do
|
|
606
|
-
scaffold.new.invoke(:scaffold, nil, %w[payment --with page helper])
|
|
607
|
-
expect(Pathname.new('page_objects/pages/payment.rb')).to be_file
|
|
608
|
-
expect(Pathname.new('helpers/payment_helper.rb')).to be_file
|
|
609
|
-
end
|
|
610
|
-
|
|
611
|
-
it 'generates model data with --with model' do
|
|
612
|
-
scaffold.new.invoke(:scaffold, nil, %w[order --with model])
|
|
613
|
-
expect(Pathname.new('models/data/order.yml')).to be_file
|
|
614
|
-
end
|
|
615
|
-
end
|
|
616
|
-
|
|
617
|
-
# ── Destroy ────────────────────────────
|
|
618
|
-
|
|
619
|
-
describe 'destroy' do
|
|
620
|
-
it 'removes scaffolded files' do
|
|
621
|
-
scaffold.new.invoke(:scaffold, nil, %w[temp_item])
|
|
622
|
-
expect(Pathname.new('page_objects/pages/temp_item.rb')).to be_file
|
|
623
|
-
|
|
624
|
-
scaffold.new.invoke(:destroy, nil, %w[temp_item])
|
|
625
|
-
expect(Pathname.new('page_objects/pages/temp_item.rb')).not_to be_file
|
|
626
|
-
|
|
627
|
-
if style == :spec
|
|
628
|
-
expect(Pathname.new('spec/temp_item_page_spec.rb')).not_to be_file
|
|
629
|
-
else
|
|
630
|
-
expect(Pathname.new('features/temp_item.feature')).not_to be_file
|
|
631
|
-
expect(Pathname.new('features/step_definitions/temp_item_steps.rb')).not_to be_file
|
|
632
|
-
end
|
|
633
|
-
end
|
|
634
|
-
end
|
|
635
|
-
|
|
636
446
|
# ── Batch scaffold ─────────────────────
|
|
637
447
|
|
|
638
448
|
describe 'batch scaffold' do
|
|
@@ -719,56 +529,11 @@ describe 'Scaffolding E2E' do # rubocop:disable RSpec/DescribeClass
|
|
|
719
529
|
case automation
|
|
720
530
|
when 'selenium' then expect(content).to include('LoginPage.new(driver)')
|
|
721
531
|
when 'watir' then expect(content).to include('LoginPage.new(browser)')
|
|
722
|
-
when 'capybara' then expect(content).to include('LoginPage.new')
|
|
723
532
|
end
|
|
724
533
|
end
|
|
725
534
|
end
|
|
726
535
|
end
|
|
727
536
|
|
|
728
|
-
# ── Template overrides ─────────────────
|
|
729
|
-
|
|
730
|
-
describe 'template overrides' do
|
|
731
|
-
after do
|
|
732
|
-
FileUtils.rm_rf('.ruby_raider')
|
|
733
|
-
FileUtils.rm_f('page_objects/pages/custom_override.rb')
|
|
734
|
-
FileUtils.rm_f('page_objects/pages/default_fallback.rb')
|
|
735
|
-
end
|
|
736
|
-
|
|
737
|
-
it 'uses override template when present' do
|
|
738
|
-
FileUtils.mkdir_p('.ruby_raider/templates')
|
|
739
|
-
File.write('.ruby_raider/templates/page_object.tt', <<~ERB)
|
|
740
|
-
# frozen_string_literal: true
|
|
741
|
-
|
|
742
|
-
class <%= page_class_name %> < Page
|
|
743
|
-
# E2E_CUSTOM_MARKER
|
|
744
|
-
end
|
|
745
|
-
ERB
|
|
746
|
-
|
|
747
|
-
scaffold.new.invoke(:page, nil, %w[custom_override])
|
|
748
|
-
content = File.read('page_objects/pages/custom_override.rb')
|
|
749
|
-
expect(content).to include('E2E_CUSTOM_MARKER')
|
|
750
|
-
expect(content).to include('class CustomOverridePage < Page')
|
|
751
|
-
end
|
|
752
|
-
|
|
753
|
-
it 'falls back to default template without override' do
|
|
754
|
-
scaffold.new.invoke(:page, nil, %w[default_fallback])
|
|
755
|
-
content = File.read('page_objects/pages/default_fallback.rb')
|
|
756
|
-
expect(content).not_to include('E2E_CUSTOM_MARKER')
|
|
757
|
-
expect(content).to include('class DefaultFallbackPage < Page')
|
|
758
|
-
end
|
|
759
|
-
end
|
|
760
|
-
|
|
761
|
-
# ── Dry run ────────────────────────────
|
|
762
|
-
|
|
763
|
-
describe 'dry run' do
|
|
764
|
-
it 'does not create files with --dry-run' do
|
|
765
|
-
expect do
|
|
766
|
-
scaffold.new.invoke(:page, nil, %w[phantom --dry-run])
|
|
767
|
-
end.to output(/phantom/).to_stdout
|
|
768
|
-
|
|
769
|
-
expect(Pathname.new('page_objects/pages/phantom.rb')).not_to be_file
|
|
770
|
-
end
|
|
771
|
-
end
|
|
772
537
|
end
|
|
773
538
|
end
|
|
774
539
|
end
|
|
@@ -2,12 +2,10 @@ module SettingsHelper
|
|
|
2
2
|
def create_settings(options)
|
|
3
3
|
automation = options[:automation]
|
|
4
4
|
framework = options[:framework]
|
|
5
|
-
ci_platform = options[:ci_platform]
|
|
6
5
|
{
|
|
7
6
|
automation:,
|
|
8
7
|
framework:,
|
|
9
|
-
|
|
10
|
-
name: ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}"
|
|
8
|
+
name: "#{framework}_#{automation}"
|
|
11
9
|
}
|
|
12
10
|
end
|
|
13
11
|
end
|
|
@@ -5,15 +5,13 @@ require 'rspec'
|
|
|
5
5
|
require_relative '../../lib/generators/invoke_generators'
|
|
6
6
|
require_relative 'settings_helper'
|
|
7
7
|
|
|
8
|
-
AUTOMATION_TYPES = %w[android ios selenium watir cross_platform
|
|
9
|
-
FRAMEWORKS = %w[cucumber rspec
|
|
10
|
-
CI_PLATFORMS = [nil, 'github', 'gitlab'].freeze
|
|
8
|
+
AUTOMATION_TYPES = %w[android ios selenium watir cross_platform].freeze
|
|
9
|
+
FRAMEWORKS = %w[cucumber rspec].freeze
|
|
11
10
|
|
|
12
11
|
# Named constants for readable spec references — no more fragile numeric indices
|
|
13
12
|
module FrameworkIndex
|
|
14
13
|
CUCUMBER = FRAMEWORKS[0]
|
|
15
14
|
RSPEC = FRAMEWORKS[1]
|
|
16
|
-
MINITEST = FRAMEWORKS[2]
|
|
17
15
|
end
|
|
18
16
|
|
|
19
17
|
module AutomationIndex
|
|
@@ -22,17 +20,16 @@ module AutomationIndex
|
|
|
22
20
|
SELENIUM = AUTOMATION_TYPES[2]
|
|
23
21
|
WATIR = AUTOMATION_TYPES[3]
|
|
24
22
|
CROSS_PLATFORM = AUTOMATION_TYPES[4]
|
|
25
|
-
CAPYBARA = AUTOMATION_TYPES[5]
|
|
26
23
|
end
|
|
27
24
|
|
|
28
25
|
# Lazy project generation — only generates a project the first time it's needed.
|
|
29
|
-
# Replaces the old before(:all) that generated all
|
|
26
|
+
# Replaces the old before(:all) that generated all combinations upfront.
|
|
30
27
|
module LazyProjectGenerator
|
|
31
28
|
GENERATED = Set.new
|
|
32
29
|
MUTEX = Mutex.new
|
|
33
30
|
|
|
34
|
-
def ensure_project(framework:, automation
|
|
35
|
-
settings = create_settings(framework:, automation
|
|
31
|
+
def ensure_project(framework:, automation:)
|
|
32
|
+
settings = create_settings(framework:, automation:)
|
|
36
33
|
project_name = settings[:name]
|
|
37
34
|
|
|
38
35
|
MUTEX.synchronize do
|
|
@@ -57,9 +54,7 @@ RSpec.configure do |config|
|
|
|
57
54
|
# Individual specs can also call ensure_project() for on-demand generation.
|
|
58
55
|
FRAMEWORKS.each do |framework|
|
|
59
56
|
AUTOMATION_TYPES.each do |automation|
|
|
60
|
-
|
|
61
|
-
ensure_project(framework:, automation:, ci_platform:)
|
|
62
|
-
end
|
|
57
|
+
ensure_project(framework:, automation:)
|
|
63
58
|
end
|
|
64
59
|
end
|
|
65
60
|
end
|