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.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/e2e_tests.yml +58 -0
  3. data/.github/workflows/steep.yml +21 -0
  4. data/.gitignore +1 -1
  5. data/.reek.yml +46 -4
  6. data/.ruby-version +1 -1
  7. data/README.md +138 -77
  8. data/Steepfile +22 -0
  9. data/assets/ruby_raider_logo.svg +51 -0
  10. data/lib/adopter/adopt_menu.rb +11 -15
  11. data/lib/adopter/converters/base_converter.rb +1 -2
  12. data/lib/adopter/converters/identity_converter.rb +3 -6
  13. data/lib/adopter/migration_plan.rb +0 -1
  14. data/lib/adopter/plan_builder.rb +2 -5
  15. data/lib/adopter/project_analyzer.rb +1 -5
  16. data/lib/adopter/project_detector.rb +3 -5
  17. data/lib/commands/adopt_commands.rb +0 -1
  18. data/lib/commands/plugin_commands.rb +0 -2
  19. data/lib/commands/scaffolding_commands.rb +220 -37
  20. data/lib/commands/utility_commands.rb +82 -2
  21. data/lib/generators/automation/automation_generator.rb +0 -7
  22. data/lib/generators/automation/templates/partials/element.tt +1 -1
  23. data/lib/generators/automation/templates/partials/initialize_selector.tt +0 -7
  24. data/lib/generators/automation/templates/partials/url_methods.tt +0 -1
  25. data/lib/generators/common_generator.rb +12 -0
  26. data/lib/generators/cucumber/cucumber_generator.rb +36 -0
  27. data/lib/generators/cucumber/templates/accessibility_feature.tt +5 -0
  28. data/lib/generators/cucumber/templates/accessibility_steps.tt +21 -0
  29. data/lib/generators/cucumber/templates/cucumber.tt +8 -1
  30. data/lib/generators/cucumber/templates/feature.tt +0 -4
  31. data/lib/generators/cucumber/templates/partials/appium_env.tt +5 -0
  32. data/lib/generators/cucumber/templates/partials/capybara_env.tt +19 -1
  33. data/lib/generators/cucumber/templates/partials/driver_world.tt +1 -4
  34. data/lib/generators/cucumber/templates/partials/selenium_env.tt +22 -35
  35. data/lib/generators/cucumber/templates/partials/watir_env.tt +20 -1
  36. data/lib/generators/cucumber/templates/partials/web_steps.tt +6 -12
  37. data/lib/generators/cucumber/templates/performance_feature.tt +5 -0
  38. data/lib/generators/cucumber/templates/performance_steps.tt +17 -0
  39. data/lib/generators/cucumber/templates/visual_feature.tt +5 -0
  40. data/lib/generators/cucumber/templates/visual_steps.tt +19 -0
  41. data/lib/generators/generator.rb +38 -7
  42. data/lib/generators/helper_generator.rb +24 -7
  43. data/lib/generators/infrastructure/templates/github.tt +1 -1
  44. data/lib/generators/infrastructure/templates/github_appium.tt +2 -2
  45. data/lib/generators/infrastructure/templates/gitlab.tt +1 -1
  46. data/lib/generators/invoke_generators.rb +42 -9
  47. data/lib/generators/menu_generator.rb +120 -11
  48. data/lib/generators/minitest/minitest_generator.rb +16 -4
  49. data/lib/generators/minitest/templates/accessibility_test.tt +26 -0
  50. data/lib/generators/minitest/templates/performance_test.tt +18 -0
  51. data/lib/generators/minitest/templates/test.tt +5 -34
  52. data/lib/generators/minitest/templates/visual_test.tt +23 -0
  53. data/lib/generators/rspec/rspec_generator.rb +16 -4
  54. data/lib/generators/rspec/templates/accessibility_spec.tt +25 -0
  55. data/lib/generators/rspec/templates/performance_spec.tt +18 -0
  56. data/lib/generators/rspec/templates/spec.tt +5 -35
  57. data/lib/generators/rspec/templates/visual_spec.tt +20 -0
  58. data/lib/generators/template_renderer/partial_cache.rb +11 -1
  59. data/lib/generators/template_renderer/partial_resolver.rb +17 -10
  60. data/lib/generators/template_renderer.rb +17 -1
  61. data/lib/generators/templates/common/gemfile.tt +21 -6
  62. data/lib/generators/templates/common/git_ignore.tt +6 -1
  63. data/lib/generators/templates/common/partials/mobile_config.tt +5 -1
  64. data/lib/generators/templates/common/partials/web_config.tt +16 -7
  65. data/lib/generators/templates/common/rakefile.tt +36 -0
  66. data/lib/generators/templates/common/read_me.tt +41 -91
  67. data/lib/generators/templates/common/rspec.tt +3 -0
  68. data/lib/generators/templates/common/ruby_version.tt +1 -0
  69. data/lib/generators/templates/helpers/allure_helper.tt +11 -0
  70. data/lib/generators/templates/helpers/browser_helper.tt +12 -2
  71. data/lib/generators/templates/helpers/capybara_helper.tt +5 -1
  72. data/lib/generators/templates/helpers/debug_helper.tt +190 -0
  73. data/lib/generators/templates/helpers/driver_helper.tt +2 -10
  74. data/lib/generators/templates/helpers/partials/appium_driver.tt +0 -2
  75. data/lib/generators/templates/helpers/partials/debug_diagnostics.tt +7 -0
  76. data/lib/generators/templates/helpers/partials/debug_start.tt +7 -0
  77. data/lib/generators/templates/helpers/partials/driver_and_options.tt +1 -3
  78. data/lib/generators/templates/helpers/partials/selenium_driver.tt +8 -7
  79. data/lib/generators/templates/helpers/partials/video_start.tt +9 -0
  80. data/lib/generators/templates/helpers/partials/video_stop.tt +4 -0
  81. data/lib/generators/templates/helpers/performance_helper.tt +57 -0
  82. data/lib/generators/templates/helpers/spec_helper.tt +57 -8
  83. data/lib/generators/templates/helpers/test_helper.tt +69 -1
  84. data/lib/generators/templates/helpers/video_helper.tt +270 -0
  85. data/lib/generators/templates/helpers/visual_helper.tt +39 -46
  86. data/lib/llm/client.rb +79 -0
  87. data/lib/llm/config.rb +57 -0
  88. data/lib/llm/prompts.rb +84 -0
  89. data/lib/llm/provider.rb +27 -0
  90. data/lib/llm/providers/anthropic_provider.rb +43 -0
  91. data/lib/llm/providers/ollama_provider.rb +56 -0
  92. data/lib/llm/providers/openai_provider.rb +42 -0
  93. data/lib/llm/response_parser.rb +67 -0
  94. data/lib/plugin/plugin.rb +22 -20
  95. data/lib/plugin/plugin_exposer.rb +16 -38
  96. data/lib/ruby_raider.rb +47 -12
  97. data/lib/scaffolding/crud_generator.rb +94 -0
  98. data/lib/scaffolding/dry_run_presenter.rb +16 -0
  99. data/lib/scaffolding/name_normalizer.rb +63 -0
  100. data/lib/scaffolding/page_introspector.rb +45 -0
  101. data/lib/scaffolding/project_detector.rb +72 -0
  102. data/lib/scaffolding/scaffold_menu.rb +103 -0
  103. data/lib/scaffolding/scaffolding.rb +158 -11
  104. data/lib/scaffolding/templates/component.tt +30 -0
  105. data/lib/scaffolding/templates/feature.tt +4 -4
  106. data/lib/scaffolding/templates/helper.tt +15 -1
  107. data/lib/scaffolding/templates/page_from_url.tt +75 -0
  108. data/lib/scaffolding/templates/page_object.tt +50 -1
  109. data/lib/scaffolding/templates/spec.tt +33 -2
  110. data/lib/scaffolding/templates/spec_from_page.tt +31 -0
  111. data/lib/scaffolding/templates/spec_from_url.tt +46 -0
  112. data/lib/scaffolding/templates/steps.tt +17 -5
  113. data/lib/scaffolding/url_analyzer.rb +179 -0
  114. data/lib/utilities/desktop_downloader.rb +177 -0
  115. data/lib/utilities/logo.rb +83 -0
  116. data/lib/utilities/utilities.rb +53 -20
  117. data/lib/version +1 -1
  118. data/ruby_raider.gemspec +1 -0
  119. data/sig/adopter/adopt_menu.rbs +25 -0
  120. data/sig/adopter/converters/base_converter.rbs +23 -0
  121. data/sig/adopter/converters/identity_converter.rbs +16 -0
  122. data/sig/adopter/migration_plan.rbs +34 -0
  123. data/sig/adopter/migrator.rbs +21 -0
  124. data/sig/adopter/plan_builder.rbs +38 -0
  125. data/sig/adopter/project_analyzer.rbs +39 -0
  126. data/sig/adopter/project_detector.rbs +26 -0
  127. data/sig/commands/adopt_commands.rbs +8 -0
  128. data/sig/commands/loaded_commands.rbs +5 -0
  129. data/sig/commands/plugin_commands.rbs +9 -0
  130. data/sig/commands/scaffolding_commands.rbs +28 -0
  131. data/sig/commands/utility_commands.rbs +21 -0
  132. data/sig/generators/automation/automation_generator.rbs +20 -0
  133. data/sig/generators/common_generator.rbs +12 -0
  134. data/sig/generators/cucumber/cucumber_generator.rbs +16 -0
  135. data/sig/generators/generator.rbs +40 -0
  136. data/sig/generators/helper_generator.rbs +18 -0
  137. data/sig/generators/infrastructure/github_generator.rbs +5 -0
  138. data/sig/generators/infrastructure/gitlab_generator.rbs +4 -0
  139. data/sig/generators/invoke_generators.rbs +10 -0
  140. data/sig/generators/menu_generator.rbs +29 -0
  141. data/sig/generators/minitest/minitest_generator.rbs +8 -0
  142. data/sig/generators/rspec/rspec_generator.rbs +8 -0
  143. data/sig/generators/template_renderer/partial_cache.rbs +20 -0
  144. data/sig/generators/template_renderer/partial_resolver.rbs +20 -0
  145. data/sig/generators/template_renderer/template_error.rbs +19 -0
  146. data/sig/generators/template_renderer.rbs +10 -0
  147. data/sig/llm/client.rbs +15 -0
  148. data/sig/llm/config.rbs +20 -0
  149. data/sig/llm/prompts.rbs +8 -0
  150. data/sig/llm/provider.rbs +12 -0
  151. data/sig/llm/providers/anthropic_provider.rbs +16 -0
  152. data/sig/llm/providers/ollama_provider.rbs +18 -0
  153. data/sig/llm/providers/openai_provider.rbs +16 -0
  154. data/sig/llm/response_parser.rbs +13 -0
  155. data/sig/plugin/plugin.rbs +24 -0
  156. data/sig/plugin/plugin_exposer.rbs +20 -0
  157. data/sig/ruby_raider.rbs +15 -0
  158. data/sig/scaffolding/crud_generator.rbs +16 -0
  159. data/sig/scaffolding/dry_run_presenter.rbs +4 -0
  160. data/sig/scaffolding/name_normalizer.rbs +17 -0
  161. data/sig/scaffolding/page_introspector.rbs +14 -0
  162. data/sig/scaffolding/project_detector.rbs +14 -0
  163. data/sig/scaffolding/scaffold_menu.rbs +18 -0
  164. data/sig/scaffolding/scaffolding.rbs +55 -0
  165. data/sig/scaffolding/url_analyzer.rbs +28 -0
  166. data/sig/utilities/desktop_downloader.rbs +23 -0
  167. data/sig/utilities/logger.rbs +13 -0
  168. data/sig/utilities/logo.rbs +16 -0
  169. data/sig/utilities/utilities.rbs +30 -0
  170. data/sig/vendor/thor.rbs +34 -0
  171. data/sig/vendor/tty_prompt.rbs +15 -0
  172. data/spec/adopter/adopt_menu_spec.rb +12 -12
  173. data/spec/adopter/migration_plan_spec.rb +1 -1
  174. data/spec/adopter/migrator_spec.rb +2 -2
  175. data/spec/adopter/project_detector_spec.rb +1 -1
  176. data/spec/commands/raider_commands_spec.rb +129 -0
  177. data/spec/generators/generator_spec.rb +23 -0
  178. data/spec/integration/commands/scaffolding_commands_spec.rb +1 -1
  179. data/spec/integration/commands/utility_commands_spec.rb +23 -3
  180. data/spec/integration/content/ci_content_spec.rb +119 -0
  181. data/spec/integration/content/common_content_spec.rb +288 -0
  182. data/spec/integration/content/config_content_spec.rb +175 -0
  183. data/spec/integration/content/content_helper.rb +32 -0
  184. data/spec/integration/content/gemfile_content_spec.rb +209 -0
  185. data/spec/integration/content/helper_content_spec.rb +485 -0
  186. data/spec/integration/content/page_content_spec.rb +259 -0
  187. data/spec/integration/content/reporter_content_spec.rb +236 -0
  188. data/spec/integration/content/skip_flags_content_spec.rb +206 -0
  189. data/spec/integration/content/syntax_validation_spec.rb +30 -0
  190. data/spec/integration/content/test_content_spec.rb +266 -0
  191. data/spec/integration/end_to_end_features_spec.rb +690 -0
  192. data/spec/integration/end_to_end_spec.rb +52 -16
  193. data/spec/integration/generators/automation_generator_spec.rb +0 -12
  194. data/spec/integration/generators/axe_addon_spec.rb +150 -0
  195. data/spec/integration/generators/common_generator_spec.rb +12 -13
  196. data/spec/integration/generators/config_features_spec.rb +155 -0
  197. data/spec/integration/generators/debug_helper_spec.rb +68 -0
  198. data/spec/integration/generators/helpers_generator_spec.rb +0 -12
  199. data/spec/integration/generators/lighthouse_addon_spec.rb +132 -0
  200. data/spec/integration/generators/minitest_generator_spec.rb +0 -6
  201. data/spec/integration/generators/reporter_spec.rb +159 -0
  202. data/spec/integration/generators/skip_flags_spec.rb +134 -0
  203. data/spec/integration/generators/visual_addon_spec.rb +148 -0
  204. data/spec/integration/settings_helper.rb +0 -3
  205. data/spec/integration/spec_helper.rb +30 -13
  206. data/spec/llm/client_spec.rb +79 -0
  207. data/spec/llm/config_spec.rb +92 -0
  208. data/spec/llm/prompts_spec.rb +49 -0
  209. data/spec/llm/response_parser_spec.rb +92 -0
  210. data/spec/menus/adopter_adopt_menu_spec.rb +97 -0
  211. data/spec/menus/menu_generator_spec.rb +263 -0
  212. data/spec/scaffolding/name_normalizer_spec.rb +113 -0
  213. data/spec/scaffolding/page_introspector_spec.rb +82 -0
  214. data/spec/scaffolding/scaffold_project_detector_spec.rb +104 -0
  215. data/spec/scaffolding/scaffolding_features_spec.rb +311 -0
  216. data/spec/scaffolding/url_analyzer_spec.rb +110 -0
  217. data/spec/system/adopt_matrix_spec.rb +537 -0
  218. data/spec/system/adopt_spec.rb +225 -0
  219. data/spec/system/support/system_test_helper.rb +0 -2
  220. data/spec/utilities/desktop_downloader_spec.rb +92 -0
  221. metadata +150 -5
  222. data/lib/generators/automation/templates/visual_options.tt +0 -16
  223. data/lib/generators/templates/helpers/partials/axe_driver.tt +0 -10
  224. data/lib/generators/templates/helpers/visual_spec_helper.tt +0 -35
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac806dedffef8add5bb3bdd9fa1ed3a36deb41bb40e7c8f4fc2e43902bf948c2
4
- data.tar.gz: e84b791980e5f284c6781f7e5e502017f94927aa3e85b85c8db4e7c76a689ffe
3
+ metadata.gz: 7d6b5fccbc2b3752d7f63391226d903a61a1368a404831ef10b1d0d230774fa5
4
+ data.tar.gz: 7d4be1564e22cb7bf47e0d08ced4ae00868140bbd0c65833e733a904e634ecf4
5
5
  SHA512:
