ruby_raider 3.0.0 → 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.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/e2e_tests.yml +0 -17
  3. data/.github/workflows/system_tests.yml +0 -22
  4. data/README.md +8 -62
  5. data/lib/commands/scaffolding_commands.rb +22 -188
  6. data/lib/commands/utility_commands.rb +10 -44
  7. data/lib/generators/automation/templates/login.tt +1 -9
  8. data/lib/generators/automation/templates/page.tt +1 -7
  9. data/lib/generators/automation/templates/partials/initialize_selector.tt +1 -3
  10. data/lib/generators/automation/templates/partials/visit_method.tt +2 -6
  11. data/lib/generators/common_generator.rb +0 -6
  12. data/lib/generators/cucumber/cucumber_generator.rb +0 -24
  13. data/lib/generators/cucumber/templates/accessibility_steps.tt +2 -6
  14. data/lib/generators/cucumber/templates/cucumber.tt +0 -7
  15. data/lib/generators/cucumber/templates/env.tt +1 -3
  16. data/lib/generators/cucumber/templates/partials/appium_env.tt +1 -6
  17. data/lib/generators/cucumber/templates/partials/selenium_env.tt +0 -5
  18. data/lib/generators/cucumber/templates/partials/watir_env.tt +0 -5
  19. data/lib/generators/cucumber/templates/partials/web_steps.tt +4 -4
  20. data/lib/generators/cucumber/templates/world.tt +1 -3
  21. data/lib/generators/generator.rb +2 -46
  22. data/lib/generators/helper_generator.rb +4 -42
  23. data/lib/generators/infrastructure/templates/github.tt +2 -2
  24. data/lib/generators/infrastructure/templates/github_appium.tt +2 -6
  25. data/lib/generators/invoke_generators.rb +4 -25
  26. data/lib/generators/menu_generator.rb +10 -100
  27. data/lib/generators/rspec/rspec_generator.rb +0 -11
  28. data/lib/generators/rspec/templates/accessibility_spec.tt +2 -6
  29. data/lib/generators/rspec/templates/spec.tt +6 -8
  30. data/lib/generators/templates/common/gemfile.tt +0 -26
  31. data/lib/generators/templates/common/git_ignore.tt +0 -2
  32. data/lib/generators/templates/common/partials/mobile_config.tt +0 -4
  33. data/lib/generators/templates/common/partials/web_config.tt +0 -4
  34. data/lib/generators/templates/common/rakefile.tt +0 -9
  35. data/lib/generators/templates/common/read_me.tt +4 -10
  36. data/lib/generators/templates/helpers/allure_helper.tt +0 -10
  37. data/lib/generators/templates/helpers/browser_helper.tt +1 -1
  38. data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +1 -3
  39. data/lib/generators/templates/helpers/partials/debug_start.tt +1 -3
  40. data/lib/generators/templates/helpers/partials/quit_driver.tt +1 -3
  41. data/lib/generators/templates/helpers/partials/screenshot.tt +1 -3
  42. data/lib/generators/templates/helpers/partials/selenium_driver.tt +1 -1
  43. data/lib/generators/templates/helpers/spec_helper.tt +2 -39
  44. data/lib/ruby_raider.rb +2 -50
  45. data/lib/scaffolding/project_detector.rb +30 -13
  46. data/lib/scaffolding/scaffolding.rb +0 -109
  47. data/lib/scaffolding/templates/component.tt +1 -4
  48. data/lib/scaffolding/templates/page_object.tt +0 -10
  49. data/lib/scaffolding/templates/spec.tt +2 -6
  50. data/lib/scaffolding/templates/steps.tt +0 -2
  51. data/lib/utilities/utilities.rb +26 -24
  52. data/lib/version +1 -1
  53. data/sig/commands/scaffolding_commands.rbs +0 -12
  54. data/sig/commands/utility_commands.rbs +0 -6
  55. data/sig/generators/cucumber/cucumber_generator.rbs +0 -4
  56. data/sig/generators/generator.rbs +0 -11
  57. data/sig/generators/helper_generator.rbs +1 -5
  58. data/sig/generators/invoke_generators.rbs +1 -2
  59. data/sig/generators/menu_generator.rbs +2 -6
  60. data/sig/generators/rspec/rspec_generator.rbs +0 -2
  61. data/sig/ruby_raider.rbs +1 -3
  62. data/sig/scaffolding/project_detector.rbs +0 -1
  63. data/sig/scaffolding/scaffolding.rbs +0 -23
  64. data/sig/utilities/utilities.rbs +0 -4
  65. data/spec/commands/raider_commands_spec.rb +0 -61
  66. data/spec/commands/scaffolding_commands_spec.rb +22 -0
  67. data/spec/integration/commands/browser_update_after_creation_spec.rb +123 -0
  68. data/spec/integration/commands/scaffolding_commands_spec.rb +0 -20
  69. data/spec/integration/commands/utility_commands_spec.rb +9 -9
  70. data/spec/integration/content/ci_content_spec.rb +6 -61
  71. data/spec/integration/content/common_content_spec.rb +0 -64
  72. data/spec/integration/content/config_content_spec.rb +1 -51
  73. data/spec/integration/content/content_helper.rb +2 -2
  74. data/spec/integration/content/gemfile_content_spec.rb +0 -71
  75. data/spec/integration/content/helper_content_spec.rb +4 -240
  76. data/spec/integration/content/page_content_spec.rb +0 -89
  77. data/spec/integration/content/syntax_validation_spec.rb +2 -2
  78. data/spec/integration/content/test_content_spec.rb +0 -119
  79. data/spec/integration/end_to_end_features_spec.rb +13 -411
  80. data/spec/integration/end_to_end_spec.rb +0 -96
  81. data/spec/integration/generators/axe_addon_spec.rb +2 -52
  82. data/spec/integration/generators/common_generator_spec.rb +1 -13
  83. data/spec/integration/generators/config_features_spec.rb +3 -81
  84. data/spec/integration/generators/debug_helper_spec.rb +0 -20
  85. data/spec/integration/generators/github_generator_spec.rb +5 -15
  86. data/spec/integration/generators/helpers_generator_spec.rb +0 -37
  87. data/spec/integration/scaffolding_e2e_spec.rb +540 -0
  88. data/spec/integration/settings_helper.rb +1 -3
  89. data/spec/integration/spec_helper.rb +6 -11
  90. data/spec/menus/menu_generator_spec.rb +4 -107
  91. data/spec/scaffolding/scaffold_project_detector_spec.rb +42 -26
  92. data/spec/scaffolding/scaffolding_features_spec.rb +0 -183
  93. data/spec/system/selenium_spec.rb +1 -4
  94. data/spec/system/support/system_test_helper.rb +0 -1
  95. data/spec/system/watir_spec.rb +1 -4
  96. data/spec/utilities/headless_config_spec.rb +82 -0
  97. data/spec/utilities/utilities_spec.rb +105 -0
  98. metadata +7 -97
  99. data/lib/adopter/adopt_menu.rb +0 -146
  100. data/lib/adopter/converters/base_converter.rb +0 -84
  101. data/lib/adopter/converters/identity_converter.rb +0 -53
  102. data/lib/adopter/migration_plan.rb +0 -74
  103. data/lib/adopter/migrator.rb +0 -96
  104. data/lib/adopter/plan_builder.rb +0 -275
  105. data/lib/adopter/project_analyzer.rb +0 -252
  106. data/lib/adopter/project_detector.rb +0 -157
  107. data/lib/generators/cucumber/templates/partials/capybara_env.tt +0 -38
  108. data/lib/generators/cucumber/templates/partials/capybara_world.tt +0 -6
  109. data/lib/generators/cucumber/templates/performance_feature.tt +0 -5
  110. data/lib/generators/cucumber/templates/performance_steps.tt +0 -17
  111. data/lib/generators/cucumber/templates/visual_feature.tt +0 -5
  112. data/lib/generators/cucumber/templates/visual_steps.tt +0 -19
  113. data/lib/generators/infrastructure/gitlab_generator.rb +0 -11
  114. data/lib/generators/infrastructure/templates/gitlab.tt +0 -46
  115. data/lib/generators/minitest/minitest_generator.rb +0 -35
  116. data/lib/generators/minitest/templates/accessibility_test.tt +0 -26
  117. data/lib/generators/minitest/templates/performance_test.tt +0 -18
  118. data/lib/generators/minitest/templates/test.tt +0 -64
  119. data/lib/generators/minitest/templates/visual_test.tt +0 -23
  120. data/lib/generators/rspec/templates/performance_spec.tt +0 -18
  121. data/lib/generators/rspec/templates/visual_spec.tt +0 -20
  122. data/lib/generators/templates/helpers/capybara_helper.tt +0 -32
  123. data/lib/generators/templates/helpers/performance_helper.tt +0 -57
  124. data/lib/generators/templates/helpers/visual_helper.tt +0 -58
  125. data/lib/llm/client.rb +0 -79
  126. data/lib/llm/config.rb +0 -57
  127. data/lib/llm/prompts.rb +0 -84
  128. data/lib/llm/provider.rb +0 -27
  129. data/lib/llm/providers/anthropic_provider.rb +0 -43
  130. data/lib/llm/providers/ollama_provider.rb +0 -56
  131. data/lib/llm/providers/openai_provider.rb +0 -42
  132. data/lib/llm/response_parser.rb +0 -67
  133. data/lib/plugin/plugin.rb +0 -111
  134. data/lib/plugin/plugin_exposer.rb +0 -55
  135. data/lib/scaffolding/crud_generator.rb +0 -94
  136. data/lib/scaffolding/dry_run_presenter.rb +0 -16
  137. data/lib/scaffolding/page_introspector.rb +0 -45
  138. data/lib/scaffolding/scaffold_menu.rb +0 -103
  139. data/lib/scaffolding/templates/page_from_url.tt +0 -75
  140. data/lib/scaffolding/templates/spec_from_page.tt +0 -31
  141. data/lib/scaffolding/templates/spec_from_url.tt +0 -46
  142. data/lib/scaffolding/url_analyzer.rb +0 -179
  143. data/sig/adopter/adopt_menu.rbs +0 -25
  144. data/sig/adopter/converters/base_converter.rbs +0 -23
  145. data/sig/adopter/converters/identity_converter.rbs +0 -16
  146. data/sig/adopter/migration_plan.rbs +0 -34
  147. data/sig/adopter/migrator.rbs +0 -21
  148. data/sig/adopter/plan_builder.rbs +0 -38
  149. data/sig/adopter/project_analyzer.rbs +0 -39
  150. data/sig/adopter/project_detector.rbs +0 -26
  151. data/sig/generators/infrastructure/gitlab_generator.rbs +0 -4
  152. data/sig/generators/minitest/minitest_generator.rbs +0 -8
  153. data/sig/llm/client.rbs +0 -15
  154. data/sig/llm/config.rbs +0 -20
  155. data/sig/llm/prompts.rbs +0 -8
  156. data/sig/llm/provider.rbs +0 -12
  157. data/sig/llm/providers/anthropic_provider.rbs +0 -16
  158. data/sig/llm/providers/ollama_provider.rbs +0 -18
  159. data/sig/llm/providers/openai_provider.rbs +0 -16
  160. data/sig/llm/response_parser.rbs +0 -13
  161. data/sig/plugin/plugin.rbs +0 -24
  162. data/sig/plugin/plugin_exposer.rbs +0 -20
  163. data/sig/scaffolding/crud_generator.rbs +0 -16
  164. data/sig/scaffolding/dry_run_presenter.rbs +0 -4
  165. data/sig/scaffolding/page_introspector.rbs +0 -14
  166. data/sig/scaffolding/scaffold_menu.rbs +0 -18
  167. data/sig/scaffolding/url_analyzer.rbs +0 -28
  168. data/spec/adopter/adopt_menu_spec.rb +0 -176
  169. data/spec/adopter/converters/identity_converter_spec.rb +0 -145
  170. data/spec/adopter/migration_plan_spec.rb +0 -113
  171. data/spec/adopter/migrator_spec.rb +0 -277
  172. data/spec/adopter/plan_builder_spec.rb +0 -298
  173. data/spec/adopter/project_analyzer_spec.rb +0 -337
  174. data/spec/adopter/project_detector_spec.rb +0 -295
  175. data/spec/generators/generator_spec.rb +0 -23
  176. data/spec/integration/content/reporter_content_spec.rb +0 -236
  177. data/spec/integration/content/skip_flags_content_spec.rb +0 -206
  178. data/spec/integration/generators/gitlab_generator_spec.rb +0 -38
  179. data/spec/integration/generators/lighthouse_addon_spec.rb +0 -132
  180. data/spec/integration/generators/minitest_generator_spec.rb +0 -64
  181. data/spec/integration/generators/reporter_spec.rb +0 -159
  182. data/spec/integration/generators/skip_flags_spec.rb +0 -134
  183. data/spec/integration/generators/visual_addon_spec.rb +0 -148
  184. data/spec/llm/client_spec.rb +0 -79
  185. data/spec/llm/config_spec.rb +0 -92
  186. data/spec/llm/prompts_spec.rb +0 -49
  187. data/spec/llm/response_parser_spec.rb +0 -92
  188. data/spec/menus/adopter_adopt_menu_spec.rb +0 -97
  189. data/spec/scaffolding/page_introspector_spec.rb +0 -82
  190. data/spec/scaffolding/url_analyzer_spec.rb +0 -110
  191. data/spec/system/adopt_matrix_spec.rb +0 -537
  192. data/spec/system/adopt_spec.rb +0 -225
  193. data/spec/system/capybara_spec.rb +0 -42
