ruby_raider 0.8.9 → 0.9.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/rspec_selenium.yml +42 -0
- data/.rubocop.yml +3 -0
- data/README.md +14 -0
- data/Rakefile +5 -5
- data/lib/generators/invoke_generators.rb +12 -4
- data/lib/generators/menu_generator.rb +1 -1
- data/lib/generators/templates/common/gemfile.tt +1 -1
- data/lib/generators/templates/common/read_me.tt +14 -0
- data/lib/ruby_raider.rb +9 -0
- data/lib/utilities/utilities.rb +3 -1
- data/lib/version +1 -1
- data/ruby_raider.gemspec +1 -1
- data/spec/spec_helper.rb +2 -2
- data/spec/support/settings_helper.rb +3 -3
- metadata +5 -5
- data/.github/workflows/system.yml +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbe1cdaadd5277a886b3e916c4de3f9982eb362252283f9403bbe2905df995b5
|
|
4
|
+
data.tar.gz: e16f7436c7c9f558c751f404428e9494e608da7e6deb8117f1b9a6692720a942
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a97554b9b58002bce11b76c44f42710238b8e53dd2879fb677cae9cc87356190e2395369d1c2ae431a27e5d1d372f17d8a8cc563965a6bc1fb354b71ead6979
|
|
7
|
+
data.tar.gz: cabae226fd5666bbc9a3f2e10aff32f5bd4faa7712a9aefce7e9e81d87c26a454500af69993c527e33886daa6e622eb08ce49b428322b00fbe0e4bf3a5b34f7d
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: BrowserStack Test
|
|
2
|
+
on: [ pull_request ]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
ubuntu-job:
|
|
6
|
+
name: BrowserStack Test on Ubuntu
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: BrowserStack Env Setup
|
|
10
|
+
uses: browserstack/github-actions/setup-env@master
|
|
11
|
+
with:
|
|
12
|
+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
|
|
13
|
+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
|
14
|
+
build-name: BUILD_INFO
|
|
15
|
+
project-name: REPO_NAME
|
|
16
|
+
- name: BrowserStackLocal Setup
|
|
17
|
+
uses: browserstack/github-actions/setup-local@master
|
|
18
|
+
with:
|
|
19
|
+
local-testing: start
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
- name: Checkout the repository
|
|
23
|
+
uses: actions/checkout@v2
|
|
24
|
+
|
|
25
|
+
- name: Set up Ruby
|
|
26
|
+
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
|
|
27
|
+
with:
|
|
28
|
+
ruby-version: head
|
|
29
|
+
|
|
30
|
+
- name: Install gems
|
|
31
|
+
run: bundle install
|
|
32
|
+
|
|
33
|
+
- name: Create Raider framework
|
|
34
|
+
run: bin/raider new rspec_selenium -p framework:rspec automation:selenium visual:false axe:true
|
|
35
|
+
|
|
36
|
+
- name: Run Raider tests
|
|
37
|
+
run: cd rspec_selenium && bundle install && raider utility browser_options chrome headless && rspec spec/
|
|
38
|
+
|
|
39
|
+
- name: BrowserStackLocal Stop
|
|
40
|
+
uses: browserstack/github-actions/setup-local@master
|
|
41
|
+
with:
|
|
42
|
+
local-testing: stop
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
|
@@ -82,6 +82,20 @@ selected.
|
|
|
82
82
|
|
|
83
83
|
Select the ones you will like to work with.
|
|
84
84
|
|
|
85
|
+
If you already know which frameworks you want to use, you can do:
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
raider new [name_of_project] -p framework:[framework] automation:[automation_type] visual:[boolean] axe:[boolean]
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
An example of the command above would be:
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
raider new test_project -p framework:rspec automation:selenium visual:false axe:true
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Where [frameworks] is a comma separated list of the frameworks you want to use.
|
|
98
|
+
|
|
85
99
|
### Ruby raider provides the following list of basic commands
|
|
86
100
|
|
|
87
101
|
###### Anything between square brackets([...]) is where your imput goes
|
data/Rakefile
CHANGED
|
@@ -4,11 +4,6 @@ require_relative 'lib/ruby_raider'
|
|
|
4
4
|
require_relative 'lib/commands/scaffolding_commands'
|
|
5
5
|
require_relative 'lib/utilities/logger'
|
|
6
6
|
|
|
7
|
-
desc 'Creates a new test project'
|
|
8
|
-
task :new, [:name] do |_t, args|
|
|
9
|
-
system "bin/raider -n #{args.name}"
|
|
10
|
-
end
|
|
11
|
-
|
|
12
7
|
desc 'Creates a page'
|
|
13
8
|
task :page, [:name, :path] do |_t, args|
|
|
14
9
|
ScaffoldingCommands.new.invoke(:page, nil, %W[:#{args.name} --path #{args.path}])
|
|
@@ -47,3 +42,8 @@ desc 'Runs system tests'
|
|
|
47
42
|
task :system do |_t|
|
|
48
43
|
system 'rspec spec/system'
|
|
49
44
|
end
|
|
45
|
+
|
|
46
|
+
desc 'Create framework with parameters'
|
|
47
|
+
task :new, [:name, :params] do |_t, args|
|
|
48
|
+
system "bin/raider -n #{args.name} -p #{args.params}"
|
|
49
|
+
end
|
|
@@ -8,6 +8,8 @@ require_relative 'rspec/rspec_generator'
|
|
|
8
8
|
# :reek:FeatureEnvy { enabled: false }
|
|
9
9
|
# :reek:UtilityFunction { enabled: false }
|
|
10
10
|
module InvokeGenerators
|
|
11
|
+
module_function
|
|
12
|
+
|
|
11
13
|
def generate_framework(structure = {})
|
|
12
14
|
generators = %w[Automation Actions Common Helpers]
|
|
13
15
|
framework = structure[:framework]
|
|
@@ -15,11 +17,11 @@ module InvokeGenerators
|
|
|
15
17
|
generators.each do |generator|
|
|
16
18
|
invoke_generator({
|
|
17
19
|
automation: structure[:automation],
|
|
18
|
-
framework
|
|
19
|
-
generator
|
|
20
|
+
framework:,
|
|
21
|
+
generator:,
|
|
20
22
|
name: structure[:name],
|
|
21
|
-
visual: structure[:visual],
|
|
22
|
-
axe_support: structure[:axe_support]
|
|
23
|
+
visual: to_bool(structure[:visual]),
|
|
24
|
+
axe_support: to_bool(structure[:axe_support])
|
|
23
25
|
})
|
|
24
26
|
end
|
|
25
27
|
end
|
|
@@ -36,4 +38,10 @@ module InvokeGenerators
|
|
|
36
38
|
structure[:visual],
|
|
37
39
|
structure[:axe_support]]).invoke_all
|
|
38
40
|
end
|
|
41
|
+
|
|
42
|
+
def to_bool(string)
|
|
43
|
+
return unless string.is_a? String
|
|
44
|
+
|
|
45
|
+
string.downcase == 'true'
|
|
46
|
+
end
|
|
39
47
|
end
|
|
@@ -85,7 +85,7 @@ class MenuGenerator
|
|
|
85
85
|
axe = choose_axe_support if automation_type == 'selenium' && framework == 'Rspec' && visual_automation == false
|
|
86
86
|
options = create_framework_options(automation: automation_type,
|
|
87
87
|
framework: framework.downcase,
|
|
88
|
-
visual_automation
|
|
88
|
+
visual_automation:,
|
|
89
89
|
axe_support: axe)
|
|
90
90
|
|
|
91
91
|
# Print the chosen options
|
|
@@ -29,7 +29,7 @@ gem 'rubocop'
|
|
|
29
29
|
<% if framework == 'rspec' -%>
|
|
30
30
|
gem 'rubocop-rspec'
|
|
31
31
|
<% end -%>
|
|
32
|
-
gem 'ruby_raider', '~> 0.
|
|
32
|
+
gem 'ruby_raider', '~> 0.9.0'
|
|
33
33
|
<%= ERB.new(File.read(File.expand_path('./partials/automation_gems.tt', __dir__))).result(binding).strip! %>
|
|
34
34
|
<% if automation == 'sparkling_ios' -%>
|
|
35
35
|
gem 'sparkling_watir'
|
|
@@ -76,6 +76,20 @@ selected.
|
|
|
76
76
|
|
|
77
77
|
Select the ones you will like to work with.
|
|
78
78
|
|
|
79
|
+
If you already know which frameworks you want to use, you can do:
|
|
80
|
+
|
|
81
|
+
```ruby
|
|
82
|
+
raider new [name_of_project] -p framework:[framework] automation:[automation_type] visual:[boolean] axe:[boolean]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
An example of the command above would be:
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
raider new test_project -p framework:rspec automation:selenium visual:false axe:true
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Where [frameworks] is a comma separated list of the frameworks you want to use.
|
|
92
|
+
|
|
79
93
|
### Ruby raider provides the following list of basic commands
|
|
80
94
|
|
|
81
95
|
###### Anything between square brackets([...]) is where your imput goes
|
data/lib/ruby_raider.rb
CHANGED
|
@@ -8,8 +8,17 @@ require_relative '../lib/commands/utility_commands'
|
|
|
8
8
|
module RubyRaider
|
|
9
9
|
class Raider < Thor
|
|
10
10
|
desc 'new [PROJECT_NAME]', 'Creates a new framework based on settings picked'
|
|
11
|
+
option :parameters,
|
|
12
|
+
type: :hash, required: false, desc: 'Parameters to avoid using the menu', aliases: '-p'
|
|
11
13
|
|
|
12
14
|
def new(project_name)
|
|
15
|
+
params = options[:parameters]
|
|
16
|
+
if params
|
|
17
|
+
params[:name] = project_name
|
|
18
|
+
parsed_hash = params.transform_keys(&:to_sym)
|
|
19
|
+
return InvokeGenerators.generate_framework(parsed_hash)
|
|
20
|
+
end
|
|
21
|
+
|
|
13
22
|
MenuGenerator.new(project_name).generate_choice_menu
|
|
14
23
|
end
|
|
15
24
|
|
data/lib/utilities/utilities.rb
CHANGED
|
@@ -42,7 +42,9 @@ module Utilities
|
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
def browser_options=(*opts)
|
|
45
|
-
|
|
45
|
+
args = opts.flatten
|
|
46
|
+
browser_args = config['browser_arguments']
|
|
47
|
+
browser_args[args.first&.to_sym] = browser_args + args[1..]
|
|
46
48
|
overwrite_yaml
|
|
47
49
|
end
|
|
48
50
|
|
data/lib/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.9.0
|
data/ruby_raider.gemspec
CHANGED
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
|
|
|
9
9
|
s.email = 'agustin.pe94@gmail.com'
|
|
10
10
|
s.homepage = 'https://github.com/RubyRaider/ruby_raider'
|
|
11
11
|
s.license = 'MIT'
|
|
12
|
-
s.required_ruby_version = '>= 3.
|
|
12
|
+
s.required_ruby_version = '>= 3.1.0'
|
|
13
13
|
s.files = `git ls-files -z`.split("\x0")
|
|
14
14
|
s.bindir = 'bin'
|
|
15
15
|
s.executables << 'raider'
|
data/spec/spec_helper.rb
CHANGED
|
@@ -15,7 +15,7 @@ RSpec.configure do |config|
|
|
|
15
15
|
FRAMEWORKS.each do |framework|
|
|
16
16
|
AUTOMATION_TYPES.each do |automation|
|
|
17
17
|
[true, false].each do |visual|
|
|
18
|
-
settings = create_settings(framework
|
|
18
|
+
settings = create_settings(framework:, automation:, visual:)
|
|
19
19
|
generate_framework(settings)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -26,7 +26,7 @@ RSpec.configure do |config|
|
|
|
26
26
|
FRAMEWORKS.each do |framework|
|
|
27
27
|
AUTOMATION_TYPES.each do |automation|
|
|
28
28
|
[true, false].each do |visual|
|
|
29
|
-
settings = create_settings(framework
|
|
29
|
+
settings = create_settings(framework:, automation:, visual:)
|
|
30
30
|
FileUtils.rm_rf(settings[:name])
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -7,10 +7,10 @@ module SettingsHelper
|
|
|
7
7
|
visual = options[:visual]
|
|
8
8
|
framework = options[:framework]
|
|
9
9
|
{
|
|
10
|
-
automation
|
|
11
|
-
framework
|
|
10
|
+
automation:,
|
|
11
|
+
framework:,
|
|
12
12
|
name: "#{framework}_#{automation}#{'_visual' if visual}",
|
|
13
|
-
visual:
|
|
13
|
+
visual:
|
|
14
14
|
}
|
|
15
15
|
end
|
|
16
16
|
end
|
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: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Agustin Pequeno
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-06-
|
|
11
|
+
date: 2024-06-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|
|
@@ -150,8 +150,8 @@ files:
|
|
|
150
150
|
- ".github/workflows/integration.yml"
|
|
151
151
|
- ".github/workflows/push_gem.yml"
|
|
152
152
|
- ".github/workflows/reek.yml"
|
|
153
|
+
- ".github/workflows/rspec_selenium.yml"
|
|
153
154
|
- ".github/workflows/rubocop.yml"
|
|
154
|
-
- ".github/workflows/system.yml"
|
|
155
155
|
- ".gitignore"
|
|
156
156
|
- ".reek.yml"
|
|
157
157
|
- ".rubocop.yml"
|
|
@@ -268,14 +268,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
268
268
|
requirements:
|
|
269
269
|
- - ">="
|
|
270
270
|
- !ruby/object:Gem::Version
|
|
271
|
-
version: 3.
|
|
271
|
+
version: 3.1.0
|
|
272
272
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
requirements:
|
|
274
274
|
- - ">="
|
|
275
275
|
- !ruby/object:Gem::Version
|
|
276
276
|
version: '0'
|
|
277
277
|
requirements: []
|
|
278
|
-
rubygems_version: 3.5.
|
|
278
|
+
rubygems_version: 3.5.0.dev
|
|
279
279
|
signing_key:
|
|
280
280
|
specification_version: 4
|
|
281
281
|
summary: A gem to make setup and start of UI automation projects easier
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
env:
|
|
2
|
-
NAME: 'CI'
|
|
3
|
-
|
|
4
|
-
name: System tests
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
name: System pipeline
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Set up Ruby
|
|
18
|
-
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
|
|
19
|
-
with:
|
|
20
|
-
ruby-version: head
|
|
21
|
-
|
|
22
|
-
- name: Checkout repository
|
|
23
|
-
uses: actions/checkout@v3
|
|
24
|
-
|
|
25
|
-
- name: Install gems
|
|
26
|
-
run: bundle install
|
|
27
|
-
|
|
28
|
-
- name: Build and run system tests
|
|
29
|
-
run: rake system
|