ruby_raider 2.0.0 → 3.0.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 +58 -0
- data/.github/workflows/steep.yml +21 -0
- data/.gitignore +1 -1
- data/.reek.yml +46 -4
- data/.ruby-version +1 -1
- data/README.md +138 -77
- data/Steepfile +22 -0
- data/assets/ruby_raider_logo.svg +51 -0
- data/lib/adopter/adopt_menu.rb +11 -15
- data/lib/adopter/converters/base_converter.rb +1 -2
- data/lib/adopter/converters/identity_converter.rb +3 -6
- data/lib/adopter/migration_plan.rb +0 -1
- data/lib/adopter/plan_builder.rb +2 -5
- data/lib/adopter/project_analyzer.rb +1 -5
- data/lib/adopter/project_detector.rb +3 -5
- data/lib/commands/adopt_commands.rb +0 -1
- data/lib/commands/plugin_commands.rb +0 -2
- data/lib/commands/scaffolding_commands.rb +220 -37
- data/lib/commands/utility_commands.rb +82 -2
- data/lib/generators/automation/automation_generator.rb +0 -7
- data/lib/generators/automation/templates/partials/element.tt +1 -1
- data/lib/generators/automation/templates/partials/initialize_selector.tt +0 -7
- data/lib/generators/automation/templates/partials/url_methods.tt +0 -1
- data/lib/generators/common_generator.rb +12 -0
- data/lib/generators/cucumber/cucumber_generator.rb +36 -0
- data/lib/generators/cucumber/templates/accessibility_feature.tt +5 -0
- data/lib/generators/cucumber/templates/accessibility_steps.tt +21 -0
- data/lib/generators/cucumber/templates/cucumber.tt +8 -1
- data/lib/generators/cucumber/templates/feature.tt +0 -4
- data/lib/generators/cucumber/templates/partials/appium_env.tt +5 -0
- data/lib/generators/cucumber/templates/partials/capybara_env.tt +19 -1
- data/lib/generators/cucumber/templates/partials/driver_world.tt +1 -4
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +22 -35
- data/lib/generators/cucumber/templates/partials/watir_env.tt +20 -1
- data/lib/generators/cucumber/templates/partials/web_steps.tt +6 -12
- data/lib/generators/cucumber/templates/performance_feature.tt +5 -0
- data/lib/generators/cucumber/templates/performance_steps.tt +17 -0
- data/lib/generators/cucumber/templates/visual_feature.tt +5 -0
- data/lib/generators/cucumber/templates/visual_steps.tt +19 -0
- data/lib/generators/generator.rb +38 -7
- data/lib/generators/helper_generator.rb +24 -7
- data/lib/generators/infrastructure/templates/github.tt +1 -1
- data/lib/generators/infrastructure/templates/github_appium.tt +2 -2
- data/lib/generators/infrastructure/templates/gitlab.tt +1 -1
- data/lib/generators/invoke_generators.rb +42 -9
- data/lib/generators/menu_generator.rb +120 -11
- data/lib/generators/minitest/minitest_generator.rb +16 -4
- data/lib/generators/minitest/templates/accessibility_test.tt +26 -0
- data/lib/generators/minitest/templates/performance_test.tt +18 -0
- data/lib/generators/minitest/templates/test.tt +5 -34
- data/lib/generators/minitest/templates/visual_test.tt +23 -0
- data/lib/generators/rspec/rspec_generator.rb +16 -4
- data/lib/generators/rspec/templates/accessibility_spec.tt +25 -0
- data/lib/generators/rspec/templates/performance_spec.tt +18 -0
- data/lib/generators/rspec/templates/spec.tt +5 -35
- data/lib/generators/rspec/templates/visual_spec.tt +20 -0
- data/lib/generators/template_renderer/partial_cache.rb +11 -1
- data/lib/generators/template_renderer/partial_resolver.rb +17 -10
- data/lib/generators/template_renderer.rb +17 -1
- data/lib/generators/templates/common/gemfile.tt +21 -6
- data/lib/generators/templates/common/git_ignore.tt +6 -1
- data/lib/generators/templates/common/partials/mobile_config.tt +5 -1
- data/lib/generators/templates/common/partials/web_config.tt +16 -7
- data/lib/generators/templates/common/rakefile.tt +36 -0
- data/lib/generators/templates/common/read_me.tt +41 -91
- data/lib/generators/templates/common/rspec.tt +3 -0
- data/lib/generators/templates/common/ruby_version.tt +1 -0
- data/lib/generators/templates/helpers/allure_helper.tt +11 -0
- data/lib/generators/templates/helpers/browser_helper.tt +12 -2
- data/lib/generators/templates/helpers/capybara_helper.tt +5 -1
- data/lib/generators/templates/helpers/debug_helper.tt +190 -0
- data/lib/generators/templates/helpers/driver_helper.tt +2 -10
- data/lib/generators/templates/helpers/partials/appium_driver.tt +0 -2
- data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +7 -0
- data/lib/generators/templates/helpers/partials/debug_start.tt +7 -0
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +1 -3
- data/lib/generators/templates/helpers/partials/selenium_driver.tt +8 -7
- data/lib/generators/templates/helpers/partials/video_start.tt +9 -0
- data/lib/generators/templates/helpers/partials/video_stop.tt +4 -0
- data/lib/generators/templates/helpers/performance_helper.tt +57 -0
- data/lib/generators/templates/helpers/spec_helper.tt +57 -8
- data/lib/generators/templates/helpers/test_helper.tt +69 -1
- data/lib/generators/templates/helpers/video_helper.tt +270 -0
- data/lib/generators/templates/helpers/visual_helper.tt +39 -46
- data/lib/llm/client.rb +79 -0
- data/lib/llm/config.rb +57 -0
- data/lib/llm/prompts.rb +84 -0
- data/lib/llm/provider.rb +27 -0
- data/lib/llm/providers/anthropic_provider.rb +43 -0
- data/lib/llm/providers/ollama_provider.rb +56 -0
- data/lib/llm/providers/openai_provider.rb +42 -0
- data/lib/llm/response_parser.rb +67 -0
- data/lib/plugin/plugin.rb +22 -20
- data/lib/plugin/plugin_exposer.rb +16 -38
- data/lib/ruby_raider.rb +47 -12
- data/lib/scaffolding/crud_generator.rb +94 -0
- data/lib/scaffolding/dry_run_presenter.rb +16 -0
- data/lib/scaffolding/name_normalizer.rb +63 -0
- data/lib/scaffolding/page_introspector.rb +45 -0
- data/lib/scaffolding/project_detector.rb +72 -0
- data/lib/scaffolding/scaffold_menu.rb +103 -0
- data/lib/scaffolding/scaffolding.rb +158 -11
- data/lib/scaffolding/templates/component.tt +30 -0
- data/lib/scaffolding/templates/feature.tt +4 -4
- data/lib/scaffolding/templates/helper.tt +15 -1
- data/lib/scaffolding/templates/page_from_url.tt +75 -0
- data/lib/scaffolding/templates/page_object.tt +50 -1
- data/lib/scaffolding/templates/spec.tt +33 -2
- data/lib/scaffolding/templates/spec_from_page.tt +31 -0
- data/lib/scaffolding/templates/spec_from_url.tt +46 -0
- data/lib/scaffolding/templates/steps.tt +17 -5
- data/lib/scaffolding/url_analyzer.rb +179 -0
- data/lib/utilities/desktop_downloader.rb +177 -0
- data/lib/utilities/logo.rb +83 -0
- data/lib/utilities/utilities.rb +53 -20
- data/lib/version +1 -1
- data/ruby_raider.gemspec +1 -0
- data/sig/adopter/adopt_menu.rbs +25 -0
- data/sig/adopter/converters/base_converter.rbs +23 -0
- data/sig/adopter/converters/identity_converter.rbs +16 -0
- data/sig/adopter/migration_plan.rbs +34 -0
- data/sig/adopter/migrator.rbs +21 -0
- data/sig/adopter/plan_builder.rbs +38 -0
- data/sig/adopter/project_analyzer.rbs +39 -0
- data/sig/adopter/project_detector.rbs +26 -0
- data/sig/commands/adopt_commands.rbs +8 -0
- data/sig/commands/loaded_commands.rbs +5 -0
- data/sig/commands/plugin_commands.rbs +9 -0
- data/sig/commands/scaffolding_commands.rbs +28 -0
- data/sig/commands/utility_commands.rbs +21 -0
- data/sig/generators/automation/automation_generator.rbs +20 -0
- data/sig/generators/common_generator.rbs +12 -0
- data/sig/generators/cucumber/cucumber_generator.rbs +16 -0
- data/sig/generators/generator.rbs +40 -0
- data/sig/generators/helper_generator.rbs +18 -0
- data/sig/generators/infrastructure/github_generator.rbs +5 -0
- data/sig/generators/infrastructure/gitlab_generator.rbs +4 -0
- data/sig/generators/invoke_generators.rbs +10 -0
- data/sig/generators/menu_generator.rbs +29 -0
- data/sig/generators/minitest/minitest_generator.rbs +8 -0
- data/sig/generators/rspec/rspec_generator.rbs +8 -0
- data/sig/generators/template_renderer/partial_cache.rbs +20 -0
- data/sig/generators/template_renderer/partial_resolver.rbs +20 -0
- data/sig/generators/template_renderer/template_error.rbs +19 -0
- data/sig/generators/template_renderer.rbs +10 -0
- data/sig/llm/client.rbs +15 -0
- data/sig/llm/config.rbs +20 -0
- data/sig/llm/prompts.rbs +8 -0
- data/sig/llm/provider.rbs +12 -0
- data/sig/llm/providers/anthropic_provider.rbs +16 -0
- data/sig/llm/providers/ollama_provider.rbs +18 -0
- data/sig/llm/providers/openai_provider.rbs +16 -0
- data/sig/llm/response_parser.rbs +13 -0
- data/sig/plugin/plugin.rbs +24 -0
- data/sig/plugin/plugin_exposer.rbs +20 -0
- data/sig/ruby_raider.rbs +15 -0
- data/sig/scaffolding/crud_generator.rbs +16 -0
- data/sig/scaffolding/dry_run_presenter.rbs +4 -0
- data/sig/scaffolding/name_normalizer.rbs +17 -0
- data/sig/scaffolding/page_introspector.rbs +14 -0
- data/sig/scaffolding/project_detector.rbs +14 -0
- data/sig/scaffolding/scaffold_menu.rbs +18 -0
- data/sig/scaffolding/scaffolding.rbs +55 -0
- data/sig/scaffolding/url_analyzer.rbs +28 -0
- data/sig/utilities/desktop_downloader.rbs +23 -0
- data/sig/utilities/logger.rbs +13 -0
- data/sig/utilities/logo.rbs +16 -0
- data/sig/utilities/utilities.rbs +30 -0
- data/sig/vendor/thor.rbs +34 -0
- data/sig/vendor/tty_prompt.rbs +15 -0
- data/spec/adopter/adopt_menu_spec.rb +12 -12
- data/spec/adopter/migration_plan_spec.rb +1 -1
- data/spec/adopter/migrator_spec.rb +2 -2
- data/spec/adopter/project_detector_spec.rb +1 -1
- data/spec/commands/raider_commands_spec.rb +129 -0
- data/spec/generators/generator_spec.rb +23 -0
- data/spec/integration/commands/scaffolding_commands_spec.rb +1 -1
- data/spec/integration/commands/utility_commands_spec.rb +23 -3
- data/spec/integration/content/ci_content_spec.rb +119 -0
- data/spec/integration/content/common_content_spec.rb +288 -0
- data/spec/integration/content/config_content_spec.rb +175 -0
- data/spec/integration/content/content_helper.rb +32 -0
- data/spec/integration/content/gemfile_content_spec.rb +209 -0
- data/spec/integration/content/helper_content_spec.rb +485 -0
- data/spec/integration/content/page_content_spec.rb +259 -0
- data/spec/integration/content/reporter_content_spec.rb +236 -0
- data/spec/integration/content/skip_flags_content_spec.rb +206 -0
- data/spec/integration/content/syntax_validation_spec.rb +30 -0
- data/spec/integration/content/test_content_spec.rb +266 -0
- data/spec/integration/end_to_end_features_spec.rb +690 -0
- data/spec/integration/end_to_end_spec.rb +52 -16
- data/spec/integration/generators/automation_generator_spec.rb +0 -12
- data/spec/integration/generators/axe_addon_spec.rb +150 -0
- data/spec/integration/generators/common_generator_spec.rb +12 -13
- data/spec/integration/generators/config_features_spec.rb +155 -0
- data/spec/integration/generators/debug_helper_spec.rb +68 -0
- data/spec/integration/generators/helpers_generator_spec.rb +0 -12
- data/spec/integration/generators/lighthouse_addon_spec.rb +132 -0
- data/spec/integration/generators/minitest_generator_spec.rb +0 -6
- data/spec/integration/generators/reporter_spec.rb +159 -0
- data/spec/integration/generators/skip_flags_spec.rb +134 -0
- data/spec/integration/generators/visual_addon_spec.rb +148 -0
- data/spec/integration/settings_helper.rb +0 -3
- data/spec/integration/spec_helper.rb +30 -13
- data/spec/llm/client_spec.rb +79 -0
- data/spec/llm/config_spec.rb +92 -0
- data/spec/llm/prompts_spec.rb +49 -0
- data/spec/llm/response_parser_spec.rb +92 -0
- data/spec/menus/adopter_adopt_menu_spec.rb +97 -0
- data/spec/menus/menu_generator_spec.rb +263 -0
- data/spec/scaffolding/name_normalizer_spec.rb +113 -0
- data/spec/scaffolding/page_introspector_spec.rb +82 -0
- data/spec/scaffolding/scaffold_project_detector_spec.rb +104 -0
- data/spec/scaffolding/scaffolding_features_spec.rb +311 -0
- data/spec/scaffolding/url_analyzer_spec.rb +110 -0
- data/spec/system/adopt_matrix_spec.rb +537 -0
- data/spec/system/adopt_spec.rb +225 -0
- data/spec/system/support/system_test_helper.rb +0 -2
- data/spec/utilities/desktop_downloader_spec.rb +92 -0
- metadata +150 -5
- data/lib/generators/automation/templates/visual_options.tt +0 -16
- data/lib/generators/templates/helpers/partials/axe_driver.tt +0 -10
- data/lib/generators/templates/helpers/visual_spec_helper.tt +0 -35
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'content_helper'
|
|
4
|
+
|
|
5
|
+
SYNTAX_WEB_AUTOMATIONS = %w[selenium watir capybara].freeze
|
|
6
|
+
SYNTAX_ALL_FRAMEWORKS = %w[cucumber rspec minitest].freeze
|
|
7
|
+
|
|
8
|
+
describe 'Ruby syntax validation' do
|
|
9
|
+
SYNTAX_ALL_FRAMEWORKS.each do |framework|
|
|
10
|
+
SYNTAX_WEB_AUTOMATIONS.each do |automation|
|
|
11
|
+
context "with #{framework} and #{automation}" do
|
|
12
|
+
project_name = "#{framework}_#{automation}"
|
|
13
|
+
|
|
14
|
+
Dir.glob("#{project_name}/**/*.rb").each do |file|
|
|
15
|
+
relative = file.sub("#{project_name}/", '')
|
|
16
|
+
|
|
17
|
+
it "#{relative} has valid Ruby syntax" do
|
|
18
|
+
content = File.read(file)
|
|
19
|
+
expect(content).to have_valid_ruby_syntax
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "#{relative} has frozen_string_literal" do
|
|
23
|
+
content = File.read(file)
|
|
24
|
+
expect(content).to have_frozen_string_literal
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'content_helper'
|
|
4
|
+
|
|
5
|
+
describe 'Test file content' do
|
|
6
|
+
# --- RSpec specs ---
|
|
7
|
+
|
|
8
|
+
shared_examples 'valid rspec spec' do |project_name|
|
|
9
|
+
subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
|
|
10
|
+
|
|
11
|
+
it 'has frozen_string_literal' do
|
|
12
|
+
expect(spec).to have_frozen_string_literal
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it 'has valid Ruby syntax' do
|
|
16
|
+
expect(spec).to have_valid_ruby_syntax
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it 'uses describe block' do
|
|
20
|
+
expect(spec).to match(/describe 'Login'/)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
it 'requires spec_helper' do
|
|
24
|
+
expect(spec).to include("require_relative '../helpers/spec_helper'")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it 'requires model_factory' do
|
|
28
|
+
expect(spec).to include("require_relative '../models/model_factory'")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
it 'requires login page' do
|
|
32
|
+
expect(spec).to include("require_relative '../page_objects/pages/login'")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
it 'has before block' do
|
|
36
|
+
expect(spec).to match(/before do/)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it 'has context blocks' do
|
|
40
|
+
expect(spec).to include("context 'with right credentials'")
|
|
41
|
+
expect(spec).to include("context 'with wrong credentials'")
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
shared_examples 'selenium rspec spec' do |project_name|
|
|
46
|
+
subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
|
|
47
|
+
|
|
48
|
+
it 'instantiates Login with driver' do
|
|
49
|
+
expect(spec).to include('Login.new(driver)')
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
it 'uses visit method' do
|
|
53
|
+
expect(spec).to include('.visit')
|
|
54
|
+
expect(spec).not_to include('.visit_page')
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
shared_examples 'watir rspec spec' do |project_name|
|
|
59
|
+
subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
|
|
60
|
+
|
|
61
|
+
it 'instantiates Login with browser' do
|
|
62
|
+
expect(spec).to include('Login.new(browser)')
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it 'uses visit method' do
|
|
66
|
+
expect(spec).to include('.visit')
|
|
67
|
+
expect(spec).not_to include('.visit_page')
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
shared_examples 'capybara rspec spec' do |project_name|
|
|
72
|
+
subject(:spec) { read_generated(project_name, 'spec/login_page_spec.rb') }
|
|
73
|
+
|
|
74
|
+
it 'instantiates Login without arguments' do
|
|
75
|
+
expect(spec).to include('Login.new')
|
|
76
|
+
expect(spec).not_to match(/Login\.new\((?:driver|browser)\)/)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
it 'uses visit_page method' do
|
|
80
|
+
expect(spec).to include('.visit_page')
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# --- Minitest tests ---
|
|
85
|
+
|
|
86
|
+
shared_examples 'valid minitest test' do |project_name|
|
|
87
|
+
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
88
|
+
|
|
89
|
+
it 'has frozen_string_literal' do
|
|
90
|
+
expect(test).to have_frozen_string_literal
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
it 'has valid Ruby syntax' do
|
|
94
|
+
expect(test).to have_valid_ruby_syntax
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it 'defines class inheriting from Minitest::Test' do
|
|
98
|
+
expect(test).to match(/class TestLogin < Minitest::Test/)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it 'requires test_helper' do
|
|
102
|
+
expect(test).to include("require_relative '../helpers/test_helper'")
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it 'has setup method' do
|
|
106
|
+
expect(test).to match(/def setup/)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
it 'has teardown method' do
|
|
110
|
+
expect(test).to match(/def teardown/)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it 'has test methods' do
|
|
114
|
+
expect(test).to match(/def test_login_with_right_credentials/)
|
|
115
|
+
expect(test).to match(/def test_login_with_wrong_credentials/)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
it 'uses assert_equal' do
|
|
119
|
+
expect(test).to include('assert_equal')
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
shared_examples 'selenium minitest test' do |project_name|
|
|
124
|
+
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
125
|
+
|
|
126
|
+
it 'instantiates Login with driver' do
|
|
127
|
+
expect(test).to include('Login.new(driver)')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
it 'uses visit method' do
|
|
131
|
+
expect(test).to include('.visit')
|
|
132
|
+
expect(test).not_to include('.visit_page')
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
shared_examples 'watir minitest test' do |project_name|
|
|
137
|
+
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
138
|
+
|
|
139
|
+
it 'instantiates Login with browser' do
|
|
140
|
+
expect(test).to include('Login.new(browser)')
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
shared_examples 'capybara minitest test' do |project_name|
|
|
145
|
+
subject(:test) { read_generated(project_name, 'test/test_login_page.rb') }
|
|
146
|
+
|
|
147
|
+
it 'instantiates Login without arguments' do
|
|
148
|
+
expect(test).to include('Login.new')
|
|
149
|
+
expect(test).not_to match(/Login\.new\((?:driver|browser)\)/)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
it 'uses visit_page method' do
|
|
153
|
+
expect(test).to include('.visit_page')
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# --- Cucumber features and steps ---
|
|
158
|
+
|
|
159
|
+
shared_examples 'valid cucumber feature' do |project_name|
|
|
160
|
+
subject(:feature) { read_generated(project_name, 'features/login.feature') }
|
|
161
|
+
|
|
162
|
+
it 'has Feature keyword' do
|
|
163
|
+
expect(feature).to match(/Feature:/)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
it 'has Scenario keyword' do
|
|
167
|
+
expect(feature).to match(/Scenario:/)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
it 'has Given/When/Then steps' do
|
|
171
|
+
expect(feature).to match(/Given/)
|
|
172
|
+
expect(feature).to match(/When/)
|
|
173
|
+
expect(feature).to match(/Then/)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
shared_examples 'valid cucumber env' do |project_name|
|
|
178
|
+
subject(:env) { read_generated(project_name, 'features/support/env.rb') }
|
|
179
|
+
|
|
180
|
+
it 'has valid Ruby syntax' do
|
|
181
|
+
expect(env).to have_valid_ruby_syntax
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
shared_examples 'valid cucumber world' do |project_name|
|
|
186
|
+
subject(:world) { read_generated(project_name, 'features/support/world.rb') }
|
|
187
|
+
|
|
188
|
+
it 'has valid Ruby syntax' do
|
|
189
|
+
expect(world).to have_valid_ruby_syntax
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
shared_examples 'valid cucumber config' do |project_name|
|
|
194
|
+
subject(:config) { read_generated(project_name, 'cucumber.yml') }
|
|
195
|
+
|
|
196
|
+
it 'has default profile' do
|
|
197
|
+
expect(config).to include('default:')
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# --- RSpec contexts ---
|
|
202
|
+
|
|
203
|
+
context 'with rspec and selenium' do
|
|
204
|
+
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
|
|
205
|
+
include_examples 'valid rspec spec', name
|
|
206
|
+
include_examples 'selenium rspec spec', name
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
context 'with rspec and watir' do
|
|
210
|
+
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
|
|
211
|
+
include_examples 'valid rspec spec', name
|
|
212
|
+
include_examples 'watir rspec spec', name
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
context 'with rspec and capybara' do
|
|
216
|
+
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
|
|
217
|
+
include_examples 'valid rspec spec', name
|
|
218
|
+
include_examples 'capybara rspec spec', name
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# --- Minitest contexts ---
|
|
222
|
+
|
|
223
|
+
context 'with minitest and selenium' do
|
|
224
|
+
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
|
|
225
|
+
include_examples 'valid minitest test', name
|
|
226
|
+
include_examples 'selenium minitest test', name
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
context 'with minitest and watir' do
|
|
230
|
+
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
|
|
231
|
+
include_examples 'valid minitest test', name
|
|
232
|
+
include_examples 'watir minitest test', name
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
context 'with minitest and capybara' do
|
|
236
|
+
name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
|
|
237
|
+
include_examples 'valid minitest test', name
|
|
238
|
+
include_examples 'capybara minitest test', name
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# --- Cucumber contexts ---
|
|
242
|
+
|
|
243
|
+
context 'with cucumber and selenium' do
|
|
244
|
+
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
|
|
245
|
+
include_examples 'valid cucumber feature', name
|
|
246
|
+
include_examples 'valid cucumber env', name
|
|
247
|
+
include_examples 'valid cucumber world', name
|
|
248
|
+
include_examples 'valid cucumber config', name
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
context 'with cucumber and watir' do
|
|
252
|
+
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::WATIR}"
|
|
253
|
+
include_examples 'valid cucumber feature', name
|
|
254
|
+
include_examples 'valid cucumber env', name
|
|
255
|
+
include_examples 'valid cucumber world', name
|
|
256
|
+
include_examples 'valid cucumber config', name
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
context 'with cucumber and capybara' do
|
|
260
|
+
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
|
|
261
|
+
include_examples 'valid cucumber feature', name
|
|
262
|
+
include_examples 'valid cucumber env', name
|
|
263
|
+
include_examples 'valid cucumber world', name
|
|
264
|
+
include_examples 'valid cucumber config', name
|
|
265
|
+
end
|
|
266
|
+
end
|