@@ -0,0 +1,123 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'fileutils'
4
+ require 'yaml'
5
+ require_relative '../../../lib/generators/invoke_generators'
6
+ require_relative '../../../lib/commands/utility_commands'
7
+ require_relative '../../../lib/utilities/utilities'
8
+
9
+ # Standalone test — does NOT require spec_helper to avoid generating all 54 projects.
10
+ # Generates only the specific projects needed for browser update testing.
11
+
12
+ describe 'Browser update after framework creation' do
13
+ include InvokeGenerators
14
+
15
+ orig_dir = Dir.pwd
16
+
17
+ def generate_project(framework:, automation:)
18
+ name = "browser_update_#{framework}_#{automation}"
19
+ generate_framework(automation: automation, framework: framework, name: name)
20
+ name
21
+ end
22
+
23
+ after do
24
+ Dir.chdir orig_dir
25
+ end
26
+
27
+ shared_examples 'updates browser config after creation' do |framework, automation|
28
+ before(:all) do # rubocop:disable RSpec/BeforeAfterAll
29
+ @project_name = generate_project(framework: framework, automation: automation)
30
+ end
31
+
32
+ after(:all) do # rubocop:disable RSpec/BeforeAfterAll
33
+ Dir.chdir orig_dir
34
+ FileUtils.rm_rf(@project_name) if @project_name
35
+ end
36
+
37
+ before do
38
+ Dir.chdir @project_name
39
+ end
40
+
41
+ it 'starts with chrome as default browser' do
42
+ config = YAML.load_file('config/config.yml')
43
+ expect(config['browser']).to eql 'chrome'
44
+ end
45
+
46
+ it 'strips colon prefix when setting browser' do
47
+ UtilityCommands.new.invoke(:browser, nil, %w[:firefox])
48
+ config = YAML.load_file('config/config.yml')
49
+ expect(config['browser']).to eql 'firefox'
50
+ end
51
+
52
+ it 'stores browser without colon so browser_arguments keys match' do
53
+ UtilityCommands.new.invoke(:browser, nil, %w[:firefox])
54
+ config = YAML.load_file('config/config.yml')
55
+ expect(config['browser_arguments']).to have_key('firefox')
56
+ end
57
+
58
+ it 'sets browser arguments for the current browser' do
59
+ UtilityCommands.new.invoke(:browser, nil, %w[:chrome --opts headless no-sandbox])
60
+ config = YAML.load_file('config/config.yml')
61
+ expect(config['browser']).to eql 'chrome'
62
+ expect(config['browser_arguments']['chrome']).to eql %w[headless no-sandbox]
63
+ end
64
+
65
+ it 'enables headless mode via config key' do
66
+ UtilityCommands.new.invoke(:headless, nil, %w[on])
67
+ config = YAML.load_file('config/config.yml')
68
+ expect(config['headless']).to be true
69
+ end
70
+
71
+ it 'disables headless mode via config key' do
72
+ UtilityCommands.new.invoke(:headless, nil, %w[on])
73
+ UtilityCommands.new.invoke(:headless, nil, %w[off])
74
+ config = YAML.load_file('config/config.yml')
75
+ expect(config['headless']).to be false
76
+ end
77
+
78
+ it 'updates viewport dimensions' do
79
+ UtilityCommands.new.invoke(:viewport, nil, %w[375x812])
80
+ config = YAML.load_file('config/config.yml')
81
+ expect(config['viewport']).to eq({ 'width' => 375, 'height' => 812 })
82
+ end
83
+
84
+ it 'updates timeout' do
85
+ UtilityCommands.new.invoke(:timeout, nil, %w[30])
86
+ config = YAML.load_file('config/config.yml')
87
+ expect(config['timeout']).to eq 30
88
+ end
89
+
90
+ it 'applies multiple sequential updates without losing earlier changes' do
91
+ UtilityCommands.new.invoke(:browser, nil, %w[:firefox])
92
+ UtilityCommands.new.invoke(:headless, nil, %w[on])
93
+ UtilityCommands.new.invoke(:viewport, nil, %w[1920x1080])
94
+ UtilityCommands.new.invoke(:timeout, nil, %w[15])
95
+
96
+ config = YAML.load_file('config/config.yml')
97
+ expect(config['browser']).to eql 'firefox'
98
+ expect(config['headless']).to be true
99
+ expect(config['viewport']).to eq({ 'width' => 1920, 'height' => 1080 })
100
+ expect(config['timeout']).to eq 15
101
+ end
102
+
103
+ it 'deletes browser arguments after setting them' do
104
+ UtilityCommands.new.invoke(:browser, nil, %w[:firefox --opts headless])
105
+ UtilityCommands.new.invoke(:browser, nil, %w[--delete])
106
+ config = YAML.load_file('config/config.yml')
107
+ expect(config.dig('browser_arguments', 'firefox')).to be_nil
108
+ end
109
+ end
110
+
111
+ context 'with selenium + rspec' do
112
+ include_examples 'updates browser config after creation', 'rspec', 'selenium'
113
+ end
114
+
115
+ context 'with selenium + cucumber' do
116
+ include_examples 'updates browser config after creation', 'cucumber', 'selenium'
117
+ end
118
+
119
+ context 'with watir + rspec' do
120
+ include_examples 'updates browser config after creation', 'rspec', 'watir'
121
+ end
122
+
123
+ end
@@ -34,16 +34,6 @@ describe ScaffoldingCommands do
34
34
  expect(Pathname.new("page_objects/pages/#{name}.rb")).to be_file
