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
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
require_relative '../../../lib/generators/invoke_generators'
|
|
5
|
-
|
|
6
|
-
describe 'Reporter selection for project generation' do
|
|
7
|
-
include InvokeGenerators
|
|
8
|
-
|
|
9
|
-
after(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
10
|
-
%w[reporter_allure_test reporter_junit_test reporter_both_test reporter_none_test].each do |name|
|
|
11
|
-
FileUtils.rm_rf(name)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe 'reporter: allure' do
|
|
16
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
17
|
-
InvokeGenerators.generate_framework(
|
|
18
|
-
automation: 'selenium', framework: 'rspec', name: 'reporter_allure_test', reporter: 'allure'
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'generates allure_helper.rb' do
|
|
23
|
-
expect(File).to exist('reporter_allure_test/helpers/allure_helper.rb')
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'creates allure-results directory' do
|
|
27
|
-
expect(File).to exist('reporter_allure_test/allure-results')
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'includes allure gems in Gemfile' do
|
|
31
|
-
gemfile = File.read('reporter_allure_test/Gemfile')
|
|
32
|
-
expect(gemfile).to include('allure-rspec')
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
it 'does not include junit gem in Gemfile' do
|
|
36
|
-
gemfile = File.read('reporter_allure_test/Gemfile')
|
|
37
|
-
expect(gemfile).not_to include('rspec_junit_formatter')
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it 'references AllureHelper in spec_helper' do
|
|
41
|
-
helper = File.read('reporter_allure_test/helpers/spec_helper.rb')
|
|
42
|
-
expect(helper).to include('AllureHelper')
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
describe 'reporter: junit' do
|
|
47
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
48
|
-
InvokeGenerators.generate_framework(
|
|
49
|
-
automation: 'selenium', framework: 'rspec', name: 'reporter_junit_test', reporter: 'junit'
|
|
50
|
-
)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'does not generate allure_helper.rb' do
|
|
54
|
-
expect(File).not_to exist('reporter_junit_test/helpers/allure_helper.rb')
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
it 'does not create allure-results directory' do
|
|
58
|
-
expect(File).not_to exist('reporter_junit_test/allure-results')
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
it 'does not include allure gems in Gemfile' do
|
|
62
|
-
gemfile = File.read('reporter_junit_test/Gemfile')
|
|
63
|
-
expect(gemfile).not_to include('allure-rspec')
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it 'includes junit gem in Gemfile' do
|
|
67
|
-
gemfile = File.read('reporter_junit_test/Gemfile')
|
|
68
|
-
expect(gemfile).to include('rspec_junit_formatter')
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
it 'includes junit formatter in spec_helper' do
|
|
72
|
-
helper = File.read('reporter_junit_test/helpers/spec_helper.rb')
|
|
73
|
-
expect(helper).to include('RspecJunitFormatter')
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
it 'does not reference AllureHelper in spec_helper' do
|
|
77
|
-
helper = File.read('reporter_junit_test/helpers/spec_helper.rb')
|
|
78
|
-
expect(helper).not_to include('AllureHelper')
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it 'generates spec_helper.rb with valid syntax' do
|
|
82
|
-
helper = File.read('reporter_junit_test/helpers/spec_helper.rb')
|
|
83
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
84
|
-
end
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
describe 'reporter: both' do
|
|
88
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
89
|
-
InvokeGenerators.generate_framework(
|
|
90
|
-
automation: 'selenium', framework: 'rspec', name: 'reporter_both_test', reporter: 'both'
|
|
91
|
-
)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'generates allure_helper.rb' do
|
|
95
|
-
expect(File).to exist('reporter_both_test/helpers/allure_helper.rb')
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
it 'includes allure gems in Gemfile' do
|
|
99
|
-
gemfile = File.read('reporter_both_test/Gemfile')
|
|
100
|
-
expect(gemfile).to include('allure-rspec')
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it 'includes junit gem in Gemfile' do
|
|
104
|
-
gemfile = File.read('reporter_both_test/Gemfile')
|
|
105
|
-
expect(gemfile).to include('rspec_junit_formatter')
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
it 'references AllureHelper in spec_helper' do
|
|
109
|
-
helper = File.read('reporter_both_test/helpers/spec_helper.rb')
|
|
110
|
-
expect(helper).to include('AllureHelper')
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
it 'includes junit formatter in spec_helper' do
|
|
114
|
-
helper = File.read('reporter_both_test/helpers/spec_helper.rb')
|
|
115
|
-
expect(helper).to include('RspecJunitFormatter')
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it 'generates spec_helper.rb with valid syntax' do
|
|
119
|
-
helper = File.read('reporter_both_test/helpers/spec_helper.rb')
|
|
120
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
describe 'reporter: none' do
|
|
125
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
126
|
-
InvokeGenerators.generate_framework(
|
|
127
|
-
automation: 'selenium', framework: 'rspec', name: 'reporter_none_test', reporter: 'none'
|
|
128
|
-
)
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
it 'does not generate allure_helper.rb' do
|
|
132
|
-
expect(File).not_to exist('reporter_none_test/helpers/allure_helper.rb')
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
it 'does not create allure-results directory' do
|
|
136
|
-
expect(File).not_to exist('reporter_none_test/allure-results')
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
it 'does not include allure gems in Gemfile' do
|
|
140
|
-
gemfile = File.read('reporter_none_test/Gemfile')
|
|
141
|
-
expect(gemfile).not_to include('allure-rspec')
|
|
142
|
-
end
|
|
143
|
-
|
|
144
|
-
it 'does not include junit gem in Gemfile' do
|
|
145
|
-
gemfile = File.read('reporter_none_test/Gemfile')
|
|
146
|
-
expect(gemfile).not_to include('rspec_junit_formatter')
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
it 'does not reference AllureHelper in spec_helper' do
|
|
150
|
-
helper = File.read('reporter_none_test/helpers/spec_helper.rb')
|
|
151
|
-
expect(helper).not_to include('AllureHelper')
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
it 'generates spec_helper.rb with valid syntax' do
|
|
155
|
-
helper = File.read('reporter_none_test/helpers/spec_helper.rb')
|
|
156
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
end
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
require_relative '../../../lib/generators/invoke_generators'
|
|
5
|
-
|
|
6
|
-
describe 'Skip flags for project generation' do
|
|
7
|
-
include InvokeGenerators
|
|
8
|
-
|
|
9
|
-
after(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
10
|
-
%w[skip_allure_test skip_video_test skip_ci_test skip_all_test].each do |name|
|
|
11
|
-
FileUtils.rm_rf(name)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe '--skip-allure' do
|
|
16
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
17
|
-
InvokeGenerators.generate_framework(
|
|
18
|
-
automation: 'selenium', framework: 'rspec', name: 'skip_allure_test', skip_allure: true
|
|
19
|
-
)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'does not generate allure_helper.rb' do
|
|
23
|
-
expect(File).not_to exist('skip_allure_test/helpers/allure_helper.rb')
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
it 'does not create allure-results directory' do
|
|
27
|
-
expect(File).not_to exist('skip_allure_test/allure-results')
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'does not include allure gems in Gemfile' do
|
|
31
|
-
gemfile = File.read('skip_allure_test/Gemfile')
|
|
32
|
-
expect(gemfile).not_to include('allure-rspec')
|
|
33
|
-
expect(gemfile).not_to include('allure-ruby-commons')
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'does not reference AllureHelper in spec_helper' do
|
|
37
|
-
helper = File.read('skip_allure_test/helpers/spec_helper.rb')
|
|
38
|
-
expect(helper).not_to include('allure_helper')
|
|
39
|
-
expect(helper).not_to include('AllureHelper')
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it 'does not include allure-results in .gitignore' do
|
|
43
|
-
gitignore = File.read('skip_allure_test/.gitignore')
|
|
44
|
-
expect(gitignore).not_to include('allure-results')
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it 'still generates spec_helper.rb with valid syntax' do
|
|
48
|
-
helper = File.read('skip_allure_test/helpers/spec_helper.rb')
|
|
49
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'still has rspec-retry config' do
|
|
53
|
-
helper = File.read('skip_allure_test/helpers/spec_helper.rb')
|
|
54
|
-
expect(helper).to include('rspec/retry')
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
describe '--skip-video' do
|
|
59
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
60
|
-
InvokeGenerators.generate_framework(
|
|
61
|
-
automation: 'selenium', framework: 'rspec', name: 'skip_video_test', skip_video: true
|
|
62
|
-
)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
it 'does not generate video_helper.rb' do
|
|
66
|
-
expect(File).not_to exist('skip_video_test/helpers/video_helper.rb')
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
it 'does not reference video_helper in spec_helper' do
|
|
70
|
-
helper = File.read('skip_video_test/helpers/spec_helper.rb')
|
|
71
|
-
expect(helper).not_to include('video_helper')
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
it 'still generates allure_helper.rb' do
|
|
75
|
-
expect(File).to exist('skip_video_test/helpers/allure_helper.rb')
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
it 'still generates spec_helper.rb with valid syntax' do
|
|
79
|
-
helper = File.read('skip_video_test/helpers/spec_helper.rb')
|
|
80
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
describe '--skip-ci' do
|
|
85
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
86
|
-
InvokeGenerators.generate_framework(
|
|
87
|
-
automation: 'selenium', framework: 'rspec', name: 'skip_ci_test',
|
|
88
|
-
ci_platform: 'github', skip_ci: true
|
|
89
|
-
)
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
it 'does not generate CI pipeline files' do
|
|
93
|
-
expect(File).not_to exist('skip_ci_test/.github')
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
it 'still generates the project' do
|
|
97
|
-
expect(File).to exist('skip_ci_test/Gemfile')
|
|
98
|
-
expect(File).to exist('skip_ci_test/helpers/spec_helper.rb')
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
describe 'all skip flags combined' do
|
|
103
|
-
before(:all) do # rubocop:disable RSpec/BeforeAfterAll
|
|
104
|
-
InvokeGenerators.generate_framework(
|
|
105
|
-
automation: 'selenium', framework: 'rspec', name: 'skip_all_test',
|
|
106
|
-
ci_platform: 'github', skip_ci: true, skip_allure: true, skip_video: true
|
|
107
|
-
)
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
it 'does not generate allure_helper.rb' do
|
|
111
|
-
expect(File).not_to exist('skip_all_test/helpers/allure_helper.rb')
|
|
112
|
-
end
|
|
113
|
-
|
|
114
|
-
it 'does not generate video_helper.rb' do
|
|
115
|
-
expect(File).not_to exist('skip_all_test/helpers/video_helper.rb')
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
it 'does not generate CI files' do
|
|
119
|
-
expect(File).not_to exist('skip_all_test/.github')
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it 'still generates core project files' do
|
|
123
|
-
expect(File).to exist('skip_all_test/Gemfile')
|
|
124
|
-
expect(File).to exist('skip_all_test/Rakefile')
|
|
125
|
-
expect(File).to exist('skip_all_test/helpers/spec_helper.rb')
|
|
126
|
-
expect(File).to exist('skip_all_test/helpers/driver_helper.rb')
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
it 'generates spec_helper.rb with valid syntax' do
|
|
130
|
-
helper = File.read('skip_all_test/helpers/spec_helper.rb')
|
|
131
|
-
expect { RubyVM::InstructionSequence.compile(helper) }.not_to raise_error
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
end
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'fileutils'
|
|
4
|
-
require_relative '../../../lib/generators/invoke_generators'
|
|
5
|
-
require_relative '../settings_helper'
|
|
6
|
-
|
|
7
|
-
describe 'Visual addon generation' do
|
|
8
|
-
include InvokeGenerators
|
|
9
|
-
include SettingsHelper
|
|
10
|
-
|
|
11
|
-
# rubocop:disable RSpec/BeforeAfterAll, RSpec/InstanceVariable
|
|
12
|
-
before(:all) do
|
|
13
|
-
@visual_projects = []
|
|
14
|
-
%w[rspec cucumber minitest].each do |framework|
|
|
15
|
-
%w[selenium watir capybara].each do |automation|
|
|
16
|
-
name = "visual_#{framework}_#{automation}"
|
|
17
|
-
@visual_projects << { name:, framework:, automation: }
|
|
18
|
-
InvokeGenerators.generate_framework(
|
|
19
|
-
automation:, framework:, name:, visual: true
|
|
20
|
-
)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
after(:all) do
|
|
26
|
-
@visual_projects.each { |p| FileUtils.rm_rf(p[:name]) }
|
|
27
|
-
end
|
|
28
|
-
# rubocop:enable RSpec/BeforeAfterAll, RSpec/InstanceVariable
|
|
29
|
-
|
|
30
|
-
context 'with rspec and selenium' do
|
|
31
|
-
let(:name) { 'visual_rspec_selenium' }
|
|
32
|
-
|
|
33
|
-
it 'creates visual_helper.rb' do
|
|
34
|
-
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
it 'creates visual_spec.rb' do
|
|
38
|
-
expect(File).to exist("#{name}/spec/visual_spec.rb")
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
it 'includes chunky_png in Gemfile' do
|
|
42
|
-
gemfile = File.read("#{name}/Gemfile")
|
|
43
|
-
expect(gemfile).to include("gem 'chunky_png'")
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it 'visual helper has valid Ruby syntax' do
|
|
47
|
-
content = File.read("#{name}/helpers/visual_helper.rb")
|
|
48
|
-
expect { RubyVM::InstructionSequence.compile(content) }.not_to raise_error
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it 'visual spec has valid Ruby syntax' do
|
|
52
|
-
content = File.read("#{name}/spec/visual_spec.rb")
|
|
53
|
-
expect { RubyVM::InstructionSequence.compile(content) }.not_to raise_error
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
context 'with cucumber and selenium' do
|
|
58
|
-
let(:name) { 'visual_cucumber_selenium' }
|
|
59
|
-
|
|
60
|
-
it 'creates visual_helper.rb' do
|
|
61
|
-
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it 'creates visual.feature' do
|
|
65
|
-
expect(File).to exist("#{name}/features/visual.feature")
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
it 'creates visual_steps.rb' do
|
|
69
|
-
expect(File).to exist("#{name}/features/step_definitions/visual_steps.rb")
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
it 'includes chunky_png in Gemfile' do
|
|
73
|
-
gemfile = File.read("#{name}/Gemfile")
|
|
74
|
-
expect(gemfile).to include("gem 'chunky_png'")
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
context 'with minitest and selenium' do
|
|
79
|
-
let(:name) { 'visual_minitest_selenium' }
|
|
80
|
-
|
|
81
|
-
it 'creates visual_helper.rb' do
|
|
82
|
-
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
it 'creates test_visual.rb' do
|
|
86
|
-
expect(File).to exist("#{name}/test/test_visual.rb")
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it 'includes chunky_png in Gemfile' do
|
|
90
|
-
gemfile = File.read("#{name}/Gemfile")
|
|
91
|
-
expect(gemfile).to include("gem 'chunky_png'")
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'visual test has valid Ruby syntax' do
|
|
95
|
-
content = File.read("#{name}/test/test_visual.rb")
|
|
96
|
-
expect { RubyVM::InstructionSequence.compile(content) }.not_to raise_error
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
context 'with rspec and watir' do
|
|
101
|
-
let(:name) { 'visual_rspec_watir' }
|
|
102
|
-
|
|
103
|
-
it 'creates visual_helper.rb' do
|
|
104
|
-
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
it 'creates visual_spec.rb' do
|
|
108
|
-
expect(File).to exist("#{name}/spec/visual_spec.rb")
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
context 'with rspec and capybara' do
|
|
113
|
-
let(:name) { 'visual_rspec_capybara' }
|
|
114
|
-
|
|
115
|
-
it 'creates visual_helper.rb' do
|
|
116
|
-
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
it 'creates visual_spec.rb' do
|
|
120
|
-
expect(File).to exist("#{name}/spec/visual_spec.rb")
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
context 'without visual flag' do
|
|
125
|
-
let(:name) { 'no_visual_rspec_selenium' }
|
|
126
|
-
|
|
127
|
-
# rubocop:disable RSpec/BeforeAfterAll
|
|
128
|
-
before(:all) do
|
|
129
|
-
InvokeGenerators.generate_framework(
|
|
130
|
-
automation: 'selenium', framework: 'rspec', name: 'no_visual_rspec_selenium'
|
|
131
|
-
)
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
after(:all) do
|
|
135
|
-
FileUtils.rm_rf('no_visual_rspec_selenium')
|
|
136
|
-
end
|
|
137
|
-
# rubocop:enable RSpec/BeforeAfterAll
|
|
138
|
-
|
|
139
|
-
it 'does not create visual_helper.rb' do
|
|
140
|
-
expect(File).not_to exist("#{name}/helpers/visual_helper.rb")
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
it 'does not include chunky_png in Gemfile' do
|
|
144
|
-
gemfile = File.read("#{name}/Gemfile")
|
|
145
|
-
expect(gemfile).not_to include("gem 'chunky_png'")
|
|
146
|
-
end
|
|
147
|
-
end
|
|
148
|
-
end
|
data/spec/llm/client_spec.rb
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../../lib/llm/client'
|
|
4
|
-
require_relative '../../lib/llm/provider'
|
|
5
|
-
|
|
6
|
-
RSpec.describe Llm::Client do
|
|
7
|
-
let(:mock_provider) { instance_double(Llm::Provider, available?: true) }
|
|
8
|
-
let(:mock_config) { instance_double(Llm::Config, configured?: true, provider_name: 'ollama', model: 'llama3.2') }
|
|
9
|
-
|
|
10
|
-
before do
|
|
11
|
-
allow(Llm::Config).to receive(:new).and_return(mock_config)
|
|
12
|
-
allow(mock_config).to receive(:build_provider).and_return(mock_provider)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe '.complete' do
|
|
16
|
-
it 'delegates to the provider' do
|
|
17
|
-
allow(mock_provider).to receive(:complete).and_return('AI response')
|
|
18
|
-
result = described_class.complete('test prompt')
|
|
19
|
-
expect(result).to eq('AI response')
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'returns nil when not configured' do
|
|
23
|
-
allow(mock_config).to receive(:configured?).and_return(false)
|
|
24
|
-
expect(described_class.complete('test prompt')).to be_nil
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it 'returns nil when provider is not available' do
|
|
28
|
-
allow(mock_provider).to receive(:available?).and_return(false)
|
|
29
|
-
expect(described_class.complete('test prompt')).to be_nil
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'retries on failure and returns nil after max retries' do
|
|
33
|
-
allow(mock_provider).to receive(:complete).and_raise(StandardError, 'network error')
|
|
34
|
-
allow(described_class).to receive(:sleep) # skip actual sleep
|
|
35
|
-
expect(described_class.complete('test prompt')).to be_nil
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it 'passes system_prompt to provider' do
|
|
39
|
-
allow(mock_provider).to receive(:complete).and_return('ok')
|
|
40
|
-
result = described_class.complete('prompt', system_prompt: 'system')
|
|
41
|
-
expect(result).to eq('ok')
|
|
42
|
-
expect(mock_provider).to have_received(:complete).with('prompt', system_prompt: 'system')
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
describe '.available?' do
|
|
47
|
-
it 'returns true when provider is configured and available' do
|
|
48
|
-
expect(described_class).to be_available
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it 'returns false when not configured' do
|
|
52
|
-
allow(mock_config).to receive(:configured?).and_return(false)
|
|
53
|
-
expect(described_class).not_to be_available
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it 'returns false when provider is not available' do
|
|
57
|
-
allow(mock_provider).to receive(:available?).and_return(false)
|
|
58
|
-
expect(described_class).not_to be_available
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
describe '.status' do
|
|
63
|
-
it 'returns configured status with details' do
|
|
64
|
-
allow(mock_provider).to receive(:available?).and_return(true)
|
|
65
|
-
status = described_class.status
|
|
66
|
-
expect(status[:configured]).to be true
|
|
67
|
-
expect(status[:provider]).to eq('ollama')
|
|
68
|
-
expect(status[:model]).to eq('llama3.2')
|
|
69
|
-
expect(status[:available]).to be true
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
it 'returns unconfigured status' do
|
|
73
|
-
allow(mock_config).to receive(:configured?).and_return(false)
|
|
74
|
-
status = described_class.status
|
|
75
|
-
expect(status[:configured]).to be false
|
|
76
|
-
expect(status[:provider]).to be_nil
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
end
|
data/spec/llm/config_spec.rb
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../../lib/llm/config'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Llm::Config do
|
|
6
|
-
before do
|
|
7
|
-
allow(ENV).to receive(:fetch).and_call_original
|
|
8
|
-
%w[RUBY_RAIDER_LLM_PROVIDER RUBY_RAIDER_LLM_API_KEY RUBY_RAIDER_LLM_MODEL RUBY_RAIDER_LLM_URL].each do |key|
|
|
9
|
-
allow(ENV).to receive(:fetch).with(key, nil).and_return(nil)
|
|
10
|
-
end
|
|
11
|
-
allow(File).to receive(:exist?).with('config/config.yml').and_return(false)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
describe '#configured?' do
|
|
15
|
-
it 'returns false when no provider is set' do
|
|
16
|
-
expect(described_class.new).not_to be_configured
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'returns false for unknown provider' do
|
|
20
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('unknown')
|
|
21
|
-
expect(described_class.new).not_to be_configured
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
it 'returns true for ollama without api key' do
|
|
25
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('ollama')
|
|
26
|
-
expect(described_class.new).to be_configured
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'returns false for openai without api key' do
|
|
30
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('openai')
|
|
31
|
-
expect(described_class.new).not_to be_configured
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it 'returns true for openai with api key' do
|
|
35
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('openai')
|
|
36
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_API_KEY', nil).and_return('sk-test')
|
|
37
|
-
expect(described_class.new).to be_configured
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it 'returns true for anthropic with api key' do
|
|
41
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('anthropic')
|
|
42
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_API_KEY', nil).and_return('sk-ant-test')
|
|
43
|
-
expect(described_class.new).to be_configured
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
describe '#build_provider' do
|
|
48
|
-
it 'returns nil when not configured' do
|
|
49
|
-
expect(described_class.new.build_provider).to be_nil
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
it 'builds OpenaiProvider for openai' do
|
|
53
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('openai')
|
|
54
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_API_KEY', nil).and_return('sk-test')
|
|
55
|
-
provider = described_class.new.build_provider
|
|
56
|
-
expect(provider).to be_a(Llm::Providers::OpenaiProvider)
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it 'builds AnthropicProvider for anthropic' do
|
|
60
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('anthropic')
|
|
61
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_API_KEY', nil).and_return('sk-ant-test')
|
|
62
|
-
provider = described_class.new.build_provider
|
|
63
|
-
expect(provider).to be_a(Llm::Providers::AnthropicProvider)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it 'builds OllamaProvider for ollama' do
|
|
67
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('ollama')
|
|
68
|
-
provider = described_class.new.build_provider
|
|
69
|
-
expect(provider).to be_a(Llm::Providers::OllamaProvider)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
describe 'config file fallback' do
|
|
74
|
-
it 'reads from config/config.yml when env vars are not set' do
|
|
75
|
-
allow(File).to receive(:exist?).with('config/config.yml').and_return(true)
|
|
76
|
-
allow(YAML).to receive(:load_file).with('config/config.yml').and_return(
|
|
77
|
-
'llm_provider' => 'ollama',
|
|
78
|
-
'llm_model' => 'codellama'
|
|
79
|
-
)
|
|
80
|
-
config = described_class.new
|
|
81
|
-
expect(config.provider_name).to eq('ollama')
|
|
82
|
-
expect(config.model).to eq('codellama')
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
it 'env vars take precedence over config file' do
|
|
86
|
-
allow(ENV).to receive(:fetch).with('RUBY_RAIDER_LLM_PROVIDER', nil).and_return('anthropic')
|
|
87
|
-
allow(File).to receive(:exist?).with('config/config.yml').and_return(true)
|
|
88
|
-
allow(YAML).to receive(:load_file).with('config/config.yml').and_return('llm_provider' => 'ollama')
|
|
89
|
-
expect(described_class.new.provider_name).to eq('anthropic')
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
data/spec/llm/prompts_spec.rb
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../../lib/llm/prompts'
|
|
4
|
-
|
|
5
|
-
RSpec.describe Llm::Prompts do
|
|
6
|
-
describe '.analyze_page' do
|
|
7
|
-
it 'includes URL and HTML in prompt' do
|
|
8
|
-
prompt = described_class.analyze_page('<html>test</html>', 'https://example.com')
|
|
9
|
-
expect(prompt).to include('https://example.com')
|
|
10
|
-
expect(prompt).to include('<html>test</html>')
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it 'truncates HTML at 8000 characters' do
|
|
14
|
-
long_html = 'x' * 10_000
|
|
15
|
-
prompt = described_class.analyze_page(long_html, 'https://example.com')
|
|
16
|
-
expect(prompt.length).to be < 10_000
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it 'requests JSON output' do
|
|
20
|
-
prompt = described_class.analyze_page('<html></html>', 'https://example.com')
|
|
21
|
-
expect(prompt).to include('JSON')
|
|
22
|
-
expect(prompt).to include('elements')
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
describe '.generate_test_scenarios' do
|
|
27
|
-
let(:methods) { [{ name: 'login', params: %w[user pass] }, { name: 'logout', params: [] }] }
|
|
28
|
-
|
|
29
|
-
it 'includes class and method info' do
|
|
30
|
-
prompt = described_class.generate_test_scenarios('LoginPage', methods, 'selenium', 'rspec')
|
|
31
|
-
expect(prompt).to include('LoginPage')
|
|
32
|
-
expect(prompt).to include('login(user, pass)')
|
|
33
|
-
expect(prompt).to include('logout')
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it 'includes automation and framework context' do
|
|
37
|
-
prompt = described_class.generate_test_scenarios('LoginPage', methods, 'selenium', 'rspec')
|
|
38
|
-
expect(prompt).to include('selenium')
|
|
39
|
-
expect(prompt).to include('rspec')
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
describe '.system_prompt' do
|
|
44
|
-
it 'returns a non-empty string' do
|
|
45
|
-
expect(described_class.system_prompt).to be_a(String)
|
|
46
|
-
expect(described_class.system_prompt).not_to be_empty
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
end
|