6
- metadata.gz: de7087d899c8d787cdf10f66991e7bf79a0068a7fe6621c85d2a19e72889c81abdd169608d54610195ae223794083e36b82e111fd277e39d6aa17b04b185f0d8
7
- data.tar.gz: 04c89e67ab91a9d2307d35c47ab85c972b4dac850df4b4de509358d1573d3b0d691e2369f444b9a3669e02e7ab7eab2c46c92d89610e46362b76682798274bb9
6
+ metadata.gz: d9c67f3a57b7bfe7c3426ea0a5220af9b2623d9ce7003c1ebf2052bb19e23125a2f88ee277e89349dece675d13e07833818a93b25dbdbaf2a712dc8661fd0fa3
7
+ data.tar.gz: 840873be251968d311b86e15586219fe402f433a7cf81f5eccd46e1b8227dfa52c95274099818d4eabf764b015e28cce116bcaac2334ba7e840be6a379a4d6d0
@@ -0,0 +1,58 @@
1
+ name: E2E and Content Validation Tests
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ content-validation:
7
+ name: Content validation tests
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - name: Checkout repository
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: '3.3'
18
+ bundler-cache: true
19
+
20
+ - name: Run content validation tests
21
+ run: bundle exec rspec spec/integration/content/ --format documentation
22
+
23
+ e2e-adopt:
24
+ name: Adopt E2E tests
25
+ runs-on: ubuntu-latest
26
+
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+
31
+ - name: Set up Ruby
32
+ uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: '3.3'
35
+ bundler-cache: true
36
+
37
+ - name: Run adopt system tests
38
+ run: bundle exec rspec spec/system/adopt_spec.rb --format documentation
39
+
40
+ command-and-menu-tests:
41
+ name: Command routing and menu tests
42
+ runs-on: ubuntu-latest
43
+
44
+ steps:
45
+ - name: Checkout repository
46
+ uses: actions/checkout@v4
47
+
48
+ - name: Set up Ruby
49
+ uses: ruby/setup-ruby@v1
50
+ with:
51
+ ruby-version: '3.3'
52
+ bundler-cache: true
53
+
54
+ - name: Run command routing tests
55
+ run: bundle exec rspec spec/commands/ --format documentation
56
+
57
+ - name: Run menu tests
58
+ run: bundle exec rspec spec/menus/ --format documentation
@@ -0,0 +1,21 @@
1
+ name: Type check
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ steep:
7
+ name: Steep type checking
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - name: Checkout repository
12
+ uses: actions/checkout@v4
13
+
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: '3.4'
18
+ bundler-cache: true
19
+
20
+ - name: Run steep check
21
+ run: bundle exec steep check
data/.gitignore CHANGED
@@ -3,4 +3,4 @@ ruby_raider-*.gem
3
3
  ruby_raider.iml