35
35
  end
36
36
 
37
- it 'deletes a spec' do
38
- scaffold.new.invoke(:spec, nil, %w[login --delete])
39
- expect(Pathname.new('spec/login_spec.rb')).not_to be_file
40
- end
41
-
42
- it 'deletes a helper' do
43
- scaffold.new.invoke(:helper, nil, %w[driver --delete])
44
- expect(Pathname.new('helpers/driver_helper.rb')).not_to be_file
45
- end
46
-
47
37
  it 'creates a page' do
48
38
  scaffold.new.invoke(:page, nil, %W[#{name}])
49
39
  expect(Pathname.new("page_objects/pages/#{name}.rb")).to be_file
@@ -94,16 +84,6 @@ describe ScaffoldingCommands do
94
84
  expect(Pathname.new("features/step_definitions/#{name}_steps.rb")).to be_file
95
85
  end
96
86
 
97
- it 'deletes a page' do
98
- scaffold.new.invoke(:page, nil, %w[login --delete])
99
- expect(Pathname.new('page_objects/pages/login_page.rb')).not_to be_file
100
- end
101
-
102
- it 'deletes a feature' do
103
- scaffold.new.invoke(:feature, nil, %w[login --delete])
104
- expect(Pathname.new('features/login.feature')).not_to be_file
105
- end
106
-
107
87
  it 'creates a feature' do
108
88
  scaffold.new.invoke(:feature, nil, %W[#{name} --path #{new_path}])
109
89
  expect(Pathname.new("#{new_path}/#{name}.feature")).to be_file
@@ -40,13 +40,13 @@ describe UtilityCommands do
40
40
  it 'updates the browser' do
41
41
  utility.new.invoke(:browser, nil, %w[:firefox])
42
42
  config = YAML.load_file('config/config.yml')
43
- expect(config['browser']).to eql ':firefox'
43
+ expect(config['browser']).to eql 'firefox'
44
44
  end
45
45
 
46
- it 'updates the browser options' do
46
+ it 'updates the browser arguments for the current browser' do
47
47
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless start-maximized start-fullscreen])
48
48
  config = YAML.load_file('config/config.yml')
49
- expect(config['browser_options']).to eql %w[headless start-maximized start-fullscreen]
49
+ expect(config['browser_arguments']['firefox']).to eql %w[headless start-maximized start-fullscreen]
50
50
  end
51
51
  end
52
52
 
@@ -91,23 +91,23 @@ describe UtilityCommands do
91
91
  expect(config['feature_path']).to eql path
92
92
  end
93
93
 
94
- it 'updates only the browser options' do
94
+ it 'updates the browser arguments for the current browser' do
95
95
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless])
96
96
  config = YAML.load_file('config/config.yml')
