ruby_raider 3.6.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 +0 -1
- data/RELEASE.md +7 -0
- data/lib/generators/common_generator.rb +0 -6
- data/lib/generators/helper_generator.rb +0 -7
- data/lib/generators/infrastructure/templates/github.tt +0 -33
- 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 +8 -7
- data/lib/generators/templates/helpers/partials/screenshot.tt +3 -3
- data/lib/generators/templates/helpers/spec_helper.tt +0 -6
- data/lib/version +1 -1
- data/sig/generators/common_generator.rbs +0 -1
- data/sig/generators/helper_generator.rbs +0 -2
- 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/generators/helpers_generator_spec.rb +2 -6
- metadata +4 -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
|
@@ -60,7 +60,6 @@ Every generated project comes with:
|
|
|
60
60
|
|
|
61
61
|
- **Page Object Model** — Base page and component classes with example pages
|
|
62
62
|
- **Test examples** — Working login tests against the [Raider Test Store](https://raider-test-site.onrender.com/)
|
|
63
|
-
- **Allure reporting** (RSpec) — Pre-configured with screenshot capture on failure
|
|
64
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
|
|
65
64
|
- **GitHub Actions CI** — Ready-to-use test pipeline
|
|
66
65
|
- **Rake tasks** — Default, smoke, and regression tasks with tag-based filtering
|
data/RELEASE.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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
|
+
|
|
5
12
|
### 3.6.0
|
|
6
13
|
|
|
7
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`.
|
|
@@ -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
|
|
|
@@ -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'
|
|
@@ -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,11 +101,11 @@ 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
|
|
|
110
111
|
<%- if azure? && mobile? -%>
|
|
@@ -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/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.7.0
|
|
@@ -128,20 +128,16 @@ describe 'CI pipeline content' do
|
|
|
128
128
|
end
|
|
129
129
|
end
|
|
130
130
|
|
|
131
|
-
shared_examples 'github allure steps' do |project_name|
|
|
132
|
-
subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
|
|
133
|
-
|
|
134
|
-
it 'keeps the Allure steps' do
|
|
135
|
-
expect(pipeline).to include('simple-elf/allure-report-action', 'peaceiris/actions-gh-pages')
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
|
|
139
131
|
shared_examples 'github without allure steps' do |project_name|
|
|
140
132
|
subject(:pipeline) { read_generated(project_name, '.github/workflows/test_pipeline.yml') }
|
|
141
133
|
|
|
142
134
|
it 'has no Allure report or gh-pages steps' do
|
|
143
135
|
expect(pipeline).not_to match(/allure|gh-pages/i)
|
|
144
136
|
end
|
|
137
|
+
|
|
138
|
+
it 'still uploads raider-results' do
|
|
139
|
+
expect(pipeline).to include('name: raider-results', 'path: raider-results/')
|
|
140
|
+
end
|
|
145
141
|
end
|
|
146
142
|
|
|
147
143
|
context 'with rspec and selenium' do
|
|
@@ -151,7 +147,7 @@ describe 'CI pipeline content' do
|
|
|
151
147
|
include_examples 'github triggers', name, 'test_pipeline.yml'
|
|
152
148
|
include_examples 'github raider wiring', name, 'test_pipeline.yml'
|
|
153
149
|
include_examples 'github raider-comment job', name, 'test_pipeline.yml', %w[build]
|
|
154
|
-
include_examples 'github allure steps', name
|
|
150
|
+
include_examples 'github without allure steps', name
|
|
155
151
|
end
|
|
156
152
|
|
|
157
153
|
context 'with cucumber and selenium' do
|
|
@@ -171,7 +167,7 @@ describe 'CI pipeline content' do
|
|
|
171
167
|
include_examples 'github triggers', name, 'test_pipeline.yml'
|
|
172
168
|
include_examples 'github raider wiring', name, 'test_pipeline.yml'
|
|
173
169
|
include_examples 'github raider-comment job', name, 'test_pipeline.yml', %w[build]
|
|
174
|
-
include_examples 'github allure steps', name
|
|
170
|
+
include_examples 'github without allure steps', name
|
|
175
171
|
end
|
|
176
172
|
|
|
177
173
|
context 'with cucumber and watir' do
|
|
@@ -106,8 +106,8 @@ describe 'Common file content' do
|
|
|
106
106
|
shared_examples 'rspec gitignore' do |project_name|
|
|
107
107
|
subject(:gitignore) { read_generated(project_name, '.gitignore') }
|
|
108
108
|
|
|
109
|
-
it '
|
|
110
|
-
expect(gitignore).
|
|
109
|
+
it 'does not include allure-results' do
|
|
110
|
+
expect(gitignore).not_to include('allure-results')
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
it 'includes spec/examples.txt' do
|
|
@@ -34,8 +34,8 @@ describe 'Gemfile content' do
|
|
|
34
34
|
expect(gemfile).to include("gem 'rspec'")
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
it '
|
|
38
|
-
expect(gemfile).
|
|
37
|
+
it 'does not include allure gems' do
|
|
38
|
+
expect(gemfile).not_to match(/allure/i)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
it 'includes rubocop-rspec' do
|
|
@@ -127,11 +127,11 @@ describe 'Gemfile content' do
|
|
|
127
127
|
let(:gemfile) { read_generated("#{FrameworkIndex::RSPEC}_#{automation}", 'Gemfile') }
|
|
128
128
|
|
|
129
129
|
it 'includes raider_reporter' do
|
|
130
|
-
expect(gemfile).to include("gem 'raider_reporter', '~> 0.
|
|
130
|
+
expect(gemfile).to include("gem 'raider_reporter', '~> 0.7'")
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
it '
|
|
134
|
-
expect(gemfile).
|
|
133
|
+
it 'has no allure gems' do
|
|
134
|
+
expect(gemfile).not_to match(/allure/i)
|
|
135
135
|
end
|
|
136
136
|
|
|
137
137
|
it 'pins ruby_raider to the generator major.minor' do
|
|
@@ -143,7 +143,7 @@ describe 'Gemfile content' do
|
|
|
143
143
|
let(:gemfile) { read_generated("#{FrameworkIndex::CUCUMBER}_#{automation}", 'Gemfile') }
|
|
144
144
|
|
|
145
145
|
it 'includes raider_reporter' do
|
|
146
|
-
expect(gemfile).to include("gem 'raider_reporter', '~> 0.
|
|
146
|
+
expect(gemfile).to include("gem 'raider_reporter', '~> 0.7'")
|
|
147
147
|
end
|
|
148
148
|
|
|
149
149
|
it 'drops allure-cucumber' do
|
|
@@ -103,10 +103,6 @@ describe 'Helper file content' do
|
|
|
103
103
|
it 'configures RSpec' do
|
|
104
104
|
expect(helper).to include('RSpec.configure')
|
|
105
105
|
end
|
|
106
|
-
|
|
107
|
-
it 'requires allure_helper' do
|
|
108
|
-
expect(helper).to include("require_relative 'allure_helper'")
|
|
109
|
-
end
|
|
110
106
|
end
|
|
111
107
|
|
|
112
108
|
shared_examples 'raider reporter spec helper' do |project_name, screenshot_call|
|
|
@@ -116,10 +112,6 @@ describe 'Helper file content' do
|
|
|
116
112
|
expect(helper).to include("require 'raider_reporter/rspec'")
|
|
117
113
|
end
|
|
118
114
|
|
|
119
|
-
it 'requires digest, which allure-ruby-commons uses without requiring' do
|
|
120
|
-
expect(helper).to include("require 'digest'")
|
|
121
|
-
end
|
|
122
|
-
|
|
123
115
|
it 'adds the raider formatter in spec_helper so a command-line --format cannot drop it' do
|
|
124
116
|
expect(helper).to include('config.add_formatter(RaiderReporter::RSpec::Formatter)')
|
|
125
117
|
end
|
|
@@ -128,10 +120,6 @@ describe 'Helper file content' do
|
|
|
128
120
|
expect(helper).not_to match(/config\.formatter\s*=/)
|
|
129
121
|
end
|
|
130
122
|
|
|
131
|
-
it 'adds the allure formatter' do
|
|
132
|
-
expect(helper).to include('config.add_formatter(AllureHelper.formatter)')
|
|
133
|
-
end
|
|
134
|
-
|
|
135
123
|
it 'screenshots only on failure' do
|
|
136
124
|
lines = helper.lines
|
|
137
125
|
start = lines.index { |line| line.include?('if example.exception') }
|
|
@@ -140,8 +128,9 @@ describe 'Helper file content' do
|
|
|
140
128
|
body = lines[(start + 1)..].take_while { |line| line.strip.empty? || line[/\A */].size > indent }
|
|
141
129
|
guarded = body.join
|
|
142
130
|
|
|
143
|
-
expect(guarded).to include('
|
|
144
|
-
expect(
|
|
131
|
+
expect(guarded).to include('RaiderReporter.attach', screenshot_call)
|
|
132
|
+
expect(helper).not_to include('AllureHelper')
|
|
133
|
+
expect(helper).not_to match(/screenshot\s*=/)
|
|
145
134
|
expect(lines.select { |line| line.include?(screenshot_call) }.size).to eq(1)
|
|
146
135
|
end
|
|
147
136
|
|
|
@@ -182,20 +171,6 @@ describe 'Helper file content' do
|
|
|
182
171
|
end
|
|
183
172
|
end
|
|
184
173
|
|
|
185
|
-
# --- Allure helper ---
|
|
186
|
-
|
|
187
|
-
shared_examples 'valid allure helper' do |project_name|
|
|
188
|
-
subject(:helper) { read_generated(project_name, 'helpers/allure_helper.rb') }
|
|
189
|
-
|
|
190
|
-
it 'has valid Ruby syntax' do
|
|
191
|
-
expect(helper).to have_valid_ruby_syntax
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
it 'defines AllureHelper' do
|
|
195
|
-
expect(helper).to match(/AllureHelper|module AllureHelper|class AllureHelper/)
|
|
196
|
-
end
|
|
197
|
-
end
|
|
198
|
-
|
|
199
174
|
# --- RSpec + automation contexts ---
|
|
200
175
|
|
|
201
176
|
context 'with rspec and selenium' do
|
|
@@ -204,7 +179,6 @@ describe 'Helper file content' do
|
|
|
204
179
|
it_behaves_like 'selenium driver helper', name
|
|
205
180
|
it_behaves_like 'valid spec helper', name
|
|
206
181
|
it_behaves_like 'selenium spec helper', name
|
|
207
|
-
it_behaves_like 'valid allure helper', name
|
|
208
182
|
end
|
|
209
183
|
|
|
210
184
|
context 'with rspec and watir' do
|
|
@@ -212,7 +186,6 @@ describe 'Helper file content' do
|
|
|
212
186
|
it_behaves_like 'valid browser helper', name
|
|
213
187
|
it_behaves_like 'valid spec helper', name
|
|
214
188
|
it_behaves_like 'watir spec helper', name
|
|
215
|
-
it_behaves_like 'valid allure helper', name
|
|
216
189
|
end
|
|
217
190
|
|
|
218
191
|
# --- Cucumber + automation contexts (no spec_helper/test_helper) ---
|
|
@@ -228,18 +201,6 @@ describe 'Helper file content' do
|
|
|
228
201
|
it_behaves_like 'valid browser helper', name
|
|
229
202
|
end
|
|
230
203
|
|
|
231
|
-
# --- Mobile contexts (with AppiumRecorder) ---
|
|
232
|
-
|
|
233
|
-
context 'with cucumber and appium android' do
|
|
234
|
-
name = "#{FrameworkIndex::CUCUMBER}_#{AutomationIndex::ANDROID}"
|
|
235
|
-
|
|
236
|
-
end
|
|
237
|
-
|
|
238
|
-
context 'with rspec and appium ios' do
|
|
239
|
-
name = "#{FrameworkIndex::RSPEC}_#{AutomationIndex::IOS}"
|
|
240
|
-
|
|
241
|
-
end
|
|
242
|
-
|
|
243
204
|
# --- Raider reporter wiring (every rspec automation) ---
|
|
244
205
|
|
|
245
206
|
AUTOMATION_TYPES.each do |automation|
|
|
@@ -16,8 +16,9 @@ describe 'Generated Readme content' do
|
|
|
16
16
|
'https://github.com/RaiderHQ/raider_reporter')
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
it '
|
|
20
|
-
expect(readme).to
|
|
19
|
+
it 'points to the local HTML report' do
|
|
20
|
+
expect(readme).to include('raider-results/index.html')
|
|
21
|
+
expect(readme).not_to match(/allure/i)
|
|
21
22
|
end
|
|
22
23
|
end
|
|
23
24
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'content_helper'
|
|
4
|
+
|
|
5
|
+
describe 'RSpec projects without Allure' do
|
|
6
|
+
AUTOMATION_TYPES.each do |automation|
|
|
7
|
+
context "with rspec and #{automation}" do
|
|
8
|
+
let(:project_name) { "#{FrameworkIndex::RSPEC}_#{automation}" }
|
|
9
|
+
|
|
10
|
+
it 'does not mention Allure in any generated file' do
|
|
11
|
+
files = Dir.glob("#{project_name}/**/*", File::FNM_DOTMATCH).select { |f| File.file?(f) }
|
|
12
|
+
files = files.reject { |f| File.binread(f, 512).include?("\x00") }
|
|
13
|
+
expect(files.select { |f| File.read(f).match?(/allure/i) }).to be_empty
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it 'does not generate the allure helper or the allure-results folder' do
|
|
17
|
+
expect(File).not_to exist(File.join(project_name, 'helpers/allure_helper.rb'))
|
|
18
|
+
expect(File).not_to exist(File.join(project_name, 'allure-results'))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'pins raider_reporter 0.7' do
|
|
22
|
+
expect(read_generated(project_name, 'Gemfile')).to include("gem 'raider_reporter', '~> 0.7'")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -5,12 +5,8 @@ require_relative '../spec_helper'
|
|
|
5
5
|
|
|
6
6
|
describe HelpersGenerator do
|
|
7
7
|
shared_examples 'creates common helpers' do |name|
|
|
8
|
-
it 'creates an allure helper file
|
|
9
|
-
|
|
10
|
-
expect(File).not_to exist("#{name}/helpers/allure_helper.rb")
|
|
11
|
-
else
|
|
12
|
-
expect(File).to exist("#{name}/helpers/allure_helper.rb")
|
|
13
|
-
end
|
|
8
|
+
it 'never creates an allure helper file' do
|
|
9
|
+
expect(File).not_to exist("#{name}/helpers/allure_helper.rb")
|
|
14
10
|
end
|
|
15
11
|
end
|
|
16
12
|
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby_raider
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Pequeno
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rake
|
|
@@ -234,22 +234,16 @@ files:
|
|
|
234
234
|
- lib/generators/templates/common/reek.tt
|
|
235
235
|
- lib/generators/templates/common/rspec.tt
|
|
236
236
|
- lib/generators/templates/common/rubocop.tt
|
|
237
|
-
- lib/generators/templates/helpers/allure_helper.tt
|
|
238
237
|
- lib/generators/templates/helpers/appium_helper.tt
|
|
239
238
|
- lib/generators/templates/helpers/browser_helper.tt
|
|
240
239
|
- lib/generators/templates/helpers/driver_helper.tt
|
|
241
|
-
- lib/generators/templates/helpers/partials/allure_imports.tt
|
|
242
|
-
- lib/generators/templates/helpers/partials/allure_requirements.tt
|
|
243
240
|
- lib/generators/templates/helpers/partials/appium_driver.tt
|
|
244
241
|
- lib/generators/templates/helpers/partials/browserstack_config.tt
|
|
245
242
|
- lib/generators/templates/helpers/partials/driver_and_options.tt
|
|
246
243
|
- lib/generators/templates/helpers/partials/quit_driver.tt
|
|
247
244
|
- lib/generators/templates/helpers/partials/screenshot.tt
|
|
248
245
|
- lib/generators/templates/helpers/partials/selenium_driver.tt
|
|
249
|
-
- lib/generators/templates/helpers/partials/video_start.tt
|
|
250
|
-
- lib/generators/templates/helpers/partials/video_stop.tt
|
|
251
246
|
- lib/generators/templates/helpers/spec_helper.tt
|
|
252
|
-
- lib/generators/templates/helpers/test_helper.tt
|
|
253
247
|
- lib/generators/templates/helpers/video_helper.tt
|
|
254
248
|
- lib/ruby_raider.rb
|
|
255
249
|
- lib/scaffolding/name_normalizer.rb
|
|
@@ -315,6 +309,7 @@ files:
|
|
|
315
309
|
- spec/integration/content/helper_content_spec.rb
|
|
316
310
|
- spec/integration/content/page_content_spec.rb
|
|
317
311
|
- spec/integration/content/readme_content_spec.rb
|
|
312
|
+
- spec/integration/content/rspec_reporter_content_spec.rb
|
|
318
313
|
- spec/integration/content/syntax_validation_spec.rb
|
|
319
314
|
- spec/integration/content/test_content_spec.rb
|
|
320
315
|
- spec/integration/end_to_end_features_spec.rb
|
|
@@ -359,7 +354,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
359
354
|
- !ruby/object:Gem::Version
|
|
360
355
|
version: '0'
|
|
361
356
|
requirements: []
|
|
362
|
-
rubygems_version:
|
|
357
|
+
rubygems_version: 4.0.6
|
|
363
358
|
specification_version: 4
|
|
364
359
|
summary: A gem to make setup and start of UI automation projects easier
|
|
365
360
|
test_files: []
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
<%=- partial('allure_requirements', trim: false, strip: true) -%>
|
|
4
|
-
<%- allure = partial('allure_imports', trim: false, strip: true) -%>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
module AllureHelper
|
|
8
|
-
class << self
|
|
9
|
-
def configure
|
|
10
|
-
<%= allure %>.configure do |config|
|
|
11
|
-
config.results_directory = 'allure-results'
|
|
12
|
-
config.clean_results_directory = true
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def add_screenshot(name, file)
|
|
17
|
-
Allure.add_attachment(
|
|
18
|
-
name:,
|
|
19
|
-
source: file,
|
|
20
|
-
type: Allure::ContentType::PNG,
|
|
21
|
-
test_case: true
|
|
22
|
-
)
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
<%- if rspec? -%>
|
|
26
|
-
|
|
27
|
-
def formatter
|
|
28
|
-
AllureRspecFormatter
|
|
29
|
-
end
|
|
30
|
-
<%- end -%>
|
|
31
|
-
end
|
|
32
|
-
end
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<% if capybara? %>
|
|
2
|
-
@video_recorder = VideoHelper.recorder_for(Capybara.current_session.driver)
|
|
3
|
-
<% elsif selenium_based? %>
|
|
4
|
-
@video_recorder = VideoHelper.recorder_for(driver)
|
|
5
|
-
<% elsif watir? %>
|
|
6
|
-
@video_recorder = VideoHelper.recorder_for(browser)
|
|
7
|
-
<% else %>
|
|
8
|
-
@video_recorder = VideoHelper.recorder_for(driver)
|
|
9
|
-
<% end %>
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
<%- if axe_addon? %>
|
|
4
|
-
require 'axe-minitest'
|
|
5
|
-
<%- end -%>
|
|
6
|
-
require 'minitest/autorun'
|
|
7
|
-
require 'tmpdir'
|
|
8
|
-
<%- if allure_reporter? -%>
|
|
9
|
-
require_relative 'allure_helper'
|
|
10
|
-
<%- end -%>
|
|
11
|
-
<%- unless skip_video? -%>
|
|
12
|
-
require_relative 'video_helper'
|
|
13
|
-
<%- end -%>
|
|
14
|
-
<%- if watir? -%>
|
|
15
|
-
require_relative 'browser_helper'
|
|
16
|
-
<%- elsif capybara? -%>
|
|
17
|
-
require_relative 'capybara_helper'
|
|
18
|
-
<%- else -%>
|
|
19
|
-
require_relative 'driver_helper'
|
|
20
|
-
<%- end -%>
|
|
21
|
-
|
|
22
|
-
<%- if allure_reporter? -%>
|
|
23
|
-
AllureHelper.configure
|
|
24
|
-
<%- end -%>
|
|
25
|
-
<%- if capybara? -%>
|
|
26
|
-
CapybaraHelper.configure
|
|
27
|
-
<%- end -%>
|
|
28
|
-
<%- if json_reporter? -%>
|
|
29
|
-
require 'minitest/reporters'
|
|
30
|
-
Minitest::Reporters.use! [Minitest::Reporters::JsonReporter.new('results/results.json')]
|
|
31
|
-
<%- end -%>
|
|
32
|
-
|
|
33
|
-
module TestHelper
|
|
34
|
-
<% if watir? %>include BrowserHelper<% elsif capybara? %>include Capybara::DSL<% else %>include DriverHelper<% end %>
|
|
35
|
-
|
|
36
|
-
def setup
|
|
37
|
-
super
|
|
38
|
-
<%- if mobile? -%>
|
|
39
|
-
driver.start_driver
|
|
40
|
-
<%- elsif capybara? -%>
|
|
41
|
-
viewport = YAML.load_file('config/config.yml')['viewport']
|
|
42
|
-
if viewport
|
|
43
|
-
Capybara.current_session.driver.browser.manage.window.resize_to(viewport['width'], viewport['height'])
|
|
44
|
-
else
|
|
45
|
-
Capybara.current_session.driver.browser.manage.window.maximize
|
|
46
|
-
end
|
|
47
|
-
<%- elsif watir? -%>
|
|
48
|
-
viewport = YAML.load_file('config/config.yml')['viewport']
|
|
49
|
-
if viewport
|
|
50
|
-
browser.window.resize_to(viewport['width'], viewport['height'])
|
|
51
|
-
else
|
|
52
|
-
browser.window.maximize
|
|
53
|
-
end
|
|
54
|
-
<%- else -%>
|
|
55
|
-
viewport = YAML.load_file('config/config.yml')['viewport']
|
|
56
|
-
if viewport
|
|
57
|
-
driver.manage.window.resize_to(viewport['width'], viewport['height'])
|
|
58
|
-
else
|
|
59
|
-
driver.manage.window.maximize
|
|
60
|
-
end
|
|
61
|
-
<%- end -%>
|
|
62
|
-
<%- unless skip_video? -%>
|
|
63
|
-
<%= partial('video_start', strip: true) %>
|
|
64
|
-
@video_recorder&.start(self.class.name)
|
|
65
|
-
<%- end -%>
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def teardown
|
|
69
|
-
example_name = name
|
|
70
|
-
<%- unless skip_video? -%>
|
|
71
|
-
video_file = @video_recorder&.stop
|
|
72
|
-
<%- if allure_reporter? -%>
|
|
73
|
-
AllureHelper.add_video(example_name, video_file)
|
|
74
|
-
<%- end -%>
|
|
75
|
-
<%- end -%>
|
|
76
|
-
Dir.mktmpdir do |temp_folder|
|
|
77
|
-
screenshot_path = "#{temp_folder}/#{example_name}.png"
|
|
78
|
-
<%= partial('screenshot', strip: true) %>
|
|
79
|
-
<%- if allure_reporter? -%>
|
|
80
|
-
AllureHelper.add_screenshot(example_name, screenshot)
|
|
81
|
-
<%- end -%>
|
|
82
|
-
end
|
|
83
|
-
<%= partial('quit_driver', strip: true) %>
|
|
84
|
-
super
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
Minitest::Test.include(TestHelper)
|