4
4
  Gemfile.lock
5
5
  .DS_Store
6
- lib/.DS_StoreCLAUDE.md
6
+ lib/.DS_Store
data/.reek.yml CHANGED
@@ -1,9 +1,51 @@
1
1
  detectors:
2
+ Attribute:
3
+ enabled: false
4
+
5
+ BooleanParameter:
6
+ enabled: false
7
+
8
+ ControlParameter:
9
+ enabled: false
10
+
11
+ DataClump:
12
+ enabled: false
13
+
14
+ DuplicateMethodCall:
15
+ enabled: false
16
+
17
+ FeatureEnvy:
18
+ enabled: false
19
+
2
20
  IrresponsibleModule:
3
21
  enabled: false
4
22
 
23
+ LongParameterList:
24
+ enabled: false
25
+
26
+ ManualDispatch:
27
+ enabled: false
28
+
29
+ NestedIterators:
30
+ enabled: false
31
+
32
+ NilCheck:
33
+ enabled: false
34
+
35
+ RepeatedConditional:
36
+ enabled: false
37
+
38
+ TooManyMethods:
39
+ enabled: false
40
+
5
41
  TooManyStatements:
6
- enabled: true
7
- exclude:
8
- - initialize
9
- max_statements: 10
42
+ enabled: false
43
+
44
+ UncommunicativeVariableName:
45
+ enabled: false
46
+
47
+ UnusedParameters:
48
+ enabled: false
49
+
50
+ UtilityFunction:
51
+ enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.4.1
data/README.md CHANGED
@@ -10,10 +10,10 @@
10
10
  <br />