97
- expect(config['browser_options']).to eql %w[headless]
97
+ expect(config['browser_arguments']['firefox']).to eql %w[headless]
98
98
  end
99
99
 
100
- it 'deletes the browser options when passed with the delete parameter' do
100
+ it 'deletes the browser arguments when passed with the delete parameter' do
101
101
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless --delete])
102
102
  config = YAML.load_file('config/config.yml')
103
- expect(config['browser_options']).to be_nil
103
+ expect(config.dig('browser_arguments', 'firefox')).to be_nil
104
104
  end
105
105
 
106
- it 'deletes the browser options' do
106
+ it 'deletes the browser arguments' do
107
107
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless])
108
108
  utility.new.invoke(:browser, nil, %w[--delete])
109
109
  config = YAML.load_file('config/config.yml')
110
- expect(config['browser_options']).to be_nil
110
+ expect(config.dig('browser_arguments', 'firefox')).to be_nil
111
111
  end
112
112
  end
113
113
  end
@@ -4,10 +4,8 @@ require 'yaml'
4
4
  require_relative 'content_helper'
5
5
 
6
6
  describe 'CI pipeline content' do
7
- # --- GitHub Actions ---
8
-
9
7
  shared_examples 'valid github pipeline' do |project_name|
10
- subject(:pipeline) { read_generated("#{project_name}_github", '.github/workflows/test_pipeline.yml') }
8
+ subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
11
9
 
