ruby_raider 1.1.2 → 1.1.4
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/integration.yml +1 -1
- data/.github/workflows/push_gem.yml +1 -1
- data/.github/workflows/reek.yml +1 -1
- data/.github/workflows/rubocop.yml +1 -1
- data/.github/workflows/selenium.yml +1 -1
- data/.github/workflows/watir.yml +1 -1
- data/README.md +1 -1
- data/lib/generators/generator.rb +1 -1
- data/lib/generators/{actions/actions_generator.rb → infrastructure/github_generator.rb} +2 -2
- data/lib/generators/infrastructure/gitlab_generator.rb +11 -0
- data/lib/generators/{actions/templates/actions.tt → infrastructure/templates/github.tt} +1 -1
- data/lib/generators/infrastructure/templates/gitlab.tt +43 -0
- data/lib/generators/invoke_generators.rb +7 -3
- data/lib/generators/menu_generator.rb +18 -7
- data/lib/version +1 -1
- data/spec/integration/generators/github_generator_spec.rb +38 -0
- data/spec/integration/generators/gitlab_generator_spec.rb +38 -0
- data/spec/integration/settings_helper.rb +3 -1
- data/spec/integration/spec_helper.rb +11 -5
- metadata +8 -5
- data/spec/integration/generators/actions_generator_spec.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce82ad5f7e4ea1636cec8a4cdb0a9baae2b9d5641225322909065d8331eb3561
|
4
|
+
data.tar.gz: 16536dc998d9740e1ebb9bcd76fcf36c5040b633a619803d54a04a1ccee41cf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a96ace1d43a22b6d7d8823c09017bf89ea56041e7986e341114e0a1e5b71e5640da06d740cc2f96b7d5fe4f184b28b2e93c39412bbff8ab405683bb347a96f
|
7
|
+
data.tar.gz: bb26f17e8b52393e79466d8cc9d5b821da494658f0a5e54ea18bdb806bd03401df3f1a22687bc7c187f6e6d540d2bf76676a60e70df6a82a05543c272b7bed85
|
@@ -26,7 +26,7 @@ jobs:
|
|
26
26
|
with:
|
27
27
|
egress-policy: audit
|
28
28
|
|
29
|
-
- uses:
|
29
|
+
- uses: infrastructure/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
30
30
|
- name: Set up Ruby
|
31
31
|
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # v1.176.0
|
32
32
|
with:
|
data/.github/workflows/reek.yml
CHANGED
data/.github/workflows/watir.yml
CHANGED
data/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
<br />
|
11
11
|
<div align="center">
|
12
12
|
<a href="https://github.com/RubyRaider/ruby_raider">
|
13
|
-
<img src="https://
|
13
|
+
<img src="https://www.ruby-raider.com/assets/icon-DYY74ofR.png" alt="Logo" style="width:200px;">
|
14
14
|
</a>
|
15
15
|
<p align="center">
|
16
16
|
<a href="https://github.com/RubyRaider/ruby_raider#getting-started"><strong>Explore the docs »</strong></a>
|
data/lib/generators/generator.rb
CHANGED
@@ -12,7 +12,7 @@ class Generator < Thor::Group
|
|
12
12
|
def self.source_paths
|
13
13
|
base_path = File.dirname(__FILE__)
|
14
14
|
%W[#{base_path}/automation/templates #{base_path}/cucumber/templates
|
15
|
-
#{base_path}/rspec/templates #{base_path}/templates #{base_path}/
|
15
|
+
#{base_path}/rspec/templates #{base_path}/templates #{base_path}/infrastructure/templates ]
|
16
16
|
end
|
17
17
|
|
18
18
|
def args
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
require_relative '../generator'
|
4
4
|
|
5
|
-
class
|
5
|
+
class GithubGenerator < Generator
|
6
6
|
def generate_actions_file
|
7
7
|
return unless web?
|
8
8
|
|
9
|
-
template('
|
9
|
+
template('github.tt', "#{name}/.github/workflows/test_pipeline.yml")
|
10
10
|
end
|
11
11
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
stages:
|
2
|
+
- setup
|
3
|
+
- test
|
4
|
+
- report
|
5
|
+
|
6
|
+
variables:
|
7
|
+
RUBY_VERSION: "3.4.0"
|
8
|
+
|
9
|
+
setup_ruby:
|
10
|
+
stage: setup
|
11
|
+
image: ruby:${RUBY_VERSION}
|
12
|
+
script:
|
13
|
+
- bundle install --jobs $(nproc) --retry 3
|
14
|
+
cache:
|
15
|
+
paths:
|
16
|
+
- vendor/bundle
|
17
|
+
|
18
|
+
run_tests:
|
19
|
+
stage: test
|
20
|
+
image: ruby:${RUBY_VERSION}
|
21
|
+
script:
|
22
|
+
- mkdir -p allure-results
|
23
|
+
- <%- if framework == 'cucumber' -%> cucumber features --format pretty <%- else -%> bundle exec rspec spec --format documentation <%- end%>
|
24
|
+
artifacts:
|
25
|
+
paths:
|
26
|
+
- allure-results/
|
27
|
+
when: always
|
28
|
+
|
29
|
+
pages:
|
30
|
+
stage: report
|
31
|
+
image: alpine/git
|
32
|
+
dependencies:
|
33
|
+
- run_tests
|
34
|
+
script:
|
35
|
+
- apk add --no-cache curl unzip
|
36
|
+
- curl -o allure.zip -L https://github.com/allure-framework/allure2/releases/latest/download/allure-commandline.zip
|
37
|
+
- unzip allure.zip -d /tmp/
|
38
|
+
- /tmp/allure-*/bin/allure generate allure-results --clean -o public
|
39
|
+
artifacts:
|
40
|
+
paths:
|
41
|
+
- public
|
42
|
+
only:
|
43
|
+
- main
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'infrastructure/github_generator'
|
2
|
+
require_relative 'infrastructure/gitlab_generator'
|
2
3
|
require_relative 'automation/automation_generator'
|
3
4
|
require_relative 'common_generator'
|
4
5
|
require_relative 'cucumber/cucumber_generator'
|
@@ -11,14 +12,16 @@ module InvokeGenerators
|
|
11
12
|
module_function
|
12
13
|
|
13
14
|
def generate_framework(structure = {})
|
14
|
-
generators = %w[Automation
|
15
|
+
generators = %w[Automation Common Helpers]
|
15
16
|
framework = structure[:framework]
|
16
17
|
add_generator(generators, framework.capitalize)
|
18
|
+
add_generator(generators, structure[:ci_platform].capitalize) if structure[:ci_platform]
|
17
19
|
generators.each do |generator|
|
18
20
|
invoke_generator({
|
19
21
|
automation: structure[:automation],
|
20
22
|
framework:,
|
21
23
|
generator:,
|
24
|
+
ci_platform: structure[:ci_platform],
|
22
25
|
name: structure[:name]
|
23
26
|
})
|
24
27
|
end
|
@@ -32,7 +35,8 @@ module InvokeGenerators
|
|
32
35
|
Object.const_get("#{structure[:generator]}Generator")
|
33
36
|
.new([structure[:automation],
|
34
37
|
structure[:framework],
|
35
|
-
structure[:name]
|
38
|
+
structure[:name],
|
39
|
+
structure[:ci_platform]]).invoke_all
|
36
40
|
end
|
37
41
|
|
38
42
|
def to_bool(string)
|
@@ -31,6 +31,7 @@ class MenuGenerator
|
|
31
31
|
structure = {
|
32
32
|
automation: options[:automation],
|
33
33
|
framework: options[:framework],
|
34
|
+
ci_platform: options[:ci_platform],
|
34
35
|
name: @name
|
35
36
|
}
|
36
37
|
generate_framework(structure)
|
@@ -50,26 +51,27 @@ class MenuGenerator
|
|
50
51
|
|
51
52
|
def select_test_framework(automation)
|
52
53
|
prompt.select('Please select your test framework') do |menu|
|
53
|
-
menu.choice :Cucumber, -> {
|
54
|
-
menu.choice :Rspec, -> {
|
54
|
+
menu.choice :Cucumber, -> { select_ci_platform('Cucumber', automation) }
|
55
|
+
menu.choice :Rspec, -> { select_ci_platform('Rspec', automation) }
|
55
56
|
menu.choice :Quit, -> { exit }
|
56
57
|
end
|
57
58
|
end
|
58
59
|
|
59
|
-
FrameworkOptions = Struct.new(:automation, :framework)
|
60
|
+
FrameworkOptions = Struct.new(:automation, :framework, :ci_platform)
|
60
61
|
|
61
62
|
def create_framework_options(params)
|
62
|
-
FrameworkOptions.new(params[:automation], params[:framework])
|
63
|
+
FrameworkOptions.new(params[:automation], params[:framework], params[:ci_platform])
|
63
64
|
end
|
64
65
|
|
65
|
-
def create_framework(framework, automation_type)
|
66
|
+
def create_framework(framework, automation_type, ci_platform = nil)
|
66
67
|
options = create_framework_options(automation: automation_type,
|
67
|
-
framework: framework.downcase
|
68
|
+
framework: framework.downcase,
|
69
|
+
ci_platform:)
|
68
70
|
|
69
|
-
# Print the chosen options
|
70
71
|
puts 'Chosen Options:'
|
71
72
|
puts " Automation Type: #{options[:automation]}"
|
72
73
|
puts " Framework: #{options[:framework]}"
|
74
|
+
puts " CI Platform: #{options[:ci_platform]}" if options[:ci_platform]
|
73
75
|
|
74
76
|
set_up_framework(options)
|
75
77
|
prompt.say("You have chosen to use #{framework} with #{automation_type}")
|
@@ -95,4 +97,13 @@ class MenuGenerator
|
|
95
97
|
menu.choice :Applitools, -> { choose_test_framework('applitools') }
|
96
98
|
menu.choice :Axe, -> { choose_test_framework('axe') }
|
97
99
|
end
|
100
|
+
|
101
|
+
def select_ci_platform(framework, automation)
|
102
|
+
prompt.select('Would you like to configure CI?') do |menu|
|
103
|
+
menu.choice :'Github Actions', -> { create_framework(framework, automation, 'github') }
|
104
|
+
menu.choice :'Gitlab CI/CD', -> { create_framework(framework, automation, 'gitlab') }
|
105
|
+
menu.choice :No, -> { create_framework(framework, automation) }
|
106
|
+
menu.choice :Quit, -> { exit }
|
107
|
+
end
|
108
|
+
end
|
98
109
|
end
|
data/lib/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.4
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../lib/generators/infrastructure/github_generator'
|
4
|
+
require_relative '../spec_helper'
|
5
|
+
|
6
|
+
describe GithubGenerator do
|
7
|
+
shared_examples 'selects github as an infrastructure option' do |name|
|
8
|
+
it 'creates a github infrastructure file' do
|
9
|
+
expect(File).to exist("#{name}/.github/workflows/test_pipeline.yml")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
shared_examples 'does not select any infrastructure option' do |name|
|
14
|
+
it 'does not create a github infrastructure file' do
|
15
|
+
expect(File).not_to exist("#{name}/.github/workflows/test_pipeline.yml")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'with rspec and selenium' do
|
20
|
+
include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
|
21
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with rspec and watir' do
|
25
|
+
include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
|
26
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with cucumber and selenium' do
|
30
|
+
include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[1]}"
|
31
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'with cucumber and watir' do
|
35
|
+
include_examples 'selects github as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[1]}"
|
36
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../lib/generators/infrastructure/gitlab_generator'
|
4
|
+
require_relative '../spec_helper'
|
5
|
+
|
6
|
+
describe GitlabGenerator do
|
7
|
+
shared_examples 'selects gitlab as an infrastructure option' do |name|
|
8
|
+
it 'creates a gitlab infrastructure file' do
|
9
|
+
expect(File).to exist("#{name}/gitlab-ci.yml")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
shared_examples 'does not select any infrastructure option' do |name|
|
14
|
+
it 'does not create a gitlab infrastructure file' do
|
15
|
+
expect(File).not_to exist("#{name}/gitlab-ci.yml")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context 'with rspec and selenium' do
|
20
|
+
include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[2]}"
|
21
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'with rspec and watir' do
|
25
|
+
include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[2]}"
|
26
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with cucumber and selenium' do
|
30
|
+
include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_#{CI_PLATFORMS[2]}"
|
31
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'with cucumber and watir' do
|
35
|
+
include_examples 'selects gitlab as an infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_#{CI_PLATFORMS[2]}"
|
36
|
+
include_examples 'does not select any infrastructure option', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
37
|
+
end
|
38
|
+
end
|
@@ -5,10 +5,12 @@ module SettingsHelper
|
|
5
5
|
def create_settings(options)
|
6
6
|
automation = options[:automation]
|
7
7
|
framework = options[:framework]
|
8
|
+
ci_platform = options[:ci_platform]
|
8
9
|
{
|
9
10
|
automation:,
|
10
11
|
framework:,
|
11
|
-
|
12
|
+
ci_platform:,
|
13
|
+
name: ci_platform ? "#{framework}_#{automation}_#{ci_platform}" : "#{framework}_#{automation}",
|
12
14
|
}
|
13
15
|
end
|
14
16
|
end
|
@@ -7,16 +7,20 @@ require_relative 'settings_helper'
|
|
7
7
|
|
8
8
|
AUTOMATION_TYPES = %w[android ios selenium watir cross_platform axe applitools].freeze
|
9
9
|
FRAMEWORKS = %w[cucumber rspec].freeze
|
10
|
+
CI_PLATFORMS = [nil, 'github', 'gitlab'].freeze
|
10
11
|
|
11
12
|
RSpec.configure do |config|
|
12
13
|
config.include(InvokeGenerators)
|
13
14
|
config.include(SettingsHelper)
|
15
|
+
|
14
16
|
# rubocop:disable RSpec/BeforeAfterAll
|
15
17
|
config.before(:all) do
|
16
18
|
FRAMEWORKS.each do |framework|
|
17
19
|
AUTOMATION_TYPES.each do |automation|
|
18
|
-
|
19
|
-
|
20
|
+
CI_PLATFORMS.each do |ci_platform|
|
21
|
+
settings = create_settings(framework:, automation:, ci_platform:)
|
22
|
+
generate_framework(settings)
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
@@ -24,10 +28,12 @@ RSpec.configure do |config|
|
|
24
28
|
config.after(:all) do
|
25
29
|
FRAMEWORKS.each do |framework|
|
26
30
|
AUTOMATION_TYPES.each do |automation|
|
27
|
-
|
28
|
-
|
31
|
+
CI_PLATFORMS.each do |ci_platform|
|
32
|
+
settings = create_settings(framework:, automation:, ci_platform:)
|
33
|
+
FileUtils.rm_rf(settings[:name])
|
34
|
+
end
|
29
35
|
end
|
30
36
|
end
|
31
37
|
end
|
38
|
+
# rubocop:enable RSpec/BeforeAfterAll
|
32
39
|
end
|
33
|
-
# rubocop:enable RSpec/BeforeAfterAll
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_raider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agustin Pequeno
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -154,8 +154,6 @@ files:
|
|
154
154
|
- lib/commands/plugin_commands.rb
|
155
155
|
- lib/commands/scaffolding_commands.rb
|
156
156
|
- lib/commands/utility_commands.rb
|
157
|
-
- lib/generators/actions/actions_generator.rb
|
158
|
-
- lib/generators/actions/templates/actions.tt
|
159
157
|
- lib/generators/automation/automation_generator.rb
|
160
158
|
- lib/generators/automation/templates/account.tt
|
161
159
|
- lib/generators/automation/templates/appium_caps.tt
|
@@ -196,6 +194,10 @@ files:
|
|
196
194
|
- lib/generators/cucumber/templates/world.tt
|
197
195
|
- lib/generators/generator.rb
|
198
196
|
- lib/generators/helper_generator.rb
|
197
|
+
- lib/generators/infrastructure/github_generator.rb
|
198
|
+
- lib/generators/infrastructure/gitlab_generator.rb
|
199
|
+
- lib/generators/infrastructure/templates/github.tt
|
200
|
+
- lib/generators/infrastructure/templates/gitlab.tt
|
199
201
|
- lib/generators/invoke_generators.rb
|
200
202
|
- lib/generators/menu_generator.rb
|
201
203
|
- lib/generators/rspec/rspec_generator.rb
|
@@ -239,10 +241,11 @@ files:
|
|
239
241
|
- ruby_raider.gemspec
|
240
242
|
- spec/integration/commands/scaffolding_commands_spec.rb
|
241
243
|
- spec/integration/commands/utility_commands_spec.rb
|
242
|
-
- spec/integration/generators/actions_generator_spec.rb
|
243
244
|
- spec/integration/generators/automation_generator_spec.rb
|
244
245
|
- spec/integration/generators/common_generator_spec.rb
|
245
246
|
- spec/integration/generators/cucumber_generator_spec.rb
|
247
|
+
- spec/integration/generators/github_generator_spec.rb
|
248
|
+
- spec/integration/generators/gitlab_generator_spec.rb
|
246
249
|
- spec/integration/generators/helpers_generator_spec.rb
|
247
250
|
- spec/integration/generators/rspec_generator_spec.rb
|
248
251
|
- spec/integration/settings_helper.rb
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../../../lib/generators/actions/actions_generator'
|
4
|
-
require_relative '../spec_helper'
|
5
|
-
|
6
|
-
describe ActionsGenerator do
|
7
|
-
shared_examples 'creates web automation framework' do |name|
|
8
|
-
it 'creates a github actions file' do
|
9
|
-
expect(File).to exist("#{name}/.github/workflows/test_pipeline.yml")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'with rspec and selenium' do
|
14
|
-
include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
15
|
-
end
|
16
|
-
|
17
|
-
context 'with rspec and watir' do
|
18
|
-
include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
19
|
-
end
|
20
|
-
|
21
|
-
context 'with cucumber and selenium' do
|
22
|
-
include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'with cucumber and watir' do
|
26
|
-
include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
27
|
-
end
|
28
|
-
end
|