11
11
  <div align="center">
12
12
  <a href="https://github.com/RubyRaider/ruby_raider">
13
- <img src="https://www.ruby-raider.com/assets/icon-DYY74ofR.png" alt="Logo" style="width:200px;">
13
+ <img src="assets/ruby_raider_logo.svg" alt="Logo" style="width:200px;">
14
14
  </a>
15
15
  <p align="center">
16
- <a href="https://github.com/RubyRaider/ruby_raider#getting-started"><strong>Explore the docs »</strong></a>
16
+ <a href="https://github.com/RubyRaider/ruby_raider#getting-started"><strong>Explore the docs</strong></a>
17
17
  <br />
18
18
  <br />
19
19
  <a href="https://rubygems.org/gems/ruby_raider">Rubygems</a>
@@ -22,128 +22,189 @@
22
22
  ·
23
23
  <a href="https://github.com/RubyRaider/ruby_raider/issues">Request Feature</a>
24
24
  </p>
25
- <p align="center"> For more information and updates on releases, see <a href="https://ruby-raider.com">https://ruby-raider.com</a></p>
25
+ <p align="center"> For more information and updates on releases, see https://ruby-raider.onrender.com/</p>
26
26
  </div>
27
27
 
28
28
  ## What is Ruby Raider?
29
29
 