12
10
  it 'is valid YAML' do
13
11
  expect { YAML.safe_load(pipeline) }.not_to raise_error
@@ -31,7 +29,7 @@ describe 'CI pipeline content' do
31
29
  end
32
30
 
33
31
  shared_examples 'github rspec pipeline' do |project_name|
34
- subject(:pipeline) { read_generated("#{project_name}_github", '.github/workflows/test_pipeline.yml') }
32
+ subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
35
33
 
36
34
  it 'runs rspec' do
37
35
  expect(pipeline).to include('rspec')
@@ -39,81 +37,28 @@ describe 'CI pipeline content' do
39
37
  end
40
38
 
41
39
  shared_examples 'github cucumber pipeline' do |project_name|
42
- subject(:pipeline) { read_generated("#{project_name}_github", '.github/workflows/test_pipeline.yml') }
40
+ subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
43
41
 
44
42
  it 'runs cucumber' do
45
43
  expect(pipeline).to include('cucumber')
46
44
  end
47
45
  end
48
46
 
49
- shared_examples 'github minitest pipeline' do |project_name|
50
- subject(:pipeline) { read_generated("#{project_name}_github", '.github/workflows/test_pipeline.yml') }
51
-
52
- it 'runs minitest' do
53
- expect(pipeline).to match(/minitest|ruby.*test/)
54
- end
55
- end
56
-
57
- context 'with rspec and selenium on github' do
47
+ context 'with rspec and selenium' do
58
48
  name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
