ruby_raider 0.7.2 → 0.7.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/.reek.yml +0 -4
- data/README.md +0 -1
- data/Rakefile +0 -6
- data/lib/generators/automation/automation_generator.rb +48 -1
- data/lib/generators/automation/templates/abstract_page.tt +1 -3
- data/lib/generators/cucumber/cucumber_generator.rb +16 -0
- data/lib/generators/cucumber/templates/partials/appium_env.tt +3 -4
- data/lib/generators/cucumber/templates/partials/driver_world.tt +2 -2
- data/lib/generators/cucumber/templates/partials/selenium_env.tt +12 -10
- data/lib/generators/cucumber/templates/partials/watir_env.tt +4 -32
- data/lib/generators/cucumber/templates/partials/watir_world.tt +1 -1
- data/lib/generators/helper_generator.rb +1 -6
- data/lib/generators/invoke_generators.rb +0 -14
- data/lib/generators/menu_generator.rb +9 -23
- data/lib/generators/rspec/rspec_generator.rb +10 -2
- data/lib/generators/rspec/templates/spec.tt +2 -2
- data/lib/generators/templates/common/read_me.tt +0 -1
- data/lib/generators/templates/helpers/allure_helper.tt +19 -21
- data/lib/generators/templates/helpers/appium_helper.tt +19 -21
- data/lib/generators/templates/helpers/browser_helper.tt +12 -9
- data/lib/generators/templates/helpers/driver_helper.tt +16 -15
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +24 -19
- data/lib/generators/templates/helpers/partials/screenshot.tt +6 -3
- data/lib/generators/templates/helpers/spec_helper.tt +18 -18
- data/lib/generators/templates/helpers/visual_helper.tt +1 -3
- data/lib/generators/templates/helpers/visual_spec_helper.tt +2 -4
- data/lib/ruby_raider.rb +1 -8
- data/ruby_raider.gemspec +1 -2
- data/spec/automation_generator_spec.rb +14 -70
- data/spec/cucumber_generator_spec.rb +0 -32
- data/spec/helpers_generator_spec.rb +0 -8
- data/spec/rspec_generator_spec.rb +12 -31
- data/spec/spec_helper.rb +4 -4
- data/spec/support/settings_helper.rb +1 -3
- metadata +2 -26
- data/lib/desktop/components/base_component.rb +0 -18
- data/lib/desktop/components/runner_components.rb +0 -196
- data/lib/desktop/screens/runner_screen.rb +0 -20
- data/lib/generators/automation/automation_examples_generator.rb +0 -48
- data/lib/generators/automation/templates/partials/require_raider.tt +0 -5
- data/lib/generators/cucumber/cucumber_examples_generator.rb +0 -21
- data/lib/generators/rspec/rspec_examples_generator.rb +0 -17
- data/lib/generators/rspec/templates/base_spec.tt +0 -7
- data/lib/generators/templates/helpers/partials/select_driver.tt +0 -9
- data/lib/generators/templates/helpers/raider_helper.tt +0 -19
@@ -1,30 +1,35 @@
|
|
1
1
|
<% if automation == 'selenium' -%>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
def create_driver(*opts)
|
3
|
+
@config = YAML.load_file('config/config.yml')
|
4
|
+
browser = @config['browser'].to_sym
|
5
|
+
Selenium::WebDriver.for(browser, capabilities: browser_options(*opts))
|
6
|
+
end
|
7
|
+
|
8
|
+
def browser_options(*opts)
|
9
|
+
opts = opts.empty? ? @config['browser_options'] : opts
|
10
|
+
create_options(*opts)
|
11
|
+
end
|
7
12
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
# :reek:FeatureEnvy
|
14
|
+
def create_options(*opts)
|
15
|
+
load_browser = @config['browser'].to_s
|
16
|
+
browser = load_browser == 'ie' ? load_browser.upcase : load_browser.capitalize
|
17
|
+
caps = "Selenium::WebDriver::#{browser}::Options".constantize.new
|
18
|
+
opts.each { |option| caps.add_argument(option) }
|
19
|
+
caps
|
20
|
+
end
|
12
21
|
|
13
|
-
# :reek:FeatureEnvy
|
14
|
-
def create_options(*opts)
|
15
|
-
load_browser = @config['browser'].to_s
|
16
|
-
browser = load_browser == 'ie' ? load_browser.upcase : load_browser.capitalize
|
17
|
-
caps = "Selenium::WebDriver::#{browser}::Options".constantize.new
|
18
|
-
opts.each { |option| caps.add_argument(option) }
|
19
|
-
caps
|
20
|
-
end
|
21
22
|
<% elsif automation == 'cross_platform' -%>
|
22
|
-
def
|
23
|
+
def create_driver
|
23
24
|
platform = config['platform'].to_s
|
24
25
|
@driver = Appium::Driver.new({ caps: caps[platform] })
|
25
26
|
end
|
27
|
+
|
28
|
+
def config
|
29
|
+
YAML.load_file('config/config.yml')
|
30
|
+
end
|
26
31
|
<% else -%>
|
27
|
-
def
|
32
|
+
def create_driver
|
28
33
|
@driver = Appium::Driver.new({ caps: caps })
|
29
34
|
end
|
30
35
|
<% end -%>
|
@@ -1,5 +1,8 @@
|
|
1
|
-
|
1
|
+
<% case automation
|
2
|
+
when 'selenium' %>
|
2
3
|
driver.save_screenshot("allure-results/screenshots/#{example_name}.png")
|
3
|
-
|
4
|
+
<% when 'watir' %>
|
4
5
|
browser.screenshot.save("allure-results/screenshots/#{example_name}.png")
|
5
|
-
|
6
|
+
<% else %>
|
7
|
+
driver.screenshot("allure-results/screenshots/#{example_name}.png")
|
8
|
+
<% end %>
|
@@ -2,29 +2,29 @@
|
|
2
2
|
|
3
3
|
require 'rspec'
|
4
4
|
require_relative 'allure_helper'
|
5
|
-
|
5
|
+
<%- if automation == 'watir' -%>
|
6
6
|
require_relative 'browser_helper'
|
7
|
-
|
7
|
+
<%- else -%>
|
8
8
|
require_relative 'driver_helper'
|
9
|
-
|
9
|
+
<%- end -%>
|
10
10
|
|
11
|
-
module
|
12
|
-
module SpecHelper
|
11
|
+
module SpecHelper
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
13
|
+
AllureHelper.configure
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.formatter = AllureHelper.formatter
|
16
|
+
<% if automation == 'watir' %>config.include(BrowserHelper)<% else %>config.include(DriverHelper)<% end %>
|
17
|
+
<%- if %w[android ios cross_platform].include? automation -%>
|
18
|
+
config.before(:each) do
|
19
|
+
driver.start_driver
|
20
|
+
end
|
21
|
+
<%- end -%>
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
23
|
+
config.after(:each) do
|
24
|
+
example_name = self.class.descendant_filtered_examples.first.description
|
25
|
+
<%= ERB.new(File.read(File.expand_path('./partials/screenshot.tt', __dir__)), trim_mode: '-').result(binding).strip! %>
|
26
|
+
AllureHelper.add_screenshot example_name
|
27
|
+
<%= ERB.new(File.read(File.expand_path('./partials/quit_driver.tt', __dir__)), trim_mode: '-').result(binding).strip! %>
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -4,8 +4,7 @@ require 'active_support/inflector'
|
|
4
4
|
require 'eyes_selenium'
|
5
5
|
require 'yaml'
|
6
6
|
|
7
|
-
module
|
8
|
-
module VisualHelper
|
7
|
+
module VisualHelper
|
9
8
|
attr_reader :eyes
|
10
9
|
|
11
10
|
SELENIUM = Applitools::Selenium
|
@@ -63,5 +62,4 @@ module Raider
|
|
63
62
|
conf.test_name = options[:test_name]
|
64
63
|
conf.viewport_size = REGTANGLE_SIZE.new(options[:viewport_size][:height], options[:viewport_size][:width])
|
65
64
|
end
|
66
|
-
end
|
67
65
|
end
|
@@ -6,8 +6,7 @@ require_relative 'allure_helper'
|
|
6
6
|
require_relative 'driver_helper'
|
7
7
|
require_relative 'visual_helper'
|
8
8
|
|
9
|
-
module
|
10
|
-
module SpecHelper
|
9
|
+
module SpecHelper
|
11
10
|
RSpec.configure do |config|
|
12
11
|
config.include(DriverHelper)
|
13
12
|
config.include(VisualHelper)
|
@@ -16,7 +15,7 @@ module Raider
|
|
16
15
|
@grid_runner = create_grid_runner
|
17
16
|
@eyes = create_eyes(@grid_runner)
|
18
17
|
configure_eyes @eyes
|
19
|
-
@driver = @eyes.open(driver:
|
18
|
+
@driver = @eyes.open(driver: driver)
|
20
19
|
end
|
21
20
|
|
22
21
|
config.after(:each) do
|
@@ -29,6 +28,5 @@ module Raider
|
|
29
28
|
results = @grid_runner.get_all_test_results
|
30
29
|
puts results
|
31
30
|
end
|
32
|
-
end
|
33
31
|
end
|
34
32
|
end
|
data/lib/ruby_raider.rb
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
require_relative '../lib/commands/open_ai_commands'
|
4
4
|
require_relative '../lib/commands/scaffolding_commands'
|
5
5
|
require_relative '../lib/commands/utility_commands'
|
6
|
-
require_relative '../lib/desktop/screens/runner_screen'
|
7
6
|
|
8
7
|
# :reek:FeatureEnvy { enabled: false }
|
9
8
|
# :reek:UtilityFunction { enabled: false }
|
@@ -17,16 +16,10 @@ module RubyRaider
|
|
17
16
|
|
18
17
|
map '-n' => 'new'
|
19
18
|
|
20
|
-
desc 'open', 'It opens the Ruby Raider desktop app'
|
21
|
-
|
22
|
-
def open
|
23
|
-
RunnerScreen.new.launch
|
24
|
-
end
|
25
|
-
|
26
19
|
desc 'version', 'It shows the version of Ruby Raider you are currently using'
|
27
20
|
|
28
21
|
def version
|
29
|
-
puts 'The Ruby Raider version is 0.7.
|
22
|
+
puts 'The Ruby Raider version is 0.7.4, Happy testing!'
|
30
23
|
end
|
31
24
|
|
32
25
|
map 'v' => 'version'
|
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 = '0.7.
|
5
|
+
s.version = '0.7.4'
|
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']
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency 'rubocop-rspec', '~> 2.9.0'
|
23
23
|
|
24
24
|
s.add_runtime_dependency 'faraday', '~> 1.2.0'
|
25
|
-
s.add_runtime_dependency 'glimmer-dsl-libui', '~> 0.7.3'
|
26
25
|
s.add_runtime_dependency 'ruby-openai', '~> 3.5'
|
27
26
|
s.add_runtime_dependency 'thor', '~> 1.2.1'
|
28
27
|
s.add_runtime_dependency 'tty-prompt', '~> 0.23.1'
|
@@ -4,7 +4,7 @@ require_relative '../lib/generators/automation/automation_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe AutomationGenerator do
|
7
|
-
shared_examples 'creates web automation framework
|
7
|
+
shared_examples 'creates web automation framework' do |name|
|
8
8
|
it 'creates a login page file' do
|
9
9
|
expect(File).to exist("#{name}/page_objects/pages/login_page.rb")
|
10
10
|
end
|
@@ -22,25 +22,7 @@ describe AutomationGenerator do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
shared_examples 'creates
|
26
|
-
it 'creates an abstract page file' do
|
27
|
-
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'creates an abstract component file' do
|
31
|
-
expect(File).to exist("#{name}/page_objects/abstract/abstract_component.rb")
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'creates a login page file' do
|
35
|
-
expect(File).not_to exist("#{name}/page_objects/pages/login_page.rb")
|
36
|
-
end
|
37
|
-
|
38
|
-
it 'creates a component file' do
|
39
|
-
expect(File).not_to exist("#{name}/page_objects/components/header_component.rb")
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
shared_examples 'creates mobile automation framework with example files' do |name|
|
25
|
+
shared_examples 'creates mobile automation framework' do |name|
|
44
26
|
it 'creates a home page file' do
|
45
27
|
expect(File).to exist("#{name}/page_objects/pages/home_page.rb")
|
46
28
|
end
|
@@ -54,21 +36,7 @@ describe AutomationGenerator do
|
|
54
36
|
end
|
55
37
|
end
|
56
38
|
|
57
|
-
shared_examples 'creates
|
58
|
-
it 'creates an abstract page file' do
|
59
|
-
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'creates a home page file' do
|
63
|
-
expect(File).not_to exist("#{name}/page_objects/pages/home_page.rb")
|
64
|
-
end
|
65
|
-
|
66
|
-
it 'creates a pdp page file' do
|
67
|
-
expect(File).not_to exist("#{name}/page_objects/pages/pdp_page.rb")
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
shared_examples 'creates web visual framework with example files' do |name|
|
39
|
+
shared_examples 'creates web visual framework' do |name|
|
72
40
|
it 'creates a login page file' do
|
73
41
|
expect(File).to exist("#{name}/page_objects/pages/login_page.rb")
|
74
42
|
end
|
@@ -78,65 +46,41 @@ describe AutomationGenerator do
|
|
78
46
|
end
|
79
47
|
end
|
80
48
|
|
81
|
-
shared_examples 'creates web visual framework without example files' do |name|
|
82
|
-
it 'creates an abstract page file' do
|
83
|
-
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
49
|
context 'with rspec and selenium' do
|
88
|
-
include_examples 'creates web automation framework
|
89
|
-
include_examples 'creates web
|
90
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_without_examples"
|
91
|
-
include_examples 'creates web visual framework with example files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
50
|
+
include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
51
|
+
include_examples 'creates web visual framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
92
52
|
end
|
93
53
|
|
94
54
|
context 'with rspec and watir' do
|
95
|
-
include_examples 'creates web automation framework
|
96
|
-
include_examples 'creates web automation framework without example files',
|
97
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_without_examples"
|
98
|
-
include_examples 'creates web visual framework with example files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
55
|
+
include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
99
56
|
end
|
100
57
|
|
101
58
|
context 'with cucumber and selenium' do
|
102
|
-
include_examples 'creates web automation framework
|
103
|
-
include_examples 'creates web
|
104
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_without_examples"
|
59
|
+
include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
60
|
+
include_examples 'creates web visual framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_visual"
|
105
61
|
end
|
106
62
|
|
107
63
|
context 'with cucumber and watir' do
|
108
|
-
include_examples 'creates web automation framework
|
109
|
-
include_examples 'creates web automation framework without example files',
|
110
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_without_examples"
|
64
|
+
include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}"
|
111
65
|
end
|
112
66
|
|
113
67
|
context 'with rspec and appium android' do
|
114
|
-
include_examples 'creates mobile automation framework
|
115
|
-
include_examples 'creates mobile automation framework without example files',
|
116
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}_without_examples"
|
68
|
+
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}"
|
117
69
|
end
|
118
70
|
|
119
71
|
context 'with rspec and appium ios' do
|
120
|
-
include_examples 'creates mobile automation framework
|
121
|
-
include_examples 'creates mobile automation framework without example files',
|
122
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}_without_examples"
|
72
|
+
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}"
|
123
73
|
end
|
124
74
|
|
125
75
|
context 'with cucumber and appium android' do
|
126
|
-
include_examples 'creates mobile automation framework
|
127
|
-
include_examples 'creates mobile automation framework without example files',
|
128
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}_without_examples"
|
76
|
+
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}"
|
129
77
|
end
|
130
78
|
|
131
79
|
context 'with cucumber and appium ios' do
|
132
|
-
include_examples 'creates mobile automation framework
|
133
|
-
include_examples 'creates mobile automation framework without example files',
|
134
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}_without_examples"
|
80
|
+
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}"
|
135
81
|
end
|
136
82
|
|
137
83
|
context 'with cucumber and appium cross platform' do
|
138
|
-
include_examples 'creates mobile automation framework
|
139
|
-
include_examples 'creates mobile automation framework without example files',
|
140
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}_without_examples"
|
84
|
+
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
|
141
85
|
end
|
142
86
|
end
|
@@ -4,28 +4,6 @@ require_relative '../lib/generators/cucumber/cucumber_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe CucumberGenerator do
|
7
|
-
shared_examples 'creates cucumber files without examples' do |project_name, file_name|
|
8
|
-
it 'creates a feature file' do
|
9
|
-
expect(File).not_to exist("#{project_name}/features/#{file_name}.feature")
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'creates a step definitions file' do
|
13
|
-
expect(File).not_to exist("#{project_name}/features/step_definitions/#{file_name}_steps.rb")
|
14
|
-
end
|
15
|
-
|
16
|
-
it 'creates an env file' do
|
17
|
-
expect(File).to exist("#{project_name}/features/support/env.rb")
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'creates an cucumber.yml file' do
|
21
|
-
expect(File).to exist("#{project_name}/cucumber.yml")
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'does not create a spec file' do
|
25
|
-
expect(File).not_to exist("#{project_name}/spec/home_spec.rb")
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
7
|
shared_examples 'creates cucumber files' do |project_name, file_name|
|
30
8
|
it 'creates a feature file' do
|
31
9
|
expect(File).to exist("#{project_name}/features/#{file_name}.feature")
|
@@ -64,33 +42,23 @@ describe CucumberGenerator do
|
|
64
42
|
|
65
43
|
context 'with cucumber and appium android' do
|
66
44
|
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}", 'home'
|
67
|
-
include_examples 'creates cucumber files without examples',
|
68
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.first}_without_examples", 'home'
|
69
45
|
end
|
70
46
|
|
71
47
|
context 'with cucumber and appium ios' do
|
72
48
|
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}", 'home'
|
73
|
-
include_examples 'creates cucumber files without examples',
|
74
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[1]}_without_examples", 'home'
|
75
49
|
end
|
76
50
|
|
77
51
|
context 'with cucumber and appium cross platform' do
|
78
52
|
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}", 'home'
|
79
|
-
include_examples 'creates cucumber files without examples',
|
80
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}_without_examples", 'home'
|
81
53
|
end
|
82
54
|
|
83
55
|
context 'with cucumber and selenium' do
|
84
56
|
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
|
85
57
|
include_examples 'creates factories for web projects', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}", 'login'
|
86
|
-
include_examples 'creates cucumber files without examples',
|
87
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_without_examples", 'login'
|
88
58
|
end
|
89
59
|
|
90
60
|
context 'with cucumber and watir' do
|
91
61
|
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}", 'login'
|
92
62
|
include_examples 'creates factories for web projects', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}", 'login'
|
93
|
-
include_examples 'creates cucumber files without examples',
|
94
|
-
"#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[3]}_without_examples", 'login'
|
95
63
|
end
|
96
64
|
end
|
@@ -5,10 +5,6 @@ require_relative 'spec_helper'
|
|
5
5
|
|
6
6
|
describe HelpersGenerator do
|
7
7
|
shared_examples 'creates common helpers' do |name|
|
8
|
-
it 'creates a raider file' do
|
9
|
-
expect(File).to exist("#{name}/helpers/raider.rb")
|
10
|
-
end
|
11
|
-
|
12
8
|
it 'creates an allure helper file' do
|
13
9
|
expect(File).to exist("#{name}/helpers/allure_helper.rb")
|
14
10
|
end
|
@@ -45,10 +41,6 @@ describe HelpersGenerator do
|
|
45
41
|
end
|
46
42
|
|
47
43
|
shared_examples 'creates common visual helpers' do |name|
|
48
|
-
it 'creates a raider file' do
|
49
|
-
expect(File).to exist("#{name}/helpers/raider.rb")
|
50
|
-
end
|
51
|
-
|
52
44
|
it 'creates a visual helper file' do
|
53
45
|
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
54
46
|
end
|
@@ -4,16 +4,6 @@ require_relative '../lib/generators/rspec/rspec_generator'
|
|
4
4
|
require_relative 'spec_helper'
|
5
5
|
|
6
6
|
describe RspecGenerator do
|
7
|
-
shared_examples 'creates rspec files' do |project_name, file_name|
|
8
|
-
it 'creates a spec file' do
|
9
|
-
expect(File).to exist("#{project_name}/spec/#{file_name}_page_spec.rb")
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'creates the base spec file' do
|
13
|
-
expect(File).to exist("#{project_name}/spec/base_spec.rb")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
7
|
shared_examples 'creates factory files' do |project_name|
|
18
8
|
it 'creates a model factory file' do
|
19
9
|
expect(File).to exist("#{project_name}/models/model_factory.rb")
|
@@ -24,45 +14,36 @@ describe RspecGenerator do
|
|
24
14
|
end
|
25
15
|
end
|
26
16
|
|
27
|
-
shared_examples 'creates rspec files
|
17
|
+
shared_examples 'creates rspec files examples' do |project_name, file_name|
|
28
18
|
it 'creates a spec file' do
|
29
|
-
expect(File).
|
30
|
-
end
|
31
|
-
|
32
|
-
it 'creates the base spec file' do
|
33
|
-
expect(File).to exist("#{project_name}/spec/base_spec.rb")
|
19
|
+
expect(File).to exist("#{project_name}/spec/#{file_name}_page_spec.rb")
|
34
20
|
end
|
35
21
|
end
|
36
22
|
|
37
23
|
context 'with rspec and selenium' do
|
38
|
-
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}", 'login'
|
39
24
|
include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
40
|
-
include_examples 'creates rspec files
|
41
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}
|
25
|
+
include_examples 'creates rspec files examples',
|
26
|
+
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}", 'login'
|
42
27
|
end
|
43
28
|
|
44
29
|
context 'with rspec and watir' do
|
45
|
-
include_examples 'creates rspec files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}", 'login'
|
46
30
|
include_examples 'creates factory files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
47
|
-
include_examples 'creates rspec files
|
48
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}
|
31
|
+
include_examples 'creates rspec files examples',
|
32
|
+
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}", 'login'
|
49
33
|
end
|
50
34
|
|
51
35
|
context 'with rspec and appium android' do
|
52
|
-
include_examples 'creates rspec files',
|
53
|
-
|
54
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}_without_examples", 'pdp'
|
36
|
+
include_examples 'creates rspec files examples',
|
37
|
+
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.first}", 'pdp'
|
55
38
|
end
|
56
39
|
|
57
40
|
context 'with rspec and appium ios' do
|
58
|
-
include_examples 'creates rspec files',
|
59
|
-
|
60
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}_without_examples", 'pdp'
|
41
|
+
include_examples 'creates rspec files examples',
|
42
|
+
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[1]}", 'pdp'
|
61
43
|
end
|
62
44
|
|
63
45
|
context 'with rspec and appium cross platform' do
|
64
|
-
include_examples 'creates rspec files',
|
65
|
-
|
66
|
-
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}_without_examples", 'pdp'
|
46
|
+
include_examples 'creates rspec files examples',
|
47
|
+
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}", 'pdp'
|
67
48
|
end
|
68
49
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -14,8 +14,8 @@ RSpec.configure do |config|
|
|
14
14
|
config.before(:all) do
|
15
15
|
FRAMEWORKS.each do |framework|
|
16
16
|
AUTOMATION_TYPES.each do |automation|
|
17
|
-
[true, false].
|
18
|
-
settings = create_settings(framework: framework, automation: automation,
|
17
|
+
[true, false].each do |visual|
|
18
|
+
settings = create_settings(framework: framework, automation: automation, visual: visual)
|
19
19
|
generate_framework(settings)
|
20
20
|
end
|
21
21
|
end
|
@@ -25,8 +25,8 @@ RSpec.configure do |config|
|
|
25
25
|
config.after(:all) do
|
26
26
|
FRAMEWORKS.each do |framework|
|
27
27
|
AUTOMATION_TYPES.each do |automation|
|
28
|
-
[true, false].
|
29
|
-
settings = create_settings(framework: framework, automation: automation,
|
28
|
+
[true, false].each do |visual|
|
29
|
+
settings = create_settings(framework: framework, automation: automation, visual: visual)
|
30
30
|
FileUtils.rm_rf(settings[:name])
|
31
31
|
end
|
32
32
|
end
|
@@ -4,14 +4,12 @@
|
|
4
4
|
module SettingsHelper
|
5
5
|
def create_settings(options)
|
6
6
|
automation = options[:automation]
|
7
|
-
examples = options[:examples]
|
8
7
|
visual = options[:visual]
|
9
8
|
framework = options[:framework]
|
10
9
|
{
|
11
10
|
automation: automation,
|
12
|
-
examples: examples,
|
13
11
|
framework: framework,
|
14
|
-
name: "#{framework}_#{automation}#{'_visual' if visual}
|
12
|
+
name: "#{framework}_#{automation}#{'_visual' if visual}",
|
15
13
|
visual: visual
|
16
14
|
}
|
17
15
|
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.7.
|
4
|
+
version: 0.7.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: 2023-
|
11
|
+
date: 2023-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.2.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: glimmer-dsl-libui
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 0.7.3
|
132
|
-
type: :runtime
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 0.7.3
|
139
125
|
- !ruby/object:Gem::Dependency
|
140
126
|
name: ruby-openai
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -205,10 +191,6 @@ files:
|
|
205
191
|
- lib/commands/open_ai_commands.rb
|
206
192
|
- lib/commands/scaffolding_commands.rb
|
207
193
|
- lib/commands/utility_commands.rb
|
208
|
-
- lib/desktop/components/base_component.rb
|
209
|
-
- lib/desktop/components/runner_components.rb
|
210
|
-
- lib/desktop/screens/runner_screen.rb
|
211
|
-
- lib/generators/automation/automation_examples_generator.rb
|
212
194
|
- lib/generators/automation/automation_generator.rb
|
213
195
|
- lib/generators/automation/templates/abstract_component.tt
|
214
196
|
- lib/generators/automation/templates/abstract_page.tt
|
@@ -224,7 +206,6 @@ files:
|
|
224
206
|
- lib/generators/automation/templates/partials/initialize_selector.tt
|
225
207
|
- lib/generators/automation/templates/partials/ios_caps.tt
|
226
208
|
- lib/generators/automation/templates/partials/pdp_page_selector.tt
|
227
|
-
- lib/generators/automation/templates/partials/require_raider.tt
|
228
209
|
- lib/generators/automation/templates/partials/selenium_account.tt
|
229
210
|
- lib/generators/automation/templates/partials/selenium_login.tt
|
230
211
|
- lib/generators/automation/templates/partials/url_methods.tt
|
@@ -234,7 +215,6 @@ files:
|
|
234
215
|
- lib/generators/automation/templates/pdp_page.tt
|
235
216
|
- lib/generators/automation/templates/visual_options.tt
|
236
217
|
- lib/generators/common_generator.rb
|
237
|
-
- lib/generators/cucumber/cucumber_examples_generator.rb
|
238
218
|
- lib/generators/cucumber/cucumber_generator.rb
|
239
219
|
- lib/generators/cucumber/templates/cucumber.tt
|
240
220
|
- lib/generators/cucumber/templates/env.tt
|
@@ -253,9 +233,7 @@ files:
|
|
253
233
|
- lib/generators/helper_generator.rb
|
254
234
|
- lib/generators/invoke_generators.rb
|
255
235
|
- lib/generators/menu_generator.rb
|
256
|
-
- lib/generators/rspec/rspec_examples_generator.rb
|
257
236
|
- lib/generators/rspec/rspec_generator.rb
|
258
|
-
- lib/generators/rspec/templates/base_spec.tt
|
259
237
|
- lib/generators/rspec/templates/data.tt
|
260
238
|
- lib/generators/rspec/templates/factory.tt
|
261
239
|
- lib/generators/rspec/templates/spec.tt
|
@@ -277,8 +255,6 @@ files:
|
|
277
255
|
- lib/generators/templates/helpers/partials/driver_and_options.tt
|
278
256
|
- lib/generators/templates/helpers/partials/quit_driver.tt
|
279
257
|
- lib/generators/templates/helpers/partials/screenshot.tt
|
280
|
-
- lib/generators/templates/helpers/partials/select_driver.tt
|
281
|
-
- lib/generators/templates/helpers/raider_helper.tt
|
282
258
|
- lib/generators/templates/helpers/spec_helper.tt
|
283
259
|
- lib/generators/templates/helpers/visual_helper.tt
|
284
260
|
- lib/generators/templates/helpers/visual_spec_helper.tt
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'glimmer-dsl-libui'
|
2
|
-
|
3
|
-
class BaseComponent
|
4
|
-
include Glimmer
|
5
|
-
|
6
|
-
def initialize
|
7
|
-
super
|
8
|
-
if File.directory?('spec')
|
9
|
-
@folder = 'spec'
|
10
|
-
@framework = 'rspec'
|
11
|
-
@extension = '*_spec.rb'
|
12
|
-
else
|
13
|
-
@folder = 'features'
|
14
|
-
@framework = 'cucumber'
|
15
|
-
@extension = '*.feature'
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|