30
- Ruby Raider is a generator and scaffolding gem to make UI test automation easier
30
+ Ruby Raider is a CLI gem and API backend for scaffolding and generating UI test automation frameworks. It supports both interactive command-line usage and programmatic invocation via [Raider Desktop](https://ruby-raider.com).
31
31
 
32
- ### At the moment Ruby Raider supports generating the following frameworks:
32
+ ## Supported Frameworks
33
33
 
34
- | Web Testing Framework | Visual Testing Framework | Mobile Testing Framework | Accessibility Testing Framework |
35
- |-----------------------|-----------------------------------|------------------------------------|---------------------------------|
36
- | Cucumber and Selenium | Cucumber, Applitools and Selenium | Cucumber and Appium for IOS | Cucumber and Axe for web |
37
- | Rspec and Selenium | Rspec, Applitools and Selenium | Rspec and Appium for IOS | Rspec and Axe for web |
38
- | Cucumber and Watir | | Cucumber and Appium for Android | |
39
- | Rspec and Watir | | Rspec and Appium for Android | |
40
- | | | Cucumber and Appium Cross-platform | |
41
- | | | Rspec and Appium Cross-platform | |
34
+ ### Web Testing
35
+
36
+ | Test Framework | Selenium | Watir | Capybara |
37
+ |----------------|----------|-------|----------|
38
+ | RSpec | ✅ | | |
39
+ | Cucumber | || |
40
+ | Minitest || ✅ | |
41
+
42
+ ### Mobile Testing (Appium)
43
+
44
+ | Test Framework | iOS | Android | Cross-Platform |
45
+ |----------------|-----|---------|----------------|
46
+ | RSpec | ✅ | ✅ | ✅ |
47
+ | Cucumber | ✅ | ✅ | ✅ |
48
+ | Minitest | ✅ | ✅ | ✅ |
49
+
50
+ ### Optional Add-ons (Web Only)
51
+
52
+ | Add-on | Flag | Description |
53
+ |--------|------|-------------|
54
+ | Accessibility | `--accessibility` | Adds axe gem + example accessibility tests |
55
+ | Visual Regression | `--visual` | Adds chunky_png + visual comparison helpers |
56
+ | Performance | `--performance` | Adds Lighthouse auditing (requires `npm install -g lighthouse`) |
57
+
58
+ ### CI/CD Platforms
59
+
60
+ Projects can be generated with built-in CI/CD pipelines for **GitHub Actions** or **GitLab CI/CD**.
61
+
62
+ ### Test Reporters
63
+
64
+ Choose a reporter with `--reporter`: `allure`, `junit`, `json`, `both`, `all`, or `none`.
42
65
 
43
66
  ***The web tests run against the [Raider Test Store](https://raider-test-site.onrender.com/).***
44
67
 
45
- ***In order to run the Appium tests, download the example [app](https://github.com/RaiderHQ/raider_test_app).***
46
- ***Remember to use the full path of the app that you download in the capabilities file and start the server using one of
47
- the commands below:***
68
+ ***To run Appium tests, download the example [app](https://github.com/RaiderHQ/raider_test_app) and start the server:***
48
69
 
49
- ```ruby
70
+ ```bash
50
71
  raider u start_appium
51
- appium --base /wd/hub
52
72
  ```
53
73
 
54
- ***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read
55
- more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.)
56
- .***
57
-
58
- ***To use the open ai integration you need to set up the OPENAI_ACCESS_TOKEN environment variable and
59
- you can also set the optional OPENAI_ORGANIZATION_ID if you have an organization***
74
+ This works on all platforms (Mac OS, Linux and Windows).
60
75
 
61
- This works in all the platforms (Tested on Mac OS, Linux and Windows).
76
+ ## Getting Started
62
77
 
63
- ## Getting started
78
+ Install the gem:
64
79
 
65
- To get the project up and running.
80
+ ```bash
81
+ gem install ruby_raider
82
+ ```
66
83
 
67
- **Just do:**
84
+ Create a new project interactively:
68
85
 
69
- ```ruby
70
- gem install ruby_raider
86
+ ```bash
87
+ raider new [project_name]
71
88
  ```
72
89
 
73
- **Then do:**
90
+ Or skip the menu with parameters:
74
91
 
75
- ```ruby
76
- raider new [name_of_project]
92
+ ```bash
93
+ raider new [project_name] -p framework:rspec automation:selenium
77
94
  ```
78
95
 
79
- Then a TUI/CLI will appear where the configuration of which frameworks you want to be generated/scaffolded can be
80
- selected.
96
+ Add optional features:
81
97
 
82
- Select the ones you will like to work with.
98
+ ```bash
99
+ raider new my_project -p framework:rspec automation:selenium --accessibility --visual --performance
100
+ ```
83
101
 
84
- If you already know which frameworks you want to use, you can do:
102
+ Skip flags for leaner projects:
85
103
 
86
- ```ruby
87
- raider new [name_of_project] -p framework:[framework] automation:[automation_type]
104
+ ```bash
105
+ raider new my_project -p framework:cucumber automation:watir --skip_ci --skip_video --reporter none
88
106
  ```
89
107
 
90
- An example of the command above would be:
108
+ ## Commands
109
+
110
+ ###### Anything between square brackets ([...]) is where your input goes
91
111
 
92
- ```ruby
93
- raider new test_project -p framework:rspec automation:selenium
112
+ ### Main Commands
113
+
114
+ ```
115
+ raider new [PROJECT_NAME] # Create a new framework project
116
+ raider adopt # Import an existing test project
117
+ raider generate # Access scaffolding commands
118
+ raider utility # Access utility commands
119
+ raider plugin_manager # Manage plugins
120
+ raider version # Show current version
121
+ raider help [COMMAND] # Describe available commands
94
122
  ```
95
123
 
96
- ### Ruby raider provides the following list of basic commands
124
+ Shortcuts: `n` (new), `a` (adopt), `g` (generate), `u` (utility), `pm` (plugin_manager), `v` (version)
97
125
 
98
- ###### Anything between square brackets([...]) is where your imput goes
126
+ ### Scaffolding Commands
99
127
 
100
- ```ruby
101
- Commands :
102
- raider generate # Provides access to all the scaffolding commands
103
- raider help [COMMAND] # Describe available commands or one specific command
104
- raider new [PROJECT_NAME] # Creates a new framework based on settings picked
105
- raider utility # Provides access to all the utility commands
106
- raider version # It shows the version of Ruby Raider you are currently using
128
+ ```
129
+ raider g page [NAME] # Create a page object
130
+ raider g spec [NAME] # Create an RSpec test
131
+ raider g feature [NAME] # Create a Cucumber feature
132
+ raider g steps [NAME] # Create step definitions
133
+ raider g helper [NAME] # Create a helper class
134
+ raider g component [NAME] # Create a component class
135
+ raider g scaffold [NAME(S)] # Create page + test + steps
136
+ raider g destroy [NAME(S)] # Delete scaffolded files
137
+ raider g from_url [URL] # Generate page & spec from a live URL
107
138
  ```
108
139
 
109
- All the basic commands have their corresponding shortcut:
140
+ Options:
110
141
 
111
- * g for generate
112
- * n for new
113
- * u for utility
114
- * v for version
142
+ * `--from [FILE]` — Generate spec from an existing page object
143
+ * `--ai` — Use LLM for intelligent test scenario generation
144
+ * `--dry_run` Preview files without creating them
145
+ * `--uses [PAGES]` — Specify page dependencies
146
+ * `--path [PATH]` — Custom output path
147
+ * `--crud` — Generate full CRUD scaffold (list, create, detail, edit + tests)
115
148
 
116
- ### Scaffolding Commands
149
+ ### Utility Commands
150
+
151
+ ```
152
+ raider u path [PATH] # Set default paths for scaffolding
153
+ raider u url [URL] # Set default project URL
154
+ raider u browser [BROWSER] # Set default browser
155
+ raider u browser_options [OPTS] # Set browser options
156
+ raider u raid # Run all tests
157
+ raider u timeout [SECONDS] # Set test timeout
158
+ raider u viewport [DIMENSIONS] # Set viewport size (e.g., 1920x1080)
159
+ raider u platform [PLATFORM] # Set platform for cross-platform tests
160
+ raider u debug [on/off] # Toggle debug mode
161
+ raider u start_appium # Start Appium server
162
+ raider u desktop # Download Raider Desktop
163
+ raider u llm [PROVIDER] # Configure LLM provider (openai, anthropic, ollama)
164
+ ```
117
165
 
118
- Ruby Raider also supports scaffolding:
166
+ ### Plugin Commands
119
167
 
120
- * To create a new page object you do: ```raider g page [PAGE_NAME]```
121
- * To create a new spec you do: ```raider g spec [SPEC_NAME]```
122
- * To create a new feature you do: ```raider g feature [FEATURE_NAME]```
123
- * To create a new steps definition you do: ```raider g steps [STEPS_NAME]```
124
- * To create both a page/spec or a page/feature/steps you do: ```raider g scaffold [SCAFFOLD_NAME]```
168
+ ```
169
+ raider pm add [NAME] # Add a plugin to your project
170
+ raider pm delete [NAME] # Remove a plugin
171
+ raider pm list # List available plugins
172
+ raider pm local # List installed plugins
173
+ ```
125
174
 
126
- It's possible to add the option --path or p if you want to specify where to create your features, pages, helpers and
127
- specs.
175
+ ### Adopt Command
128
176
 
129
- If you want to set the default path for the creation of your features, helpers and specs:
177
+ Import an existing test project into Ruby Raider conventions:
130
178
 
131
- ```ruby
132
- raider u path [PATH_NAME] - -feature or f
133
- raider u path [PATH_NAME] - -spec or s
134
- raider u path [PATH_NAME] - -helper or h
179
+ ```bash
180
+ raider adopt project [SOURCE_PATH]
135
181
  ```
136
182
 
137
- If you don't specify an option, path will assume you want to change the default path for pages.
183
+ ## LLM Integration
138
184
 
139
- ### Appium Server Command
185
+ Ruby Raider supports optional LLM-powered features for intelligent test generation. Configure a provider:
140
186
 
141
- To initialise Appium server run this command:
187
+ ```bash
188
+ raider u llm openai # Configure OpenAI
189
+ raider u llm anthropic # Configure Anthropic
190
+ raider u llm ollama # Configure Ollama (local, no API key needed)
191
+ ```
142
192
 
143
- ```ruby
144
- raider u start_appium
193
+ Then use the `--ai` flag with scaffolding commands for smarter code generation.
194
+
195
+ ## Development
196
+
197
+ ```bash
198
+ bundle install # Install dependencies
199
+ bundle exec rspec # Run all tests
200
+ bundle exec rspec --tag ~slow # Run fast tests only (skip E2E)
201
+ bundle exec rubocop # Run linter
202
+ bundle exec reek # Run code smell detection
145
203
  ```
146
204
 
147
- ### Sponsors
205
+ ## Links
148
206
 
149
- This project is tested with BrowserStack.
207
+ * [RubyGems](https://rubygems.org/gems/ruby_raider)
208
+ * [GitHub](https://github.com/RubyRaider/ruby_raider)
209
+ * [Website](https://ruby-raider.onrender.com/)
210
+ * [Community](https://gitter.im/RubyRaider/community)
data/Steepfile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ target :lib do
4
+ signature 'sig'
5
+
6
+ check 'lib'
7
+
8
+ # External gem stubs (not typed)
9
+ library 'yaml'
10
+ library 'fileutils'
11
+ library 'erb'
12
+ library 'open3'
13
+ library 'timeout'
14
+ library 'uri'
15
+ library 'net-http'
16
+ library 'json'
17
+ library 'logger'
18
+ library 'forwardable'
19
+
20
+ # Configure strictness — start lenient, tighten over time
21
+ configure_code_diagnostics(Steep::Diagnostic::Ruby.lenient)
22
+ end
@@ -0,0 +1,51 @@
1
+ <svg width="512" height="512" viewBox="100 100 480 480" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- LEFT HORN -->
3
+ <polygon points="220,248 218,218 168,155" fill="#d4a017"/>
4
+ <polygon points="220,248 168,155 205,230" fill="#e8c840" opacity="0.7"/>
5
+ <polygon points="218,218 168,155 205,230" fill="#b8860b" opacity="0.8"/>
6
+ <line x1="205" y1="230" x2="168" y2="155" stroke="#f5e680" stroke-width="1" opacity="0.4"/>
7
+ <polygon points="222,250 218,218 215,218 219,250" fill="#c9960c" opacity="0.6"/>
8
+ <!-- RIGHT HORN -->
9
+ <polygon points="460,248 462,218 512,155" fill="#d4a017"/>
10
+ <polygon points="460,248 512,155 475,230" fill="#e8c840" opacity="0.7"/>
11
+ <polygon points="462,218 512,155 475,230" fill="#b8860b" opacity="0.8"/>
12
+ <line x1="475" y1="230" x2="512" y2="155" stroke="#f5e680" stroke-width="1" opacity="0.4"/>
13
+ <polygon points="458,250 462,218 465,218 461,250" fill="#c9960c" opacity="0.6"/>
14
+ <!-- PAVILION (chin/jaw) -->
15
+ <polygon points="340,530 250,380 230,340 450,340 430,380" fill="#4d0c1a"/>
16
+ <polygon points="340,530 250,380 290,380" fill="#5c1220"/>
17
+ <polygon points="340,530 290,380 340,370" fill="#6a1525"/>
18
+ <polygon points="340,530 340,370 390,380" fill="#5c1220"/>
19
+ <polygon points="340,530 390,380 430,380" fill="#4d0c1a"/>
20
+ <!-- GIRDLE (visor band) -->
21
+ <rect x="220" y="330" width="240" height="16" rx="2" fill="#2a2a40" opacity="0.85"/>
22
+ <rect x="220" y="330" width="240" height="16" rx="2" fill="none" stroke="#555555" stroke-width="0.5" opacity="0.4"/>
23
+ <g fill="#888888" opacity="0.6">
24
+ <circle cx="255" cy="338" r="3"/><circle cx="285" cy="338" r="3"/>
25
+ <circle cx="315" cy="338" r="3"/><circle cx="345" cy="338" r="3"/>
26
+ <circle cx="375" cy="338" r="3"/><circle cx="405" cy="338" r="3"/>
27
+ </g>
28
+ <g fill="#bbbbbb" opacity="0.3">
29
+ <circle cx="254" cy="337" r="1.3"/><circle cx="284" cy="337" r="1.3"/>
30
+ <circle cx="314" cy="337" r="1.3"/><circle cx="344" cy="337" r="1.3"/>
31
+ <circle cx="374" cy="337" r="1.3"/><circle cx="404" cy="337" r="1.3"/>
32
+ </g>
33
+ <!-- CROWN FACETS -->
34
+ <polygon points="340,130 460,250 460,330 220,330 220,250" fill="#7b1c2a"/>
35
+ <polygon points="340,130 410,195 340,250 270,195" fill="#d4374b"/>
36
+ <polygon points="340,140 390,190 340,235 290,190" fill="#e85a6e" opacity="0.6"/>
37
+ <polygon points="220,250 270,195 220,330" fill="#6a1525"/>
38
+ <polygon points="460,250 410,195 460,330" fill="#6a1525"/>
39
+ <polygon points="270,195 340,250 220,330 220,250" fill="#8c2234" opacity="0.8"/>
40
+ <polygon points="410,195 340,250 460,330 460,250" fill="#8c2234" opacity="0.8"/>
41
+ <!-- TABLE (top facet) -->
42
+ <polygon points="340,155 385,185 340,215 295,185" fill="#ff7088" opacity="0.45"/>
43
+ <!-- Crown highlight -->
44
+ <line x1="280" y1="200" x2="340" y2="140" stroke="#ff9db0" stroke-width="1" opacity="0.3"/>
45
+ <line x1="340" y1="140" x2="400" y2="200" stroke="#ff9db0" stroke-width="1" opacity="0.2"/>
46
+ <!-- EYES -->
47
+ <ellipse cx="300" cy="308" rx="12" ry="8" fill="#1a0a10"/>
48
+ <circle cx="296" cy="305" r="2" fill="#ffffff" opacity="0.6"/>
49
+ <ellipse cx="380" cy="308" rx="12" ry="8" fill="#1a0a10"/>
50
+ <circle cx="376" cy="305" r="2" fill="#ffffff" opacity="0.6"/>
51
+ </svg>
@@ -6,7 +6,6 @@ require_relative 'plan_builder'
6
6
  require_relative 'migrator'
7
7
 
8
8
  module Adopter
9
- # :reek:TooManyMethods { enabled: false }
10
9
  class AdoptMenu
11
10
  WEB_AUTOMATIONS = %w[selenium capybara watir].freeze
12
11
  TEST_FRAMEWORKS = %w[rspec cucumber minitest].freeze
@@ -25,16 +24,15 @@ module Adopter
25
24
  ci_platform = ask_ci_platform(detection[:ci_platform])
26
25
 
27
26
  execute_adoption(
28
- source_path: source_path,
29
- output_path: output_path,
30
- target_automation: target_automation,
31
- target_framework: target_framework,
32
- ci_platform: ci_platform
27
+ source_path:,
28
+ output_path:,
29
+ target_automation:,
30
+ target_framework:,
31
+ ci_platform:
33
32
  )
34
33
  end
35
34
 
36
35
  # Programmatic entry point for raider_desktop and CLI --parameters
37
- # :reek:LongParameterList { enabled: false }
38
36
  def self.adopt(params)
39
37
  validate_params!(params)
40
38
 
@@ -42,7 +40,7 @@ module Adopter
42
40
  plan = PlanBuilder.new(analysis, params).build
43
41
  results = Migrator.new(plan).execute
44
42
 
45
- { plan: plan, results: results }
43
+ { plan:, results: }
46
44
  end
47
45
 
48
46
  def self.validate_params!(params)
@@ -51,9 +49,7 @@ module Adopter
51
49
  raise ArgumentError, 'target_automation is required' unless params[:target_automation]
52
50
  raise ArgumentError, 'target_framework is required' unless params[:target_framework]
53
51
 
54
- unless WEB_AUTOMATIONS.include?(params[:target_automation])
55
- raise ArgumentError, "target_automation must be one of: #{WEB_AUTOMATIONS.join(', ')}"
56
- end
52
+ raise ArgumentError, "target_automation must be one of: #{WEB_AUTOMATIONS.join(', ')}" unless WEB_AUTOMATIONS.include?(params[:target_automation])
57
53
 
58
54
  return if TEST_FRAMEWORKS.include?(params[:target_framework])
59
55
 
@@ -66,7 +62,7 @@ module Adopter
66
62
  path = @prompt.ask('Enter the path to your existing test project:') do |q|
67
63
  q.required true
68
64
  q.validate ->(input) { Dir.exist?(input) }
69
- q.messages[:valid?] = 'Directory does not exist: %{value}'
65
+ q.messages[:valid?] = 'Directory does not exist: %<value>s'
70
66
  end
71
67
  File.expand_path(path)
72
68
  end
@@ -86,7 +82,7 @@ module Adopter
86
82
  def ask_target_automation(detected)
87
83
  default = WEB_AUTOMATIONS.include?(detected) ? detected : nil
88
84
  @prompt.select('Select target automation framework:', WEB_AUTOMATIONS.map(&:capitalize),
89
- default: default&.capitalize) do |menu|
85
+ default: default&.capitalize) do |menu|
90
86
  menu.choice :Quit, -> { exit }
91
87
  end.downcase
92
88
  end
@@ -94,7 +90,7 @@ module Adopter
94
90
  def ask_target_framework(detected)
95
91
  default = TEST_FRAMEWORKS.include?(detected) ? detected : nil
96
92
  @prompt.select('Select target test framework:', TEST_FRAMEWORKS.map(&:capitalize),
97
- default: default&.capitalize) do |menu|
93
+ default: default&.capitalize) do |menu|
98
94
  menu.choice :Quit, -> { exit }
99
95
  end.downcase
100
96
  end
@@ -113,7 +109,7 @@ module Adopter
113
109
  when 'github' then 'Github Actions'
114
110
  when 'gitlab' then 'Gitlab CI/CD'
115
111
  end
116
- @prompt.select('Configure CI/CD?', choices, default: default)
112
+ @prompt.select('Configure CI/CD?', choices, default:)
117
113
  end
118
114
 
119
115
  def execute_adoption(params)
@@ -40,8 +40,7 @@ module Adopter
40
40
  def update_require_paths(content, target_automation)
41
41
  result = content.dup
42
42
  result = update_page_requires(result)
43
- result = update_helper_requires(result, target_automation)
44
- result
43
+ update_helper_requires(result, target_automation)
45
44
  end
46
45
 
47
46
  def update_page_requires(content)
@@ -15,24 +15,21 @@ module Adopter
15
15
  result = ensure_frozen_string_literal(result)
16
16
  result = update_base_class(result)
17
17
  result = add_page_require(result)
18
- result = update_page_instantiation(result)
19
- result
18
+ update_page_instantiation(result)
20
19
  end
21
20
 
22
21
  def convert_test(content, _test_info)
23
22
  result = content.dup
24
23
  result = ensure_frozen_string_literal(result)
25
24
  result = update_require_paths(result, @target_automation)
26
- result = update_page_instantiation(result)
27
- result
25
+ update_page_instantiation(result)
28
26
  end
29
27
 
30
28
  def convert_step(content)
31
29
  result = content.dup
32
30
  result = ensure_frozen_string_literal(result)
33
31
  result = update_require_paths(result, @target_automation)
34
- result = update_page_instantiation(result)
35
- result
32
+ update_page_instantiation(result)
36
33
  end
37
34
 
38
35
  private
@@ -7,7 +7,6 @@ module Adopter
7
7
  :converted_features, :converted_steps, :gemfile_additions,
8
8
  :config_overrides, :warnings, :manual_actions
9
9
 
10
- # :reek:LongParameterList { enabled: false }
11
10
  def initialize(attrs = {})
12
11
  @source_path = attrs[:source_path]
13
12
  @output_path = attrs[:output_path]