59
49
  include_examples 'valid github pipeline', name
60
50
  include_examples 'github rspec pipeline', name
61
51
  end
62
52
 
63
- context 'with cucumber and selenium on github' do
53
+ context 'with cucumber and selenium' do
64
54
  name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
65
55
  include_examples 'valid github pipeline', name
66
56
  include_examples 'github cucumber pipeline', name
67
57
  end
68
58
 
69
- context 'with minitest and selenium on github' do
70
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
71
- include_examples 'valid github pipeline', name
72
- include_examples 'github minitest pipeline', name
73
- end
74
-
75
- context 'with rspec and capybara on github' do
76
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
77
- include_examples 'valid github pipeline', name
78
- include_examples 'github rspec pipeline', name
79
- end
80
-
81
- context 'with rspec and watir on github' do
59
+ context 'with rspec and watir' do
82
60
  name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
83
61
  include_examples 'valid github pipeline', name
84
62
  include_examples 'github rspec pipeline', name
85
63
  end
86
-
87
- # --- GitLab CI ---
88
-
89
- shared_examples 'valid gitlab pipeline' do |project_name|
90
- subject(:pipeline) { read_generated("#{project_name}_gitlab", 'gitlab-ci.yml') }
91
-
92
- it 'is valid YAML' do
93
- expect { YAML.safe_load(pipeline) }.not_to raise_error
94
- end
95
-
96
- it 'has stages' do
97
- expect(pipeline).to include('stages:')
98
- end
99
-
100
- it 'has script section' do
101
- expect(pipeline).to include('script:')
102
- end
103
- end
104
-
105
- context 'with rspec and selenium on gitlab' do
106
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
107
- include_examples 'valid gitlab pipeline', name
108
- end
109
-
110
- context 'with cucumber and selenium on gitlab' do
111
- name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
112
- include_examples 'valid gitlab pipeline', name
113
- end
114
-
115
- context 'with minitest and selenium on gitlab' do
116
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
117
- include_examples 'valid gitlab pipeline', name
118
- end
119
64
  end
@@ -73,22 +73,6 @@ describe 'Common file content' do
73
73
  end
74
74
  end
75
75
 
76
- shared_examples 'minitest rakefile with default task' do |project_name|
77
- subject(:rakefile) { read_generated(project_name, 'Rakefile') }
78
-
79
- it 'requires rake/testtask' do
80
- expect(rakefile).to include("require 'rake/testtask'")
81
- end
82
-
83
- it 'defines test task' do
84
- expect(rakefile).to include('Rake::TestTask.new(:test)')
85
- end
86
-
87
- it 'sets default task to test' do
88
- expect(rakefile).to include('task default: :test')
89
- end
90
- end
91
-
92
76
  # --- .rspec file ---
93
77
 
94
78
  shared_examples 'has rspec dotfile' do |project_name|
