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
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d6b5fccbc2b3752d7f63391226d903a61a1368a404831ef10b1d0d230774fa5
|
|
4
|
+
data.tar.gz: 7d4be1564e22cb7bf47e0d08ced4ae00868140bbd0c65833e733a904e634ecf4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
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:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
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="
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
32
|
+
## Supported Frameworks
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
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
|
-
***
|
|
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
|
-
```
|
|
70
|
+
```bash
|
|
50
71
|
raider u start_appium
|
|
51
|
-
appium --base /wd/hub
|
|
52
72
|
```
|
|
53
73
|
|
|
54
|
-
|
|
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
|
-
|
|
76
|
+
## Getting Started
|
|
62
77
|
|
|
63
|
-
|
|
78
|
+
Install the gem:
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
```bash
|
|
81
|
+
gem install ruby_raider
|
|
82
|
+
```
|
|
66
83
|
|
|
67
|
-
|
|
84
|
+
Create a new project interactively:
|
|
68
85
|
|
|
69
|
-
```
|
|
70
|
-
|
|
86
|
+
```bash
|
|
87
|
+
raider new [project_name]
|
|
71
88
|
```
|
|
72
89
|
|
|
73
|
-
|
|
90
|
+
Or skip the menu with parameters:
|
|
74
91
|
|
|
75
|
-
```
|
|
76
|
-
raider new [
|
|
92
|
+
```bash
|
|
93
|
+
raider new [project_name] -p framework:rspec automation:selenium
|
|
77
94
|
```
|
|
78
95
|
|
|
79
|
-
|
|
80
|
-
selected.
|
|
96
|
+
Add optional features:
|
|
81
97
|
|
|
82
|
-
|
|
98
|
+
```bash
|
|
99
|
+
raider new my_project -p framework:rspec automation:selenium --accessibility --visual --performance
|
|
100
|
+
```
|
|
83
101
|
|
|
84
|
-
|
|
102
|
+
Skip flags for leaner projects:
|
|
85
103
|
|
|
86
|
-
```
|
|
87
|
-
raider new
|
|
104
|
+
```bash
|
|
105
|
+
raider new my_project -p framework:cucumber automation:watir --skip_ci --skip_video --reporter none
|
|
88
106
|
```
|
|
89
107
|
|
|
90
|
-
|
|
108
|
+
## Commands
|
|
109
|
+
|
|
110
|
+
###### Anything between square brackets ([...]) is where your input goes
|
|
91
111
|
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
124
|
+
Shortcuts: `n` (new), `a` (adopt), `g` (generate), `u` (utility), `pm` (plugin_manager), `v` (version)
|
|
97
125
|
|
|
98
|
-
|
|
126
|
+
### Scaffolding Commands
|
|
99
127
|
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
raider
|
|
103
|
-
raider
|
|
104
|
-
raider
|
|
105
|
-
raider
|
|
106
|
-
raider
|
|
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
|
-
|
|
140
|
+
Options:
|
|
110
141
|
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
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
|
-
###
|
|
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
|
-
|
|
166
|
+
### Plugin Commands
|
|
119
167
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
127
|
-
specs.
|
|
175
|
+
### Adopt Command
|
|
128
176
|
|
|
129
|
-
|
|
177
|
+
Import an existing test project into Ruby Raider conventions:
|
|
130
178
|
|
|
131
|
-
```
|
|
132
|
-
raider
|
|
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
|
-
|
|
183
|
+
## LLM Integration
|
|
138
184
|
|
|
139
|
-
|
|
185
|
+
Ruby Raider supports optional LLM-powered features for intelligent test generation. Configure a provider:
|
|
140
186
|
|
|
141
|
-
|
|
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
|
-
|
|
144
|
-
|
|
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
|
-
|
|
205
|
+
## Links
|
|
148
206
|
|
|
149
|
-
|
|
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>
|
data/lib/adopter/adopt_menu.rb
CHANGED
|
@@ -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
|
|
29
|
-
output_path
|
|
30
|
-
target_automation
|
|
31
|
-
target_framework
|
|
32
|
-
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
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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]
|