ruby_raider 3.5.0 → 3.7.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/README.md +10 -1
- data/RELEASE.md +17 -0
- data/lib/generators/common_generator.rb +0 -6
- data/lib/generators/generator.rb +9 -0
- data/lib/generators/helper_generator.rb +0 -7
- data/lib/generators/infrastructure/azure_generator.rb +11 -0
- data/lib/generators/infrastructure/github_generator.rb +2 -2
- data/lib/generators/infrastructure/templates/azure_pipelines.tt +44 -0
- data/lib/generators/infrastructure/templates/github.tt +0 -33
- data/lib/generators/invoke_generators.rb +19 -1
- data/lib/generators/menu_generator.rb +16 -6
- data/lib/generators/templates/common/gemfile.tt +1 -5
- data/lib/generators/templates/common/git_ignore.tt +0 -3
- data/lib/generators/templates/common/read_me.tt +26 -7
- data/lib/generators/templates/helpers/partials/screenshot.tt +3 -3
- data/lib/generators/templates/helpers/spec_helper.tt +0 -6
- data/lib/ruby_raider.rb +8 -1
- data/lib/version +1 -1
- data/sig/generators/common_generator.rbs +0 -1
- data/sig/generators/generator.rbs +2 -0
- data/sig/generators/helper_generator.rbs +0 -2
- data/sig/generators/infrastructure/azure_generator.rbs +4 -0
- data/sig/generators/invoke_generators.rbs +5 -0
- data/sig/generators/menu_generator.rbs +2 -1
- data/sig/ruby_raider.rbs +1 -0
- data/spec/integration/content/azure_content_spec.rb +109 -0
- data/spec/integration/content/ci_content_spec.rb +6 -10
- data/spec/integration/content/common_content_spec.rb +2 -2
- data/spec/integration/content/gemfile_content_spec.rb +6 -6
- data/spec/integration/content/helper_content_spec.rb +3 -42
- data/spec/integration/content/readme_content_spec.rb +3 -2
- data/spec/integration/content/rspec_reporter_content_spec.rb +26 -0
- data/spec/integration/end_to_end_spec.rb +93 -4
- data/spec/integration/generators/azure_generator_spec.rb +100 -0
- data/spec/integration/generators/helpers_generator_spec.rb +2 -6
- data/spec/menus/menu_generator_spec.rb +49 -0
- metadata +9 -9
- data/lib/generators/templates/helpers/allure_helper.tt +0 -32
- data/lib/generators/templates/helpers/partials/allure_imports.tt +0 -7
- data/lib/generators/templates/helpers/partials/allure_requirements.tt +0 -8
- data/lib/generators/templates/helpers/partials/video_start.tt +0 -9
- data/lib/generators/templates/helpers/partials/video_stop.tt +0 -4
- data/lib/generators/templates/helpers/test_helper.tt +0 -88
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1dcadd35b6861c6b6e789c0c06cdd4b2febd6d0fdd664eb65faff04ddf206856
|
|
4
|
+
data.tar.gz: fdc320f7e5c560920318b9d3fd4a46a1aec8ef9bfadd371820f85b5b72ed75e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc8218ab6eff3ebf9b86cde049cc9876ee2528e86adaa60ed2cb954401417df4acdb68cb28a1d948524b87429a6680c0906717ee5fc0117d9adc00c4054b6348
|
|
7
|
+
data.tar.gz: '0094141af34fd3154591755d8fb882f6604aca77b8d5a94bd0946c49474fb6b53e91746af5a656b6ac35a62de17881ee93fafc84f0e1f5c03189db32195dfafe'
|
data/README.md
CHANGED
|
@@ -50,6 +50,7 @@ Ruby Raider is a CLI gem and API backend for scaffolding and generating UI test
|
|
|
50
50
|
| Add-on | Flag | Description |
|
|
51
51
|
|--------|------|-------------|
|
|
52
52
|
| Accessibility | `--accessibility` | Adds axe gem + example accessibility tests |
|
|
53
|
+
| CI provider | `-p ci:azure` | Generates `azure-pipelines.yml` instead of the GitHub Actions workflow (default `ci:github`) |
|
|
53
54
|
|
|
54
55
|
This works on all platforms (Mac OS, Linux and Windows).
|
|
55
56
|
|
|
@@ -59,7 +60,6 @@ Every generated project comes with:
|
|
|
59
60
|
|
|
60
61
|
- **Page Object Model** — Base page and component classes with example pages
|
|
61
62
|
- **Test examples** — Working login tests against the [Raider Test Store](https://raider-test-site.onrender.com/)
|
|
62
|
-
- **Allure reporting** (RSpec) — Pre-configured with screenshot capture on failure
|
|
63
63
|
- **Raider reporting** — RSpec and Cucumber projects include [raider_reporter](https://github.com/RaiderHQ/raider_reporter), which writes results to `raider-results/` and uploads runs when `RAIDER_TOKEN` and `RAIDER_ENDPOINT` are set
|
|
64
64
|
- **GitHub Actions CI** — Ready-to-use test pipeline
|
|
65
65
|
- **Rake tasks** — Default, smoke, and regression tasks with tag-based filtering
|
|
@@ -101,6 +101,15 @@ Add accessibility testing:
|
|
|
101
101
|
raider new my_project -p framework:rspec automation:selenium --accessibility
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
+
Generate an Azure Pipelines file instead of GitHub Actions (web projects only):
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
raider new my_project -p framework:rspec automation:selenium ci:azure
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Azure Pipelines for mobile (Appium) projects is not available yet: with `ci:azure` no pipeline file is generated and a notice is printed.
|
|
111
|
+
Azure Repos ignores `pr:` triggers, so add the pipeline as a Build validation branch policy to get pull request builds.
|
|
112
|
+
|
|
104
113
|
## Commands
|
|
105
114
|
|
|
106
115
|
###### Anything between square brackets ([...]) is where your input goes
|
data/RELEASE.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## Release Notes
|
|
4
4
|
|
|
5
|
+
### 3.7.0
|
|
6
|
+
|
|
7
|
+
- Generated RSpec projects no longer include Allure: the `allure-rspec` and `allure-ruby-commons` gems, `helpers/allure_helper.rb`, the `allure-results` folder and `.gitignore` entry, and the Allure report and gh-pages steps in the GitHub Actions workflow are gone. `raider_reporter` is now the only reporter.
|
|
8
|
+
- Generated Gemfiles now require `raider_reporter` `~> 0.7`, which writes a browsable `raider-results/index.html` next to `run.json`; `bundle exec raider-reporter report` rebuilds it.
|
|
9
|
+
- The generated Readme's Reporting section points to the local HTML report; failure screenshots are attached to the report and to Raider.
|
|
10
|
+
- The unused `test_helper` and `video_stop` templates (Allure-only) are removed.
|
|
11
|
+
|
|
12
|
+
### 3.6.0
|
|
13
|
+
|
|
14
|
+
- New `ci` parameter: `raider new my_project -p framework:rspec automation:selenium ci:azure` generates an `azure-pipelines.yml` for web projects instead of the GitHub Actions workflow. `ci:github` (the default) is unchanged; any other value fails with `Invalid parameters: ci must be github or azure`.
|
|
15
|
+
- The pipeline runs the suite on `ubuntu-latest`, publishes `raider-results/` as a pipeline artifact and includes a `raider_comment` job that comments Raider results on pull requests via `raider-reporter comment`. It needs the `RAIDER_TOKEN` (secret) and `RAIDER_ENDPOINT` pipeline variables and the "Contribute to pull requests" permission for the build service.
|
|
16
|
+
- Azure Repos ignores `pr:` triggers: add the pipeline as a Build validation branch policy so pull request builds and the Raider comment run.
|
|
17
|
+
- The interactive menu asks "Which CI provider?" (GitHub Actions / Azure Pipelines) for web automations.
|
|
18
|
+
- The generated Readme gets an "Azure Pipelines" section when `ci:azure` is used.
|
|
19
|
+
- Mobile projects with `ci:azure` get no pipeline file yet; `raider new` prints a notice.
|
|
20
|
+
- Generated Gemfiles now require `raider_reporter` `~> 0.5`.
|
|
21
|
+
|
|
5
22
|
### 3.5.0
|
|
6
23
|
|
|
7
24
|
- Generated Cucumber projects now report through `raider_reporter` `~> 0.4` instead of Allure: results are written to `raider-results/` and uploaded when `RAIDER_TOKEN` and `RAIDER_ENDPOINT` are set. The reporter is activated by `require 'raider_reporter/cucumber'` in `features/support/env.rb`.
|
data/lib/generators/generator.rb
CHANGED
|
@@ -51,6 +51,15 @@ class Generator < Thor::Group
|
|
|
51
51
|
args.include?('rspec')
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
+
# Only the options after automation, framework and name, so a project named "azure" is not Azure CI
|
|
55
|
+
def azure?
|
|
56
|
+
args.drop(3).include?('azure')
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def github_ci?
|
|
60
|
+
!azure?
|
|
61
|
+
end
|
|
62
|
+
|
|
54
63
|
def selenium?
|
|
55
64
|
args.include?('selenium')
|
|
56
65
|
end
|
|
@@ -7,18 +7,11 @@ class HelpersGenerator < Generator
|
|
|
7
7
|
generate_browser_helper
|
|
8
8
|
generate_driver_helper
|
|
9
9
|
generate_appium_helper
|
|
10
|
-
generate_allure_helper
|
|
11
10
|
generate_spec_helper
|
|
12
11
|
end
|
|
13
12
|
|
|
14
13
|
private
|
|
15
14
|
|
|
16
|
-
def generate_allure_helper
|
|
17
|
-
return if cucumber?
|
|
18
|
-
|
|
19
|
-
template('helpers/allure_helper.tt', "#{name}/helpers/allure_helper.rb")
|
|
20
|
-
end
|
|
21
|
-
|
|
22
15
|
def generate_browser_helper
|
|
23
16
|
return if selenium_based? || mobile?
|
|
24
17
|
|
|
@@ -4,13 +4,13 @@ require_relative '../generator'
|
|
|
4
4
|
|
|
5
5
|
class GithubGenerator < Generator
|
|
6
6
|
def generate_actions_file
|
|
7
|
-
return unless web?
|
|
7
|
+
return unless github_ci? && web?
|
|
8
8
|
|
|
9
9
|
template('github.tt', "#{name}/.github/workflows/test_pipeline.yml")
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def generate_appium_pipeline
|
|
13
|
-
return unless mobile?
|
|
13
|
+
return unless github_ci? && mobile?
|
|
14
14
|
|
|
15
15
|
template('github_appium.tt', "#{name}/.github/workflows/appium_pipeline.yml")
|
|
16
16
|
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
trigger:
|
|
2
|
+
branches:
|
|
3
|
+
include: [main, master]
|
|
4
|
+
# Azure Repos ignores pr: — add this pipeline as a Build validation branch policy so pull request builds (and the Raider comment) run.
|
|
5
|
+
pr:
|
|
6
|
+
branches:
|
|
7
|
+
include: ['*']
|
|
8
|
+
|
|
9
|
+
# Self-hosted agent? Replace vmImage with: pool: { name: Default }
|
|
10
|
+
pool:
|
|
11
|
+
vmImage: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
variables:
|
|
14
|
+
HEADLESS: 'true'
|
|
15
|
+
# Add RAIDER_TOKEN (secret) and RAIDER_ENDPOINT as pipeline variables.
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
- job: tests
|
|
19
|
+
steps:
|
|
20
|
+
- task: UseRubyVersion@0
|
|
21
|
+
inputs: { versionSpec: '3.4' }
|
|
22
|
+
- script: bundle install
|
|
23
|
+
displayName: Install gems
|
|
24
|
+
- script: <%- if cucumber? -%>bundle exec cucumber features/ --format pretty<%- else -%>bundle exec rspec spec/ --format documentation<%- end %>
|
|
25
|
+
displayName: Run tests
|
|
26
|
+
env:
|
|
27
|
+
RAIDER_TOKEN: $(RAIDER_TOKEN)
|
|
28
|
+
RAIDER_ENDPOINT: $(RAIDER_ENDPOINT)
|
|
29
|
+
- task: PublishPipelineArtifact@1
|
|
30
|
+
condition: always()
|
|
31
|
+
inputs: { targetPath: raider-results, artifact: raider-results-$(System.JobPositionInPhase)-$(System.JobAttempt) }
|
|
32
|
+
- job: raider_comment
|
|
33
|
+
dependsOn: tests
|
|
34
|
+
condition: and(always(), eq(variables['Build.Reason'], 'PullRequest'))
|
|
35
|
+
steps:
|
|
36
|
+
- task: UseRubyVersion@0
|
|
37
|
+
inputs: { versionSpec: '3.4' }
|
|
38
|
+
- script: bundle install
|
|
39
|
+
- script: bundle exec raider-reporter comment
|
|
40
|
+
displayName: Comment Raider results on the pull request
|
|
41
|
+
env:
|
|
42
|
+
RAIDER_TOKEN: $(RAIDER_TOKEN)
|
|
43
|
+
RAIDER_ENDPOINT: $(RAIDER_ENDPOINT)
|
|
44
|
+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
@@ -33,11 +33,6 @@ jobs:
|
|
|
33
33
|
with:
|
|
34
34
|
chrome-version: stable
|
|
35
35
|
|
|
36
|
-
<%- unless framework == 'cucumber' -%>
|
|
37
|
-
- name: Create allure-results folder
|
|
38
|
-
run: mkdir -p allure-results
|
|
39
|
-
|
|
40
|
-
<%- end -%>
|
|
41
36
|
- name: Run tests
|
|
42
37
|
run: <%- if framework == 'cucumber' -%>bundle exec cucumber features --format pretty<%- else -%>bundle exec rspec spec --format documentation<%- end %>
|
|
43
38
|
env:
|
|
@@ -53,34 +48,6 @@ jobs:
|
|
|
53
48
|
path: raider-results/
|
|
54
49
|
if-no-files-found: ignore
|
|
55
50
|
|
|
56
|
-
<%- unless framework == 'cucumber' -%>
|
|
57
|
-
- name: Get Allure history
|
|
58
|
-
uses: actions/checkout@v2
|
|
59
|
-
if: always()
|
|
60
|
-
continue-on-error: true
|
|
61
|
-
with:
|
|
62
|
-
ref: gh-pages
|
|
63
|
-
path: gh-pages
|
|
64
|
-
|
|
65
|
-
- name: Allure Report
|
|
66
|
-
uses: simple-elf/allure-report-action@master
|
|
67
|
-
if: always()
|
|
68
|
-
id: allure-report
|
|
69
|
-
with:
|
|
70
|
-
allure_results: allure-results
|
|
71
|
-
gh_pages: gh-pages
|
|
72
|
-
allure_report: allure-report
|
|
73
|
-
allure_history: allure-history
|
|
74
|
-
|
|
75
|
-
- name: Deploy report to Github Pages
|
|
76
|
-
if: always()
|
|
77
|
-
uses: peaceiris/actions-gh-pages@v2
|
|
78
|
-
env:
|
|
79
|
-
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
80
|
-
PUBLISH_BRANCH: gh-pages
|
|
81
|
-
PUBLISH_DIR: allure-history
|
|
82
|
-
|
|
83
|
-
<%- end -%>
|
|
84
51
|
raider-comment:
|
|
85
52
|
needs: [build]
|
|
86
53
|
if: always() && github.event_name == 'pull_request'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require_relative 'infrastructure/github_generator'
|
|
2
|
+
require_relative 'infrastructure/azure_generator'
|
|
2
3
|
require_relative 'automation/automation_generator'
|
|
3
4
|
require_relative 'common_generator'
|
|
4
5
|
require_relative 'cucumber/cucumber_generator'
|
|
@@ -6,13 +7,16 @@ require_relative 'helper_generator'
|
|
|
6
7
|
require_relative 'rspec/rspec_generator'
|
|
7
8
|
|
|
8
9
|
module InvokeGenerators
|
|
10
|
+
class InvalidParameters < ArgumentError; end
|
|
11
|
+
|
|
9
12
|
module_function
|
|
10
13
|
|
|
11
14
|
def generate_framework(structure = {})
|
|
15
|
+
validate_ci(structure[:ci])
|
|
12
16
|
generators = %w[Automation Common Helpers]
|
|
13
17
|
framework = structure[:framework]
|
|
14
18
|
add_generator(generators, framework.capitalize)
|
|
15
|
-
add_generator(generators, 'Github')
|
|
19
|
+
add_generator(generators, 'Github', 'Azure')
|
|
16
20
|
extra_args = collect_flags(structure)
|
|
17
21
|
generators.each do |generator|
|
|
18
22
|
invoke_generator({
|
|
@@ -23,6 +27,19 @@ module InvokeGenerators
|
|
|
23
27
|
extra_args:
|
|
24
28
|
})
|
|
25
29
|
end
|
|
30
|
+
print_mobile_azure_notice(structure)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def validate_ci(provider)
|
|
34
|
+
return if [nil, '', 'github', 'azure'].include?(provider&.to_s)
|
|
35
|
+
|
|
36
|
+
raise InvalidParameters, 'ci must be github or azure'
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def print_mobile_azure_notice(structure)
|
|
40
|
+
return unless structure[:ci].to_s == 'azure' && mobile_automation?(structure[:automation])
|
|
41
|
+
|
|
42
|
+
puts 'Azure Pipelines template for mobile projects is not available yet; see the README.'
|
|
26
43
|
end
|
|
27
44
|
|
|
28
45
|
def add_generator(generators, *gens)
|
|
@@ -45,6 +62,7 @@ module InvokeGenerators
|
|
|
45
62
|
def collect_flags(structure)
|
|
46
63
|
flags = []
|
|
47
64
|
flags << 'axe_addon' if structure[:accessibility] && !mobile_automation?(structure[:automation])
|
|
65
|
+
flags << 'azure' if structure[:ci].to_s == 'azure'
|
|
48
66
|
flags
|
|
49
67
|
end
|
|
50
68
|
|
|
@@ -30,6 +30,7 @@ class MenuGenerator
|
|
|
30
30
|
automation: options[:automation],
|
|
31
31
|
framework: options[:framework],
|
|
32
32
|
accessibility: options[:accessibility],
|
|
33
|
+
ci: options[:ci],
|
|
33
34
|
name: @name
|
|
34
35
|
}
|
|
35
36
|
generate_framework(structure)
|
|
@@ -75,18 +76,26 @@ class MenuGenerator
|
|
|
75
76
|
end
|
|
76
77
|
end
|
|
77
78
|
|
|
78
|
-
FrameworkOptions = Struct.new(:automation, :framework, :accessibility)
|
|
79
|
+
FrameworkOptions = Struct.new(:automation, :framework, :accessibility, :ci)
|
|
79
80
|
|
|
80
81
|
def create_framework_options(params)
|
|
81
|
-
FrameworkOptions.new(params[:automation], params[:framework], params[:accessibility])
|
|
82
|
+
FrameworkOptions.new(params[:automation], params[:framework], params[:accessibility], params[:ci])
|
|
82
83
|
end
|
|
83
84
|
|
|
84
85
|
def select_accessibility(framework, automation_type)
|
|
85
86
|
return create_framework(framework, automation_type) if mobile_automation?(automation_type)
|
|
86
87
|
|
|
87
88
|
prompt.select('Add accessibility testing (axe)?') do |menu|
|
|
88
|
-
menu.choice :Yes, -> {
|
|
89
|
-
menu.choice :No, -> {
|
|
89
|
+
menu.choice :Yes, -> { select_ci(framework, automation_type, accessibility: true) }
|
|
90
|
+
menu.choice :No, -> { select_ci(framework, automation_type, accessibility: false) }
|
|
91
|
+
menu.choice :Quit, -> { exit }
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def select_ci(framework, automation_type, accessibility:)
|
|
96
|
+
prompt.select('Which CI provider?') do |menu|
|
|
97
|
+
menu.choice 'GitHub Actions', -> { create_framework(framework, automation_type, accessibility:) }
|
|
98
|
+
menu.choice 'Azure Pipelines', -> { create_framework(framework, automation_type, accessibility:, ci_provider: 'azure') }
|
|
90
99
|
menu.choice :Quit, -> { exit }
|
|
91
100
|
end
|
|
92
101
|
end
|
|
@@ -95,15 +104,16 @@ class MenuGenerator
|
|
|
95
104
|
%w[ios android cross_platform].include?(automation_type)
|
|
96
105
|
end
|
|
97
106
|
|
|
98
|
-
def create_framework(framework, automation_type, accessibility: false)
|
|
107
|
+
def create_framework(framework, automation_type, accessibility: false, ci_provider: nil)
|
|
99
108
|
options = create_framework_options(automation: automation_type,
|
|
100
109
|
framework: framework.downcase,
|
|
101
|
-
accessibility:)
|
|
110
|
+
accessibility:, ci: ci_provider)
|
|
102
111
|
|
|
103
112
|
puts 'Chosen Options:'
|
|
104
113
|
puts " Automation Type: #{options[:automation]}"
|
|
105
114
|
puts " Framework: #{options[:framework]}"
|
|
106
115
|
puts ' Accessibility: enabled' if options[:accessibility]
|
|
116
|
+
puts ' CI: Azure Pipelines' if options[:ci] == 'azure'
|
|
107
117
|
|
|
108
118
|
set_up_framework(options)
|
|
109
119
|
prompt.say("You have chosen to use #{framework} with #{automation_type}")
|
|
@@ -5,10 +5,6 @@ gem 'activesupport'
|
|
|
5
5
|
gem 'appium_lib'
|
|
6
6
|
gem 'appium_console'
|
|
7
7
|
<% end %>
|
|
8
|
-
<%- if rspec? -%>
|
|
9
|
-
gem 'allure-rspec', '2.28.0'
|
|
10
|
-
gem 'allure-ruby-commons', '2.28.0'
|
|
11
|
-
<%- end -%>
|
|
12
8
|
<%- if axe_addon? -%>
|
|
13
9
|
gem 'axe-core-rspec'
|
|
14
10
|
gem 'axe-core-selenium'
|
|
@@ -17,7 +13,7 @@ gem 'parallel_split_test'
|
|
|
17
13
|
gem 'parallel_tests'
|
|
18
14
|
gem 'rake'
|
|
19
15
|
gem 'reek'
|
|
20
|
-
gem 'raider_reporter', '~> 0.
|
|
16
|
+
gem 'raider_reporter', '~> 0.7'
|
|
21
17
|
<%- if rspec? -%>
|
|
22
18
|
gem 'rspec-retry'
|
|
23
19
|
<%- end -%>
|
|
@@ -85,10 +85,11 @@ raider g scaffold [NAME] # Create page + test + steps
|
|
|
85
85
|
## Reporting
|
|
86
86
|
|
|
87
87
|
<%- if rspec? -%>
|
|
88
|
-
Every run writes machine-readable results to `raider-results/` (including `run.json`)
|
|
89
|
-
|
|
88
|
+
Every run writes machine-readable results to `raider-results/` (including `run.json`) and a browsable report,
|
|
89
|
+
`raider-results/index.html`. Open it in a browser after a run; `bundle exec raider-reporter report` rebuilds it.
|
|
90
90
|
<%- else -%>
|
|
91
|
-
Every run writes machine-readable results to `raider-results/` (including `run.json`)
|
|
91
|
+
Every run writes machine-readable results to `raider-results/` (including `run.json`) and a browsable report,
|
|
92
|
+
`raider-results/index.html`. The reporter runs in plugin mode:
|
|
92
93
|
`features/support/env.rb` requires `raider_reporter/cucumber`, so no extra Cucumber formatter flag is needed.
|
|
93
94
|
<%- end -%>
|
|
94
95
|
|
|
@@ -100,13 +101,31 @@ export RAIDER_ENDPOINT=https://your-raider-endpoint
|
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
<%- if rspec? -%>
|
|
103
|
-
Without `RAIDER_TOKEN`, nothing is uploaded and the suite output is unchanged. Failure screenshots are attached to
|
|
104
|
-
|
|
104
|
+
Without `RAIDER_TOKEN`, nothing is uploaded and the suite output is unchanged. Failure screenshots are attached to the
|
|
105
|
+
report and to Raider. See the [raider_reporter README](https://github.com/RaiderHQ/raider_reporter) for details.
|
|
105
106
|
<%- else -%>
|
|
106
|
-
Without `RAIDER_TOKEN`, nothing is uploaded and the suite output is unchanged. Failure screenshots are attached to
|
|
107
|
-
Raider. See the [raider_reporter README](https://github.com/RaiderHQ/raider_reporter) for details.
|
|
107
|
+
Without `RAIDER_TOKEN`, nothing is uploaded and the suite output is unchanged. Failure screenshots are attached to the
|
|
108
|
+
report and to Raider. See the [raider_reporter README](https://github.com/RaiderHQ/raider_reporter) for details.
|
|
108
109
|
<%- end -%>
|
|
109
110
|
|
|
111
|
+
<%- if azure? && mobile? -%>
|
|
112
|
+
## CI
|
|
113
|
+
|
|
114
|
+
Azure Pipelines template for mobile projects is not available yet. Use GitHub Actions (`ci:github`) or write your own pipeline; see the raider_reporter README for the Azure setup.
|
|
115
|
+
|
|
116
|
+
<%- elsif azure? -%>
|
|
117
|
+
## Azure Pipelines
|
|
118
|
+
|
|
119
|
+
`azure-pipelines.yml` runs the suite on `ubuntu-latest` and, on pull requests, comments the Raider results.
|
|
120
|
+
|
|
121
|
+
- Create a pipeline from `azure-pipelines.yml`, then add `RAIDER_TOKEN` (mark it secret) and `RAIDER_ENDPOINT` as pipeline variables.
|
|
122
|
+
- Contribute to pull requests: grant the pipeline's build service identity (`<Project> Build Service (<Organization>)`) the "Contribute to pull requests" permission on the repository, so `raider-reporter comment` can post the comment and status.
|
|
123
|
+
- Azure Repos ignores `pr:` triggers. Add this pipeline as a Build validation branch policy so pull request builds (and the Raider comment) run.
|
|
124
|
+
- Keep the `raider_comment` job in the same stage as the `tests` job.
|
|
125
|
+
- Pull request comments work for Azure Repos only; a GitHub-hosted repo built by Azure Pipelines gets results uploaded but no PR comment.
|
|
126
|
+
- Self-hosted agent? Replace `vmImage: ubuntu-latest` with `pool: { name: Default }`.
|
|
127
|
+
|
|
128
|
+
<%- end -%>
|
|
110
129
|
### Sponsors
|
|
111
130
|
|
|
112
131
|
This project is tested with BrowserStack.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<% if selenium_based? %>
|
|
2
|
-
|
|
2
|
+
driver.save_screenshot(screenshot_path)
|
|
3
3
|
<% elsif watir? %>
|
|
4
|
-
|
|
4
|
+
browser.screenshot.save(screenshot_path)
|
|
5
5
|
<% else %>
|
|
6
|
-
|
|
6
|
+
driver.screenshot(screenshot_path)
|
|
7
7
|
<% end %>
|
|
@@ -5,10 +5,8 @@ require 'axe-rspec'
|
|
|
5
5
|
<%- end -%>
|
|
6
6
|
require 'rspec'
|
|
7
7
|
require 'rspec/retry'
|
|
8
|
-
require 'digest'
|
|
9
8
|
require 'raider_reporter/rspec'
|
|
10
9
|
require 'tmpdir'
|
|
11
|
-
require_relative 'allure_helper'
|
|
12
10
|
<%- if watir? -%>
|
|
13
11
|
require_relative 'browser_helper'
|
|
14
12
|
<%- else -%>
|
|
@@ -16,14 +14,11 @@ require_relative 'driver_helper'
|
|
|
16
14
|
<%- end -%>
|
|
17
15
|
|
|
18
16
|
module SpecHelper
|
|
19
|
-
|
|
20
|
-
AllureHelper.configure
|
|
21
17
|
RSpec.configure do |config|
|
|
22
18
|
config.example_status_persistence_file_path = 'spec/examples.txt'
|
|
23
19
|
config.verbose_retry = true
|
|
24
20
|
config.display_try_failure_messages = true
|
|
25
21
|
config.default_retry_count = ENV.fetch('RETRY_COUNT', 0).to_i
|
|
26
|
-
config.add_formatter(AllureHelper.formatter)
|
|
27
22
|
config.add_formatter(RaiderReporter::RSpec::Formatter)
|
|
28
23
|
<%- if watir? -%>
|
|
29
24
|
config.include(BrowserHelper)
|
|
@@ -59,7 +54,6 @@ module SpecHelper
|
|
|
59
54
|
Dir.mktmpdir do |temp_folder|
|
|
60
55
|
screenshot_path = "#{temp_folder}/#{example_name}.png"
|
|
61
56
|
<%= partial('screenshot', strip: true) %>
|
|
62
|
-
AllureHelper.add_screenshot(example_name, screenshot)
|
|
63
57
|
RaiderReporter.attach('screenshot', screenshot_path, type: :png)
|
|
64
58
|
end
|
|
65
59
|
end
|
data/lib/ruby_raider.rb
CHANGED
|
@@ -25,7 +25,7 @@ module RubyRaider
|
|
|
25
25
|
params[:name] = project_name
|
|
26
26
|
parsed_hash = params.transform_keys(&:to_sym)
|
|
27
27
|
merge_flags(parsed_hash)
|
|
28
|
-
return
|
|
28
|
+
return generate_from_parameters(parsed_hash)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
MenuGenerator.new(project_name).generate_choice_menu
|
|
@@ -50,6 +50,13 @@ module RubyRaider
|
|
|
50
50
|
map 'u' => 'utility'
|
|
51
51
|
|
|
52
52
|
no_tasks do
|
|
53
|
+
def generate_from_parameters(params)
|
|
54
|
+
InvokeGenerators.generate_framework(params)
|
|
55
|
+
rescue InvokeGenerators::InvalidParameters => e
|
|
56
|
+
puts "Invalid parameters: #{e.message}"
|
|
57
|
+
exit 1
|
|
58
|
+
end
|
|
59
|
+
|
|
53
60
|
def merge_flags(params)
|
|
54
61
|
params[:accessibility] = true if options[:accessibility]
|
|
55
62
|
end
|
data/lib/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.7.0
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Type definitions for InvokeGenerators module
|
|
2
2
|
module InvokeGenerators
|
|
3
|
+
class InvalidParameters < ArgumentError
|
|
4
|
+
end
|
|
5
|
+
|
|
3
6
|
def self?.generate_framework: (?Hash[Symbol, untyped] structure) -> void
|
|
7
|
+
def self?.validate_ci: (untyped provider) -> void
|
|
8
|
+
def self?.print_mobile_azure_notice: (Hash[Symbol, untyped] structure) -> void
|
|
4
9
|
def self?.add_generator: (Array[String] generators, *String gens) -> void
|
|
5
10
|
def self?.invoke_generator: (?Hash[Symbol, untyped] structure) -> void
|
|
6
11
|
def self?.collect_flags: (Hash[Symbol, untyped] structure) -> Array[String]
|
|
@@ -18,7 +18,8 @@ class MenuGenerator
|
|
|
18
18
|
def create_framework_options: (Hash[Symbol, untyped] params) -> untyped
|
|
19
19
|
def select_accessibility: (String framework, String automation_type) -> void
|
|
20
20
|
def mobile_automation?: (String automation_type) -> bool
|
|
21
|
-
def
|
|
21
|
+
def select_ci: (String framework, String automation_type, accessibility: bool) -> void
|
|
22
|
+
def create_framework: (String framework, String automation_type, ?accessibility: bool, ?ci_provider: String?) -> void
|
|
22
23
|
def yes_no_menu_choices: () -> Hash[Symbol, Proc]
|
|
23
24
|
def select_automation_framework: (untyped menu) -> void
|
|
24
25
|
def automation_options: (untyped menu) -> void
|