@@ -215,16 +199,6 @@ describe 'Common file content' do
215
199
  it_behaves_like 'gemfile with rspec-retry', name
216
200
  end
217
201
 
218
- context 'with rspec and capybara' do
219
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
220
- it_behaves_like 'valid rakefile', name
221
- it_behaves_like 'rspec rakefile with tag tasks', name
222
- it_behaves_like 'has rspec dotfile', name
223
- it_behaves_like 'rspec gitignore', name
224
- it_behaves_like 'spec helper with retry config', name
225
- it_behaves_like 'gemfile with rspec-retry', name
226
- end
227
-
228
202
  # --- Cucumber contexts ---
229
203
 
230
204
  context 'with cucumber and selenium' do
@@ -247,42 +221,4 @@ describe 'Common file content' do
247
221
  it_behaves_like 'cucumber config with retry', name
248
222
  end
249
223
 
250
- context 'with cucumber and capybara' do
251
- name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
252
- it_behaves_like 'valid rakefile', name
253
- it_behaves_like 'cucumber rakefile with tag tasks', name
254
- it_behaves_like 'no rspec dotfile', name
255
- it_behaves_like 'non-rspec gitignore', name
256
- it_behaves_like 'gemfile without rspec-retry', name
257
- it_behaves_like 'cucumber config with retry', name
258
- end
259
-
260
- # --- Minitest contexts ---
261
-
262
- context 'with minitest and selenium' do
263
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
264
- it_behaves_like 'valid rakefile', name
265
- it_behaves_like 'minitest rakefile with default task', name
266
- it_behaves_like 'no rspec dotfile', name
267
- it_behaves_like 'non-rspec gitignore', name
268
- it_behaves_like 'gemfile without rspec-retry', name
269
- end
270
-
271
- context 'with minitest and watir' do
272
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
273
- it_behaves_like 'valid rakefile', name
274
- it_behaves_like 'minitest rakefile with default task', name
275
- it_behaves_like 'no rspec dotfile', name
276
- it_behaves_like 'non-rspec gitignore', name
277
- it_behaves_like 'gemfile without rspec-retry', name
278
- end
279
-
280
- context 'with minitest and capybara' do
281
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
282
- it_behaves_like 'valid rakefile', name
283
- it_behaves_like 'minitest rakefile with default task', name
284
- it_behaves_like 'no rspec dotfile', name
285
- it_behaves_like 'non-rspec gitignore', name
286
- it_behaves_like 'gemfile without rspec-retry', name
287
- end
288
224
  end
@@ -51,24 +51,6 @@ describe 'Config file content' do
51
51
  end
52
52
  end
53
53
 
54
- shared_examples 'config with video section' do |project_name|
55
- subject(:config_content) { read_generated(project_name, 'config/config.yml') }
56
-
57
- let(:config) { YAML.safe_load(config_content, permitted_classes: [Symbol]) }
58
-
59
- it 'has video section' do
60
- expect(config).to have_key('video')
61
- end
62
-
63
- it 'has video enabled key defaulting to false' do
64
- expect(config['video']['enabled']).to be false
65
- end
66
-
67
- it 'has video strategy key' do
68
- expect(config['video']['strategy']).to eq('auto')
69
- end
70
- end
71
-
72
54
  shared_examples 'config with debug section' do |project_name|
73
55
  subject(:config_content) { read_generated(project_name, 'config/config.yml') }
74
56
 
@@ -105,7 +87,7 @@ describe 'Config file content' do
105
87
  name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::SELENIUM}"
106
88
  include_examples 'valid web config', name
107
89
  include_examples 'selenium config with timeout', name
108
- include_examples 'config with video section', name
90
+
109
91
  include_examples 'config with debug section', name
110
92
  end
111
93
 
@@ -113,15 +95,7 @@ describe 'Config file content' do
113
95
  name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::WATIR}"
114
96
  include_examples 'valid web config', name
115
97
  include_examples 'config without driver_options', name
116
- include_examples 'config with video section', name
117
- include_examples 'config with debug section', name
118
- end
119
98
 
120
- context 'with rspec and capybara' do
121
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
122
- include_examples 'valid web config', name
123
- include_examples 'config without driver_options', name
124
- include_examples 'config with video section', name
125
99
  include_examples 'config with debug section', name
126
100
  end
127
101
 
@@ -129,31 +103,7 @@ describe 'Config file content' do
129
103
  name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
130
104
  include_examples 'valid web config', name
131
105
  include_examples 'selenium config with timeout', name
132
- include_examples 'config with video section', name
133
- include_examples 'config with debug section', name
134
- end
135
-
136
- context 'with minitest and selenium' do
137
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
138
- include_examples 'valid web config', name
139
- include_examples 'selenium config with timeout', name
140
- include_examples 'config with video section', name
141
- include_examples 'config with debug section', name
142
- end
143
106
 
