ruby_raider 0.8.5 → 0.8.7
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 +25 -0
- data/.github/workflows/{rspec.yml → system.yml} +9 -7
- data/.reek.yml +3 -0
- data/.rubocop.yml +5 -1
- data/README.md +15 -4
- data/Rakefile +19 -0
- data/lib/commands/open_ai_commands.rb +0 -24
- data/lib/commands/scaffolding_commands.rb +34 -36
- data/lib/generators/automation/templates/partials/initialize_selector.tt +7 -0
- data/lib/generators/automation/templates/partials/selenium_login.tt +1 -0
- data/lib/generators/generator.rb +6 -1
- data/lib/generators/invoke_generators.rb +4 -2
- data/lib/generators/menu_generator.rb +21 -6
- data/lib/generators/rspec/rspec_generator.rb +6 -0
- data/lib/generators/rspec/templates/spec.tt +29 -0
- data/lib/generators/templates/common/gemfile.tt +4 -0
- data/lib/generators/templates/common/rakefile.tt +4 -8
- data/lib/generators/templates/common/read_me.tt +24 -11
- data/lib/generators/templates/helpers/driver_helper.tt +8 -1
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +8 -2
- data/lib/generators/templates/helpers/spec_helper.tt +3 -0
- data/lib/open_ai/open_ai.rb +2 -2
- data/lib/ruby_raider.rb +3 -4
- data/lib/scaffolding/scaffolding.rb +14 -6
- data/lib/scaffolding/templates/feature.tt +1 -1
- data/lib/scaffolding/templates/page_object.tt +2 -2
- data/lib/scaffolding/templates/spec.tt +2 -3
- data/lib/scaffolding/templates/steps.tt +12 -0
- data/lib/version +1 -0
- data/ruby_raider.gemspec +1 -1
- data/spec/{open_ai_commands_spec.rb → integration/commands/open_ai_commands_spec.rb} +4 -4
- data/spec/{scaffolding_commands_spec.rb → integration/commands/scaffolding_commands_spec.rb} +18 -8
- data/spec/{utility_commands_spec.rb → integration/commands/utility_commands_spec.rb} +4 -4
- data/spec/{actions_generator_spec.rb → integration/generators/actions_generator_spec.rb} +2 -2
- data/spec/{automation_generator_spec.rb → integration/generators/automation_generator_spec.rb} +2 -2
- data/spec/{common_generator_spec.rb → integration/generators/common_generator_spec.rb} +2 -2
- data/spec/{cucumber_generator_spec.rb → integration/generators/cucumber_generator_spec.rb} +2 -2
- data/spec/{helpers_generator_spec.rb → integration/generators/helpers_generator_spec.rb} +2 -2
- data/spec/{rspec_generator_spec.rb → integration/generators/rspec_generator_spec.rb} +2 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/{ruby_raider_spec.rb → system/ruby_raider_spec.rb} +6 -6
- metadata +17 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8de2c66fd076efbcd366c5a4aa6aee74d2aa0fb511ec3f1887e669d44aae0d6
|
|
4
|
+
data.tar.gz: 2f28902ccb937b3c590eebb404f69fb42cb303bcc187ff1020ea931951734556
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4e7fdf2921ed2f7e16ff1593b1879098c7c87584a194f5a0d132f30ac3f3a032d1377fd208f1ee3d876531902cb945909161db6bb10074b675efc3adc5ae7e5
|
|
7
|
+
data.tar.gz: 6cacf73aa4cec432e6ab9591f04f9616661c7922f17ca0a8c83f79278191f0320851bc436df56c93afc330969f5e9ce51c147ecacb36946951685cc207264739
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Integration tests
|
|
2
|
+
|
|
3
|
+
on: [pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
name: Integration pipeline
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
steps:
|
|
11
|
+
- name: Set up Ruby
|
|
12
|
+
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
|
|
13
|
+
with:
|
|
14
|
+
ruby-version: head
|
|
15
|
+
|
|
16
|
+
- name: Checkout repository
|
|
17
|
+
uses: actions/checkout@v3
|
|
18
|
+
|
|
19
|
+
- name: Install gems
|
|
20
|
+
run: bundle install
|
|
21
|
+
|
|
22
|
+
- name: Build and run integration tests
|
|
23
|
+
env:
|
|
24
|
+
OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }}
|
|
25
|
+
run: rake integration
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
env:
|
|
2
|
+
NAME: 'CI'
|
|
3
|
+
|
|
4
|
+
name: System tests
|
|
2
5
|
|
|
3
6
|
on:
|
|
4
7
|
push:
|
|
5
|
-
branches:
|
|
6
|
-
|
|
7
|
-
branches: [ "*" ]
|
|
8
|
+
branches:
|
|
9
|
+
- master
|
|
8
10
|
|
|
9
11
|
jobs:
|
|
10
12
|
build:
|
|
11
|
-
name:
|
|
13
|
+
name: System pipeline
|
|
12
14
|
runs-on: ubuntu-latest
|
|
13
15
|
|
|
14
16
|
steps:
|
|
@@ -23,7 +25,7 @@ jobs:
|
|
|
23
25
|
- name: Install gems
|
|
24
26
|
run: bundle install
|
|
25
27
|
|
|
26
|
-
- name: Build and
|
|
28
|
+
- name: Build and run system tests
|
|
27
29
|
env:
|
|
28
30
|
OPENAI_ACCESS_TOKEN: ${{ secrets.OPENAI_ACCESS_TOKEN }}
|
|
29
|
-
run:
|
|
31
|
+
run: rake system
|
data/.reek.yml
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
require:
|
|
2
2
|
- rubocop-rspec
|
|
3
3
|
|
|
4
|
+
AllCops:
|
|
5
|
+
Exclude:
|
|
6
|
+
- 'lib/commands/open_ai_commands.rb'
|
|
7
|
+
|
|
4
8
|
# Layout
|
|
5
9
|
Layout/CaseIndentation:
|
|
6
10
|
Enabled: false
|
|
@@ -87,4 +91,4 @@ Style/SafeNavigation:
|
|
|
87
91
|
|
|
88
92
|
Style/SingleLineBlockParams:
|
|
89
93
|
Description: 'Enforces the names of some block params.'
|
|
90
|
-
Enabled: false
|
|
94
|
+
Enabled: false
|
data/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
# Ruby Raider
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/ruby_raider)
|
|
4
|
-
[](https://github.com/RubyRaider/ruby_raider/actions/workflows/integration.yml)
|
|
5
|
+
[](https://github.com/RubyRaider/ruby_raider/actions/workflows/reek.yml)
|
|
6
|
+
[](https://github.com/RubyRaider/ruby_raider/actions/workflows/rubocop.yml)
|
|
5
7
|
[](https://gitter.im/RubyRaider/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
6
8
|
|
|
7
9
|
<!-- PROJECT LOGO -->
|
|
@@ -86,11 +88,12 @@ Select the ones you will like to work with.
|
|
|
86
88
|
|
|
87
89
|
```ruby
|
|
88
90
|
Commands:
|
|
89
|
-
raider generate # Provides access to all the
|
|
91
|
+
raider generate # Provides access to all the scaffolding commands
|
|
90
92
|
raider help [COMMAND] # Describe available commands or one specific command
|
|
91
93
|
raider new [PROJECT_NAME] # Creates a new framework based on settings picked
|
|
92
94
|
raider open_ai # Provides access to all the open ai commands
|
|
93
|
-
raider utility # Provides access to all the utility commands
|
|
95
|
+
raider utility # Provides access to all the utility commands
|
|
96
|
+
raider version # It shows the version of Ruby Raider you are currently using
|
|
94
97
|
```
|
|
95
98
|
|
|
96
99
|
All the basic commands have their corresponding shortcut:
|
|
@@ -101,11 +104,14 @@ All the basic commands have their corresponding shortcut:
|
|
|
101
104
|
* u for utility
|
|
102
105
|
* v for version
|
|
103
106
|
|
|
104
|
-
|
|
107
|
+
### Scaffolding Commands
|
|
108
|
+
Ruby Raider also supports scaffolding:
|
|
105
109
|
|
|
106
110
|
* To create a new page object you do: ```raider g page [PAGE_NAME]```
|
|
107
111
|
* To create a new spec you do: ```raider g spec [SPEC_NAME]```
|
|
108
112
|
* To create a new feature you do: ```raider g feature [FEATURE_NAME]```
|
|
113
|
+
* To create a new steps definition you do: ```raider g steps [STEPS_NAME]```
|
|
114
|
+
* To create both a page/spec or a page/feature/steps you do: ```raider g scaffold [SCAFFOLD_NAME]```
|
|
109
115
|
|
|
110
116
|
It's possible to add the option --path or -p if you want to specify where to create your features, pages, helpers and
|
|
111
117
|
specs.
|
|
@@ -120,6 +126,7 @@ raider u path [PATH_NAME] - -helper or -h
|
|
|
120
126
|
|
|
121
127
|
If you don't specify an option, path will assume you want to change the default path for pages.
|
|
122
128
|
|
|
129
|
+
|
|
123
130
|
### Appium Server Command
|
|
124
131
|
To initialise Appium server run this command:
|
|
125
132
|
```ruby
|
|
@@ -146,3 +153,7 @@ Options :
|
|
|
146
153
|
-i, [--input = INPUT] # It uses a file as input to create the steps
|
|
147
154
|
|
|
148
155
|
```
|
|
156
|
+
|
|
157
|
+
### Sponsors
|
|
158
|
+
|
|
159
|
+
This project is tested with BrowserStack.
|
data/Rakefile
CHANGED
|
@@ -33,3 +33,22 @@ desc 'Logs a warning'
|
|
|
33
33
|
task :log, [:message] do |_t, args|
|
|
34
34
|
RubyRaider::Logger.warn(args.message)
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
desc 'Runs integration tests'
|
|
38
|
+
task :integration, [:type, :name] do |_t, args|
|
|
39
|
+
path = args.type ? "spec/integration/#{args.type}" : 'spec/integration'
|
|
40
|
+
full_path = if args.type == 'generators' && args.name
|
|
41
|
+
"#{path}/#{args.name.downcase}_generator_spec.rb"
|
|
42
|
+
elsif args.type == 'commands' && args.name
|
|
43
|
+
"#{path}/#{args.name.downcase}_commands_spec.rb"
|
|
44
|
+
else
|
|
45
|
+
path
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
system "rspec #{full_path}"
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
desc 'Runs system tests'
|
|
52
|
+
task :system do |_t|
|
|
53
|
+
system 'rspec spec/system'
|
|
54
|
+
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
require 'thor'
|
|
2
|
-
require 'faraday'
|
|
3
2
|
require_relative '../open_ai/open_ai'
|
|
4
3
|
|
|
5
4
|
class OpenAiCommands < Thor
|
|
@@ -59,27 +58,4 @@ class OpenAiCommands < Thor
|
|
|
59
58
|
make(options[:open_ai], "#{path}/#{name}_steps.rb")
|
|
60
59
|
end
|
|
61
60
|
end
|
|
62
|
-
|
|
63
|
-
desc 'test', 'Uses open AI to create a file or generate output'
|
|
64
|
-
def test
|
|
65
|
-
conn = Faraday.new(url: 'https://api.openai.com') do |faraday|
|
|
66
|
-
faraday.headers['Content-Type'] = 'application/json'
|
|
67
|
-
faraday.headers['Authorization'] = "Bearer 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"
|
|
68
|
-
faraday.headers['OpenAI-Beta'] = 'assistants=v1'
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# Data payload for the POST request
|
|
72
|
-
payload = {
|
|
73
|
-
instructions: "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
|
|
74
|
-
name: "Math Tutor",
|
|
75
|
-
tools: [{ type: "code_interpreter" }],
|
|
76
|
-
model: "gpt-4-1106-preview"
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
# Perform the POST request
|
|
80
|
-
response = conn.post('/v1/assistants', payload.to_json)
|
|
81
|
-
|
|
82
|
-
# Output the response body
|
|
83
|
-
puts response.body
|
|
84
|
-
end
|
|
85
61
|
end
|
|
@@ -7,6 +7,7 @@ require_relative '../commands/utility_commands'
|
|
|
7
7
|
|
|
8
8
|
# :reek:FeatureEnvy { enabled: false }
|
|
9
9
|
# :reek:UtilityFunction { enabled: false }
|
|
10
|
+
# :reek:RepeatedConditional { enabled: false }
|
|
10
11
|
class ScaffoldingCommands < Thor
|
|
11
12
|
desc 'page [PAGE_NAME]', 'Creates a new page object'
|
|
12
13
|
option :path,
|
|
@@ -15,7 +16,9 @@ class ScaffoldingCommands < Thor
|
|
|
15
16
|
type: :boolean, required: false, desc: 'This will delete the selected page', aliases: '-d'
|
|
16
17
|
|
|
17
18
|
def page(name)
|
|
18
|
-
|
|
19
|
+
return delete_scaffolding(name, 'page') if options[:delete]
|
|
20
|
+
|
|
21
|
+
generate_scaffolding(name, 'page', options[:path])
|
|
19
22
|
end
|
|
20
23
|
|
|
21
24
|
desc 'feature [NAME]', 'Creates a new feature'
|
|
@@ -27,7 +30,9 @@ class ScaffoldingCommands < Thor
|
|
|
27
30
|
required: false, desc: 'This will delete the selected feature', aliases: '-d'
|
|
28
31
|
|
|
29
32
|
def feature(name)
|
|
30
|
-
|
|
33
|
+
return delete_scaffolding(name, 'feature') if options[:delete]
|
|
34
|
+
|
|
35
|
+
generate_scaffolding(name, 'feature', options[:path])
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
desc 'spec [SPEC_NAME]', 'Creates a new spec'
|
|
@@ -37,7 +42,9 @@ class ScaffoldingCommands < Thor
|
|
|
37
42
|
type: :boolean, required: false, desc: 'This will delete the selected spec', aliases: '-d'
|
|
38
43
|
|
|
39
44
|
def spec(name)
|
|
40
|
-
|
|
45
|
+
return delete_scaffolding(name, 'spec') if options[:delete]
|
|
46
|
+
|
|
47
|
+
generate_scaffolding(name, 'spec', options[:path])
|
|
41
48
|
end
|
|
42
49
|
|
|
43
50
|
desc 'helper [HELPER_NAME]', 'Creates a new helper'
|
|
@@ -47,7 +54,21 @@ class ScaffoldingCommands < Thor
|
|
|
47
54
|
type: :boolean, required: false, desc: 'This will delete the selected helper', aliases: '-d'
|
|
48
55
|
|
|
49
56
|
def helper(name)
|
|
50
|
-
|
|
57
|
+
return delete_scaffolding(name, 'helper') if options[:delete]
|
|
58
|
+
|
|
59
|
+
generate_scaffolding(name, 'helper', options[:path])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
desc 'steps [STEPS_NAME]', 'Creates a new steps definition'
|
|
63
|
+
option :path,
|
|
64
|
+
type: :string, required: false, desc: 'The path where your steps will be created', aliases: '-p'
|
|
65
|
+
option :delete,
|
|
66
|
+
type: :boolean, required: false, desc: 'This will delete the selected steps', aliases: '-d'
|
|
67
|
+
|
|
68
|
+
def steps(name)
|
|
69
|
+
return delete_scaffolding(name, 'steps') if options[:delete]
|
|
70
|
+
|
|
71
|
+
generate_scaffolding(name, 'steps', options[:path])
|
|
51
72
|
end
|
|
52
73
|
|
|
53
74
|
desc 'scaffold [SCAFFOLD_NAME]', 'It generates everything needed to start automating'
|
|
@@ -57,46 +78,23 @@ class ScaffoldingCommands < Thor
|
|
|
57
78
|
Scaffolding.new([name, load_config_path('spec')]).generate_spec
|
|
58
79
|
else
|
|
59
80
|
Scaffolding.new([name, load_config_path('feature')]).generate_feature
|
|
81
|
+
Scaffolding.new([name, load_config_path('steps')]).generate_steps
|
|
60
82
|
end
|
|
61
|
-
Scaffolding.new([name, load_config_path('page')]).
|
|
83
|
+
Scaffolding.new([name, load_config_path('page')]).generate_page
|
|
62
84
|
end
|
|
63
85
|
|
|
64
|
-
desc 'config', 'Creates configuration file'
|
|
65
|
-
option :delete,
|
|
66
|
-
type: :boolean, required: false, desc: 'This will delete the config file', aliases: '-d'
|
|
67
|
-
|
|
68
86
|
no_commands do
|
|
69
87
|
def load_config_path(type)
|
|
70
88
|
YAML.load_file('config/config.yml')["#{type}_path"] if Pathname.new('config/config.yml').exist?
|
|
71
89
|
end
|
|
72
90
|
|
|
73
|
-
def
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
scaffolding.delete_class
|
|
81
|
-
when 'feature'
|
|
82
|
-
scaffolding.delete_feature
|
|
83
|
-
when 'spec'
|
|
84
|
-
scaffolding.delete_spec
|
|
85
|
-
when 'helper'
|
|
86
|
-
scaffolding.delete_helper
|
|
87
|
-
end
|
|
88
|
-
else
|
|
89
|
-
case type
|
|
90
|
-
when 'page'
|
|
91
|
-
scaffolding.generate_class
|
|
92
|
-
when 'feature'
|
|
93
|
-
scaffolding.generate_feature
|
|
94
|
-
when 'spec'
|
|
95
|
-
scaffolding.generate_spec
|
|
96
|
-
when 'helper'
|
|
97
|
-
scaffolding.generate_helper
|
|
98
|
-
end
|
|
99
|
-
end
|
|
91
|
+
def delete_scaffolding(name, type)
|
|
92
|
+
Scaffolding.new([name]).send("delete_#{type}")
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def generate_scaffolding(name, type, path)
|
|
96
|
+
path ||= load_config_path(type)
|
|
97
|
+
Scaffolding.new([name, path]).send("generate_#{type}")
|
|
100
98
|
end
|
|
101
99
|
end
|
|
102
100
|
end
|
data/lib/generators/generator.rb
CHANGED
|
@@ -9,6 +9,7 @@ class Generator < Thor::Group
|
|
|
9
9
|
argument :framework
|
|
10
10
|
argument :name
|
|
11
11
|
argument :visual_automation, optional: true
|
|
12
|
+
argument :axe_support, optional: true
|
|
12
13
|
|
|
13
14
|
def self.source_paths
|
|
14
15
|
base_path = File.dirname(__FILE__)
|
|
@@ -46,7 +47,7 @@ class Generator < Thor::Group
|
|
|
46
47
|
end
|
|
47
48
|
|
|
48
49
|
def visual?
|
|
49
|
-
|
|
50
|
+
args[3]
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
def watir?
|
|
@@ -57,6 +58,10 @@ class Generator < Thor::Group
|
|
|
57
58
|
(args & (%w[selenium watir])).count.positive?
|
|
58
59
|
end
|
|
59
60
|
|
|
61
|
+
def axe?
|
|
62
|
+
args.last
|
|
63
|
+
end
|
|
64
|
+
|
|
60
65
|
private
|
|
61
66
|
|
|
62
67
|
def _initializer
|
|
@@ -18,7 +18,8 @@ module InvokeGenerators
|
|
|
18
18
|
framework: framework,
|
|
19
19
|
generator: generator,
|
|
20
20
|
name: structure[:name],
|
|
21
|
-
visual: structure[:visual]
|
|
21
|
+
visual: structure[:visual],
|
|
22
|
+
axe_support: structure[:axe_support]
|
|
22
23
|
})
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -32,6 +33,7 @@ module InvokeGenerators
|
|
|
32
33
|
.new([structure[:automation],
|
|
33
34
|
structure[:framework],
|
|
34
35
|
structure[:name],
|
|
35
|
-
structure[:visual]
|
|
36
|
+
structure[:visual],
|
|
37
|
+
structure[:axe_support]]).invoke_all
|
|
36
38
|
end
|
|
37
39
|
end
|
|
@@ -22,7 +22,11 @@ class MenuGenerator
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def choose_visual_automation
|
|
25
|
-
prompt.select('Do you want to add visual automation with
|
|
25
|
+
prompt.select('Do you want to add visual automation with Applitools?', yes_no_menu_choices)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def choose_axe_support
|
|
29
|
+
prompt.select('Do you want to add Axe accessibility testing tool?', yes_no_menu_choices)
|
|
26
30
|
end
|
|
27
31
|
|
|
28
32
|
def choose_test_framework(automation)
|
|
@@ -37,7 +41,8 @@ class MenuGenerator
|
|
|
37
41
|
automation: options[:automation],
|
|
38
42
|
framework: options[:framework],
|
|
39
43
|
name: @name,
|
|
40
|
-
visual: options[:visual_automation]
|
|
44
|
+
visual: options[:visual_automation],
|
|
45
|
+
axe_support: options[:axe_support]
|
|
41
46
|
}
|
|
42
47
|
generate_framework(structure)
|
|
43
48
|
system "cd #{name} && gem install bundler && bundle install"
|
|
@@ -69,22 +74,32 @@ class MenuGenerator
|
|
|
69
74
|
end
|
|
70
75
|
end
|
|
71
76
|
|
|
72
|
-
FrameworkOptions = Struct.new(:automation, :framework, :visual_automation)
|
|
77
|
+
FrameworkOptions = Struct.new(:automation, :framework, :visual_automation, :axe_support)
|
|
73
78
|
|
|
74
79
|
def create_framework_options(params)
|
|
75
|
-
FrameworkOptions.new(params[:automation], params[:framework], params[:visual_automation])
|
|
80
|
+
FrameworkOptions.new(params[:automation], params[:framework], params[:visual_automation], params[:axe_support])
|
|
76
81
|
end
|
|
77
82
|
|
|
78
83
|
def create_framework(framework, automation_type)
|
|
79
84
|
visual_automation = choose_visual_automation if %w[selenium].include?(automation_type)
|
|
85
|
+
axe = choose_axe_support if automation_type == 'selenium' && framework == 'Rspec' && visual_automation == false
|
|
80
86
|
options = create_framework_options(automation: automation_type,
|
|
81
87
|
framework: framework.downcase,
|
|
82
|
-
visual_automation: visual_automation
|
|
88
|
+
visual_automation: visual_automation,
|
|
89
|
+
axe_support: axe)
|
|
90
|
+
|
|
91
|
+
# Print the chosen options
|
|
92
|
+
puts 'Chosen Options:'
|
|
93
|
+
puts " Automation Type: #{options[:automation]}"
|
|
94
|
+
puts " Framework: #{options[:framework]}"
|
|
95
|
+
puts " Visual Automation: #{options[:visual_automation]}"
|
|
96
|
+
puts " Axe Support: #{options[:axe_support]}"
|
|
97
|
+
|
|
83
98
|
set_up_framework(options)
|
|
84
99
|
prompt.say("You have chosen to use #{framework} with #{automation_type}")
|
|
85
100
|
end
|
|
86
101
|
|
|
87
|
-
def
|
|
102
|
+
def yes_no_menu_choices
|
|
88
103
|
{
|
|
89
104
|
Yes: -> { true },
|
|
90
105
|
No: -> { false },
|
|
@@ -6,6 +6,34 @@ require_relative '../models/model_factory'
|
|
|
6
6
|
require_relative '../page_objects/pages/account'
|
|
7
7
|
require_relative '../page_objects/pages/login'
|
|
8
8
|
|
|
9
|
+
<%- if axe? %>
|
|
10
|
+
describe 'Login' do
|
|
11
|
+
let(:login) { Login.new(driver) }
|
|
12
|
+
let(:account) { Account.new(driver) }
|
|
13
|
+
let(:user) { ModelFactory.for('users')['registered user'] }
|
|
14
|
+
|
|
15
|
+
before do
|
|
16
|
+
login.visit
|
|
17
|
+
login.log_as(user['username'], user['password'])
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context 'with a login user on the account page' do
|
|
21
|
+
it 'no accessibility errors are present on the page' do
|
|
22
|
+
expect(account.page).to be_axe_clean
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'no accessibility errors are present on the transaction history' do
|
|
26
|
+
transaction_history = '.dash-tile.dash-tile-balloon.clearfix'
|
|
27
|
+
expect(account.page).to be_axe_clean.within transaction_history
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it 'no accessibility errors are present on the heading' do
|
|
31
|
+
heading = '.maintext'
|
|
32
|
+
expect(account.page).to be_axe_clean.within heading
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
<%- elsif %w[selenium watir].include? automation -%>
|
|
9
37
|
describe 'Login' do
|
|
10
38
|
subject(:header) { account_page.header.customer_name }
|
|
11
39
|
|
|
@@ -42,6 +70,7 @@ describe 'Login' do
|
|
|
42
70
|
end
|
|
43
71
|
end
|
|
44
72
|
end
|
|
73
|
+
<%- end -%>
|
|
45
74
|
<%- elsif automation == 'sparkling_ios' -%>
|
|
46
75
|
require_relative '../helpers/spec_helper'
|
|
47
76
|
require_relative '../page_objects/pages/home'
|
|
@@ -7,6 +7,10 @@ gem 'allure-cucumber'
|
|
|
7
7
|
gem 'allure-rspec'
|
|
8
8
|
gem 'allure-ruby-commons'
|
|
9
9
|
<% end -%>
|
|
10
|
+
<% if axe? -%>
|
|
11
|
+
gem 'axe-core-rspec'
|
|
12
|
+
gem 'axe-core-selenium'
|
|
13
|
+
<% end -%>
|
|
10
14
|
<% if visual_automation -%>
|
|
11
15
|
gem 'eyes_selenium', '~> 4.6', '>= 4.6.1'
|
|
12
16
|
gem 'eyes_universal', '~> 3.3', '>= 3.3.1'
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
config = YAML.load_file('config/config.yml')
|
|
6
|
-
config['browser'] = args.browser
|
|
7
|
-
File.write('config/config.yml', config.to_yaml)
|
|
8
|
-
end
|
|
1
|
+
desc 'Print Ruby Raider version'
|
|
2
|
+
task :raider do
|
|
3
|
+
system 'raider version'
|
|
4
|
+
end
|
|
@@ -45,8 +45,11 @@ Ruby Raider is a generator and scaffolding gem to make UI test automation easier
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
|
|
48
|
-
***Remember to use the full path of the app that you download in the capabilities file
|
|
49
|
-
|
|
48
|
+
***Remember to use the full path of the app that you download in the capabilities file and start the server using one of the commands below:***
|
|
49
|
+
```ruby
|
|
50
|
+
raider u start_appium
|
|
51
|
+
appium --base-path /wd/hub
|
|
52
|
+
```
|
|
50
53
|
***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read
|
|
51
54
|
more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.)
|
|
52
55
|
.***
|
|
@@ -82,13 +85,13 @@ Select the ones you will like to work with.
|
|
|
82
85
|
###### Anything between square brackets([...]) is where your imput goes
|
|
83
86
|
|
|
84
87
|
```ruby
|
|
85
|
-
Commands
|
|
86
|
-
|
|
87
|
-
raider help [COMMAND] # Describe available commands or one specific command
|
|
88
|
-
raider new [PROJECT_NAME] # Creates a new framework based on settings picked
|
|
89
|
-
raider open_ai # Provides access to all the open ai commands
|
|
90
|
-
raider utility # Provides access to all the utility commands
|
|
91
|
-
raider version # It shows the version of Ruby Raider you are currently using
|
|
88
|
+
Commands:
|
|
89
|
+
raider generate # Provides access to all the scaffolding commands
|
|
90
|
+
raider help [COMMAND] # Describe available commands or one specific command
|
|
91
|
+
raider new [PROJECT_NAME] # Creates a new framework based on settings picked
|
|
92
|
+
raider open_ai # Provides access to all the open ai commands
|
|
93
|
+
raider utility # Provides access to all the utility commands
|
|
94
|
+
raider version # It shows the version of Ruby Raider you are currently using
|
|
92
95
|
```
|
|
93
96
|
|
|
94
97
|
All the basic commands have their corresponding shortcut:
|
|
@@ -99,11 +102,14 @@ All the basic commands have their corresponding shortcut:
|
|
|
99
102
|
* u for utility
|
|
100
103
|
* v for version
|
|
101
104
|
|
|
102
|
-
|
|
105
|
+
### Scaffolding Commands
|
|
106
|
+
Ruby Raider also supports scaffolding:
|
|
103
107
|
|
|
104
108
|
* To create a new page object you do: ```raider g page [PAGE_NAME]```
|
|
105
109
|
* To create a new spec you do: ```raider g spec [SPEC_NAME]```
|
|
106
110
|
* To create a new feature you do: ```raider g feature [FEATURE_NAME]```
|
|
111
|
+
* To create a new steps definition you do: ```raider g steps [STEPS_NAME]```
|
|
112
|
+
* To create both a page/spec or a page/feature/steps you do: ```raider g scaffold [SCAFFOLD_NAME]```
|
|
107
113
|
|
|
108
114
|
It's possible to add the option --path or -p if you want to specify where to create your features, pages, helpers and
|
|
109
115
|
specs.
|
|
@@ -118,6 +124,13 @@ raider u path [PATH_NAME] - -helper or -h
|
|
|
118
124
|
|
|
119
125
|
If you don't specify an option, path will assume you want to change the default path for pages.
|
|
120
126
|
|
|
127
|
+
|
|
128
|
+
### Appium Server Command
|
|
129
|
+
To initialise Appium server run this command:
|
|
130
|
+
```ruby
|
|
131
|
+
raider u start_appium
|
|
132
|
+
```
|
|
133
|
+
|
|
121
134
|
### Open AI Commands
|
|
122
135
|
|
|
123
136
|
```ruby
|
|
@@ -137,4 +150,4 @@ Options :
|
|
|
137
150
|
-pr, [--prompt = PROMPT] # This will create the selected steps based on your prompt using open ai
|
|
138
151
|
-i, [--input = INPUT] # It uses a file as input to create the steps
|
|
139
152
|
|
|
140
|
-
```
|
|
153
|
+
```
|
|
@@ -21,6 +21,9 @@ module DriverHelper
|
|
|
21
21
|
end
|
|
22
22
|
<%- else -%>
|
|
23
23
|
# frozen_string_literal: true
|
|
24
|
+
<% if axe? -%>
|
|
25
|
+
require 'axe-selenium'
|
|
26
|
+
<% end -%>
|
|
24
27
|
require 'yaml'
|
|
25
28
|
<% if automation == 'selenium' -%>
|
|
26
29
|
require 'active_support/inflector'
|
|
@@ -30,10 +33,14 @@ require 'appium_lib'
|
|
|
30
33
|
<% end -%>
|
|
31
34
|
|
|
32
35
|
module DriverHelper
|
|
33
|
-
<% if automation == 'selenium' -%>
|
|
36
|
+
<% if automation == 'selenium' && axe? == false -%>
|
|
34
37
|
def driver(*opts)
|
|
35
38
|
@driver ||= create_driver(*opts)
|
|
36
39
|
end
|
|
40
|
+
<% elsif axe? == true -%>
|
|
41
|
+
def driver(browser = :chrome, js_path = nil, skip_iframes = nil)
|
|
42
|
+
@driver ||= create_driver(browser, js_path, skip_iframes)
|
|
43
|
+
end
|
|
37
44
|
<% else -%>
|
|
38
45
|
def driver
|
|
39
46
|
@driver ||= create_driver
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
<% if automation == 'selenium' -%>
|
|
1
|
+
<% if automation == 'selenium' && axe? == true -%>
|
|
2
|
+
def create_driver(browser, js_path, skip_iframes)
|
|
3
|
+
AxeSelenium.configure(browser) do |config|
|
|
4
|
+
config.jslib_path = js_path if js_path
|
|
5
|
+
config.skip_iframes = skip_iframes if skip_iframes
|
|
6
|
+
end.page
|
|
7
|
+
end
|
|
8
|
+
<% elsif automation == 'selenium' -%>
|
|
2
9
|
def create_driver(*opts)
|
|
3
10
|
@config = YAML.load_file('config/config.yml')
|
|
4
11
|
browser = @config['browser'].to_sym
|
|
@@ -22,7 +29,6 @@
|
|
|
22
29
|
driver_options.each { |opt| options.add_option(opt.first, opt.last) }
|
|
23
30
|
options
|
|
24
31
|
end
|
|
25
|
-
|
|
26
32
|
<% elsif automation == 'cross_platform' -%>
|
|
27
33
|
def create_driver
|
|
28
34
|
platform = config['platform'].to_s
|
data/lib/open_ai/open_ai.rb
CHANGED
|
@@ -14,12 +14,12 @@ module OpenAi
|
|
|
14
14
|
|
|
15
15
|
def configure_client
|
|
16
16
|
OpenAI.configure do |config|
|
|
17
|
-
config.access_token = '
|
|
17
|
+
config.access_token = ENV.fetch('OPENAI_ACCESS_TOKEN')
|
|
18
18
|
config.organization_id = ENV.fetch('OPENAI_ORGANIZATION_ID', nil)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def input(request, model = 'gpt-
|
|
22
|
+
def input(request, model = 'gpt-3.5-turbo', temperature = 0.7)
|
|
23
23
|
client.chat(
|
|
24
24
|
parameters: {
|
|
25
25
|
model: model,
|
data/lib/ruby_raider.rb
CHANGED
|
@@ -19,12 +19,12 @@ module RubyRaider
|
|
|
19
19
|
desc 'version', 'It shows the version of Ruby Raider you are currently using'
|
|
20
20
|
|
|
21
21
|
def version
|
|
22
|
-
puts "The version is #{
|
|
22
|
+
puts "The version is #{current_version}, happy testing!"
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
map 'v' => 'version'
|
|
26
26
|
|
|
27
|
-
desc 'generate', 'Provides access to all the
|
|
27
|
+
desc 'generate', 'Provides access to all the scaffolding commands'
|
|
28
28
|
subcommand 'generate', ScaffoldingCommands
|
|
29
29
|
map 'g' => 'generate'
|
|
30
30
|
|
|
@@ -37,8 +37,7 @@ module RubyRaider
|
|
|
37
37
|
map 'u' => 'utility'
|
|
38
38
|
|
|
39
39
|
no_commands do
|
|
40
|
-
def
|
|
41
|
-
def parsed_version = Gem::Version.new(gemspec.version)
|
|
40
|
+
def current_version = File.read(File.expand_path('version', __dir__)).strip
|
|
42
41
|
end
|
|
43
42
|
end
|
|
44
43
|
end
|
|
@@ -12,8 +12,8 @@ class Scaffolding < Thor::Group
|
|
|
12
12
|
"#{File.dirname(__FILE__)}/templates"
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def
|
|
16
|
-
template('page_object.tt', default_path("page_objects/pages/#{name}
|
|
15
|
+
def generate_page
|
|
16
|
+
template('page_object.tt', default_path("page_objects/pages/#{name}.rb", '_page.rb'))
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def generate_feature
|
|
@@ -21,20 +21,24 @@ class Scaffolding < Thor::Group
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def generate_spec
|
|
24
|
-
template('spec.tt', default_path("spec/#{name}
|
|
24
|
+
template('spec.tt', default_path("spec/#{name}_page_spec.rb", '_spec.rb'))
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def generate_helper
|
|
28
28
|
template('helper.tt', default_path("helpers/#{name}_helper.rb", '_helper.rb'))
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def generate_steps
|
|
32
|
+
template('steps.tt', default_path("features/step_definitions/#{name}_steps.rb", '_steps.rb'))
|
|
33
|
+
end
|
|
34
|
+
|
|
31
35
|
def generate_config
|
|
32
36
|
template('../../generators/templates/common/config.tt',
|
|
33
37
|
default_path('config/config.yml', '.yml'))
|
|
34
38
|
end
|
|
35
39
|
|
|
36
|
-
def
|
|
37
|
-
remove_file(default_path("page_objects/pages/#{name}
|
|
40
|
+
def delete_page
|
|
41
|
+
remove_file(default_path("page_objects/pages/#{name}.rb", '_page.rb'))
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
def delete_feature
|
|
@@ -42,13 +46,17 @@ class Scaffolding < Thor::Group
|
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
def delete_spec
|
|
45
|
-
remove_file(default_path("spec/#{name}
|
|
49
|
+
remove_file(default_path("spec/#{name}_page_spec.rb", '_spec.rb'))
|
|
46
50
|
end
|
|
47
51
|
|
|
48
52
|
def delete_helper
|
|
49
53
|
remove_file(default_path("helpers/#{name}_helper.rb", '_helper.rb'))
|
|
50
54
|
end
|
|
51
55
|
|
|
56
|
+
def delete_steps
|
|
57
|
+
remove_file(default_path("features/step_definitions/#{name}_steps.rb", '_steps.rb'))
|
|
58
|
+
end
|
|
59
|
+
|
|
52
60
|
def delete_config
|
|
53
61
|
remove_file(default_path('config/config.yml', '.yml'))
|
|
54
62
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '../abstract/
|
|
3
|
+
require_relative '../abstract/page'
|
|
4
4
|
|
|
5
|
-
class <%= name.split('_').map {|word| word.capitalize }.join
|
|
5
|
+
class <%= name.split('_').map {|word| word.capitalize }.join %> < Page
|
|
6
6
|
|
|
7
7
|
# Actions
|
|
8
8
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
require_relative '
|
|
2
|
-
require_relative '../page_objects/pages/<%= name %>_page'
|
|
1
|
+
require_relative '../page_objects/pages/<%= name %>'
|
|
3
2
|
|
|
4
|
-
describe <%= name.split('_').map {|word| word.capitalize }.join
|
|
3
|
+
describe '<%= name.split('_').map {|word| word.capitalize }.join %>' do
|
|
5
4
|
end
|
data/lib/version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.8.7
|
data/ruby_raider.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'ruby_raider'
|
|
5
|
-
s.version =
|
|
5
|
+
s.version = File.read(File.expand_path('lib/version', __dir__)).strip
|
|
6
6
|
s.summary = 'A gem to make setup and start of UI automation projects easier'
|
|
7
7
|
s.description = 'This gem has everything you need to start working with test automation'
|
|
8
8
|
s.authors = ['Agustin Pequeno']
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
# require 'fileutils'
|
|
3
3
|
# require 'pathname'
|
|
4
4
|
# require 'yaml'
|
|
5
|
-
# require_relative '
|
|
6
|
-
# require_relative '
|
|
7
|
-
# require_relative '
|
|
8
|
-
# require_relative 'spec_helper'
|
|
5
|
+
# require_relative '../../../lib/generators/common_generator'
|
|
6
|
+
# require_relative '../../../lib/integration.commands/open_ai_commands'
|
|
7
|
+
# require_relative '../../../lib/scaffolding/scaffolding'
|
|
8
|
+
# require_relative '../../spec_helper'
|
|
9
9
|
#
|
|
10
10
|
# describe OpenAiCommands do
|
|
11
11
|
# let(:open_ai) { described_class }
|
data/spec/{scaffolding_commands_spec.rb → integration/commands/scaffolding_commands_spec.rb}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
require 'dotenv'
|
|
2
2
|
require 'pathname'
|
|
3
3
|
require 'yaml'
|
|
4
|
-
require_relative '
|
|
5
|
-
require_relative '
|
|
6
|
-
require_relative '
|
|
7
|
-
require_relative 'spec_helper'
|
|
4
|
+
require_relative '../../../lib/generators/common_generator'
|
|
5
|
+
require_relative '../../../lib/commands/scaffolding_commands'
|
|
6
|
+
require_relative '../../../lib/scaffolding/scaffolding'
|
|
7
|
+
require_relative '../../spec_helper'
|
|
8
8
|
|
|
9
9
|
describe ScaffoldingCommands do
|
|
10
10
|
let(:scaffold) { described_class }
|
|
@@ -27,12 +27,12 @@ describe ScaffoldingCommands do
|
|
|
27
27
|
|
|
28
28
|
it 'scaffolds for rspec creating a spec' do
|
|
29
29
|
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
|
30
|
-
expect(Pathname.new("spec/#{name}
|
|
30
|
+
expect(Pathname.new("spec/#{name}_page_spec.rb")).to be_file
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it 'scaffolds for rspec creating a page' do
|
|
34
34
|
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
|
35
|
-
expect(Pathname.new("page_objects/pages/#{name}
|
|
35
|
+
expect(Pathname.new("page_objects/pages/#{name}.rb")).to be_file
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
it 'deletes a spec' do
|
|
@@ -47,7 +47,7 @@ describe ScaffoldingCommands do
|
|
|
47
47
|
|
|
48
48
|
it 'creates a page' do
|
|
49
49
|
scaffold.new.invoke(:page, nil, %W[#{name}])
|
|
50
|
-
expect(Pathname.new("page_objects/pages/#{name}
|
|
50
|
+
expect(Pathname.new("page_objects/pages/#{name}.rb")).to be_file
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it 'creates a page with a path' do
|
|
@@ -77,7 +77,12 @@ describe ScaffoldingCommands do
|
|
|
77
77
|
|
|
78
78
|
it 'scaffolds for cucumber creating a page' do
|
|
79
79
|
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
|
80
|
-
expect(Pathname.new("page_objects/pages/#{name}
|
|
80
|
+
expect(Pathname.new("page_objects/pages/#{name}.rb")).to be_file
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
it 'scaffolds for cucumber creating a steps definition' do
|
|
84
|
+
scaffold.new.invoke(:scaffold, nil, %W[#{name}])
|
|
85
|
+
expect(Pathname.new("features/step_definitions/#{name}_steps.rb")).to be_file
|
|
81
86
|
end
|
|
82
87
|
|
|
83
88
|
it 'creates a helper' do
|
|
@@ -85,6 +90,11 @@ describe ScaffoldingCommands do
|
|
|
85
90
|
expect(Pathname.new("helpers/#{name}_helper.rb")).to be_file
|
|
86
91
|
end
|
|
87
92
|
|
|
93
|
+
it 'creates a steps definition' do
|
|
94
|
+
scaffold.new.invoke(:steps, nil, %W[#{name}])
|
|
95
|
+
expect(Pathname.new("features/step_definitions/#{name}_steps.rb")).to be_file
|
|
96
|
+
end
|
|
97
|
+
|
|
88
98
|
it 'deletes a page' do
|
|
89
99
|
scaffold.new.invoke(:page, nil, %w[login --delete])
|
|
90
100
|
expect(Pathname.new('page_objects/pages/login_page.rb')).not_to be_file
|
|
@@ -2,10 +2,10 @@ require 'dotenv'
|
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'pathname'
|
|
4
4
|
require 'yaml'
|
|
5
|
-
require_relative '
|
|
6
|
-
require_relative '
|
|
7
|
-
require_relative '
|
|
8
|
-
require_relative 'spec_helper'
|
|
5
|
+
require_relative '../../../lib/generators/common_generator'
|
|
6
|
+
require_relative '../../../lib/commands/utility_commands'
|
|
7
|
+
require_relative '../../../lib/scaffolding/scaffolding'
|
|
8
|
+
require_relative '../../spec_helper'
|
|
9
9
|
|
|
10
10
|
describe UtilityCommands do
|
|
11
11
|
let(:utility) { described_class }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/actions/actions_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe ActionsGenerator do
|
|
7
7
|
shared_examples 'creates web automation framework' do |name|
|
data/spec/{automation_generator_spec.rb → integration/generators/automation_generator_spec.rb}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/automation/automation_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe AutomationGenerator do
|
|
7
7
|
shared_examples 'creates web automation framework' do |name|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/common_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe CommonGenerator do
|
|
7
7
|
shared_examples 'creates common files' do |name|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/cucumber/cucumber_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe CucumberGenerator do
|
|
7
7
|
shared_examples 'creates cucumber files' do |project_name, file_name|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/helper_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe HelpersGenerator do
|
|
7
7
|
shared_examples 'creates common helpers' do |name|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '
|
|
4
|
-
require_relative 'spec_helper'
|
|
3
|
+
require_relative '../../../lib/generators/rspec/rspec_generator'
|
|
4
|
+
require_relative '../../spec_helper'
|
|
5
5
|
|
|
6
6
|
describe RspecGenerator do
|
|
7
7
|
shared_examples 'creates factory files' do |project_name|
|
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: framework, automation: automation, visual: visual)
|
|
18
|
+
settings = create_settings(framework: framework, automation: automation, visual: visual, axe: axe_support)
|
|
19
19
|
generate_framework(settings)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
require 'fileutils'
|
|
2
|
-
require_relative 'spec_helper'
|
|
3
|
-
require_relative '
|
|
2
|
+
require_relative '../spec_helper'
|
|
3
|
+
require_relative '../../lib/ruby_raider'
|
|
4
4
|
|
|
5
5
|
describe RubyRaider do
|
|
6
6
|
shared_examples 'execute web frameworks' do |name|
|
|
7
7
|
it 'runs the tests' do
|
|
8
|
-
|
|
9
|
-
Dir.chdir(name)
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
if ENV['CI']
|
|
9
|
+
Dir.chdir(name) { system('gem install bundler && bundle install && raider u raid') }
|
|
10
|
+
else
|
|
11
|
+
Bundler.with_unbundled_env { Dir.chdir(name) { system('bundle exec raider u raid') } }
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
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.8.
|
|
4
|
+
version: 0.8.7
|
|
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-
|
|
11
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dotenv
|
|
@@ -175,9 +175,10 @@ files:
|
|
|
175
175
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
176
176
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
177
177
|
- ".github/auto_assign-issues.yml"
|
|
178
|
+
- ".github/workflows/integration.yml"
|
|
178
179
|
- ".github/workflows/reek.yml"
|
|
179
|
-
- ".github/workflows/rspec.yml"
|
|
180
180
|
- ".github/workflows/rubocop.yml"
|
|
181
|
+
- ".github/workflows/system.yml"
|
|
181
182
|
- ".gitignore"
|
|
182
183
|
- ".reek.yml"
|
|
183
184
|
- ".rubocop.yml"
|
|
@@ -268,21 +269,23 @@ files:
|
|
|
268
269
|
- lib/scaffolding/templates/helper.tt
|
|
269
270
|
- lib/scaffolding/templates/page_object.tt
|
|
270
271
|
- lib/scaffolding/templates/spec.tt
|
|
272
|
+
- lib/scaffolding/templates/steps.tt
|
|
271
273
|
- lib/utilities/logger.rb
|
|
272
274
|
- lib/utilities/utilities.rb
|
|
275
|
+
- lib/version
|
|
273
276
|
- ruby_raider.gemspec
|
|
274
|
-
- spec/
|
|
275
|
-
- spec/
|
|
276
|
-
- spec/
|
|
277
|
-
- spec/
|
|
278
|
-
- spec/
|
|
279
|
-
- spec/
|
|
280
|
-
- spec/
|
|
281
|
-
- spec/
|
|
282
|
-
- spec/
|
|
277
|
+
- spec/integration/commands/open_ai_commands_spec.rb
|
|
278
|
+
- spec/integration/commands/scaffolding_commands_spec.rb
|
|
279
|
+
- spec/integration/commands/utility_commands_spec.rb
|
|
280
|
+
- spec/integration/generators/actions_generator_spec.rb
|
|
281
|
+
- spec/integration/generators/automation_generator_spec.rb
|
|
282
|
+
- spec/integration/generators/common_generator_spec.rb
|
|
283
|
+
- spec/integration/generators/cucumber_generator_spec.rb
|
|
284
|
+
- spec/integration/generators/helpers_generator_spec.rb
|
|
285
|
+
- spec/integration/generators/rspec_generator_spec.rb
|
|
283
286
|
- spec/spec_helper.rb
|
|
284
287
|
- spec/support/settings_helper.rb
|
|
285
|
-
- spec/
|
|
288
|
+
- spec/system/ruby_raider_spec.rb
|
|
286
289
|
homepage: https://github.com/RubyRaider/ruby_raider
|
|
287
290
|
licenses:
|
|
288
291
|
- MIT
|
|
@@ -302,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
302
305
|
- !ruby/object:Gem::Version
|
|
303
306
|
version: '0'
|
|
304
307
|
requirements: []
|
|
305
|
-
rubygems_version: 3.
|
|
308
|
+
rubygems_version: 3.5.5
|
|
306
309
|
signing_key:
|
|
307
310
|
specification_version: 4
|
|
308
311
|
summary: A gem to make setup and start of UI automation projects easier
|