144
- context 'with minitest and watir' do
145
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
146
- include_examples 'valid web config', name
147
- include_examples 'config without driver_options', name
148
- include_examples 'config with video section', name
149
- include_examples 'config with debug section', name
150
- end
151
-
152
- context 'with minitest and capybara' do
153
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
154
- include_examples 'valid web config', name
155
- include_examples 'config without driver_options', name
156
- include_examples 'config with video section', name
157
107
  include_examples 'config with debug section', name
158
108
  end
159
109
 
@@ -7,8 +7,8 @@ module ContentHelper
7
7
  File.read(File.join(project, relative_path))
8
8
  end
9
9
 
10
- def project(framework, automation, ci_platform = nil)
11
- ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}"
10
+ def project(framework, automation)
11
+ "#{framework}_#{automation}"
12
12
  end
13
13
  end
14
14
 
@@ -67,22 +67,6 @@ describe 'Gemfile content' do
67
67
  end
68
68
  end
69
69
 
70
- shared_examples 'contains minitest gems' do |project_name|
71
- subject(:gemfile) { read_generated(project_name, 'Gemfile') }
72
-
73
- it 'includes minitest' do
74
- expect(gemfile).to include("gem 'minitest'")
75
- end
76
-
77
- it 'includes minitest-reporters' do
78
- expect(gemfile).to include("gem 'minitest-reporters'")
79
- end
80
-
81
- it 'includes rubocop-minitest' do
82
- expect(gemfile).to include("gem 'rubocop-minitest'")
83
- end
84
- end
85
-
86
70
  shared_examples 'contains selenium gems' do |project_name|
87
71
  subject(:gemfile) { read_generated(project_name, 'Gemfile') }
88
72
 
@@ -107,22 +91,6 @@ describe 'Gemfile content' do
107
91
  end
108
92
  end
109
93
 
110
- shared_examples 'contains capybara gems' do |project_name|
111
- subject(:gemfile) { read_generated(project_name, 'Gemfile') }
112
-
113
- it 'includes capybara' do
114
- expect(gemfile).to include("gem 'capybara'")
115
- end
116
-
117
- it 'includes selenium-webdriver as capybara driver' do
118
- expect(gemfile).to include("gem 'selenium-webdriver'")
119
- end
120
-
121
- it 'does not include watir' do
122
- expect(gemfile).not_to include("gem 'watir'")
123
- end
124
- end
125
-
126
94
  shared_examples 'contains debug gems' do |project_name|
127
95
  subject(:gemfile) { read_generated(project_name, 'Gemfile') }
128
96
 
@@ -151,14 +119,6 @@ describe 'Gemfile content' do
151
119
  include_examples 'contains debug gems', name
152
120
  end
153
121
 
154
- context 'with rspec and capybara' do
155
- name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::CAPYBARA}"
156
- include_examples 'contains common gems', name
157
- include_examples 'contains rspec gems', name
158
- include_examples 'contains capybara gems', name
159
- include_examples 'contains debug gems', name
160
- end
161
-
162
122
  context 'with cucumber and selenium' do
163
123
  name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::SELENIUM}"
164
124
  include_examples 'contains common gems', name
@@ -175,35 +135,4 @@ describe 'Gemfile content' do
175
135
  include_examples 'contains debug gems', name
176
136
  end
177
137
 
178
- context 'with cucumber and capybara' do
179
- name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::CAPYBARA}"
180
- include_examples 'contains common gems', name
181
- include_examples 'contains cucumber gems', name
182
- include_examples 'contains capybara gems', name
183
- include_examples 'contains debug gems', name
184
- end
185
-
186
- context 'with minitest and selenium' do
187
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::SELENIUM}"
188
- include_examples 'contains common gems', name
189
- include_examples 'contains minitest gems', name
190
- include_examples 'contains selenium gems', name
191
- include_examples 'contains debug gems', name
192
- end
193
-
194
- context 'with minitest and watir' do
195
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::WATIR}"
196
- include_examples 'contains common gems', name
197
- include_examples 'contains minitest gems', name
198
- include_examples 'contains watir gems', name
199
- include_examples 'contains debug gems', name
200
- end
201
-
202
- context 'with minitest and capybara' do
203
- name = "#{FrameworkIndex::MINITEST}_#{AutomationIndex::CAPYBARA}"
204
- include_examples 'contains common gems', name
205
- include_examples 'contains minitest gems', name
206
- include_examples 'contains capybara gems', name
207
- include_examples 'contains debug gems', name
208
- end
209
138
  end