ruby_raider 0.4.8 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/commands/utility_commands.rb +18 -3
- data/lib/generators/menu_generator.rb +1 -7
- data/lib/generators/templates/automation/app_page.tt +2 -0
- data/lib/generators/templates/automation/login_page.tt +4 -4
- data/lib/generators/templates/automation/partials/visual_login.tt +11 -1
- data/lib/generators/templates/common/gemfile.tt +1 -0
- data/lib/generators/templates/common/read_me.tt +2 -0
- data/lib/generators/templates/helpers/raider_helper.tt +11 -11
- data/lib/generators/templates/helpers/visual_helper.tt +1 -0
- data/lib/generators/templates/helpers/visual_spec_helper.tt +9 -1
- data/lib/generators/templates/rspec/spec.tt +9 -10
- data/lib/utilities/open_ai.rb +37 -0
- data/ruby_raider.gemspec +2 -1
- data/spec/automation_generator_spec.rb +16 -0
- data/spec/common_generator_spec.rb +19 -1
- data/spec/helpers_generator_spec.rb +26 -0
- data/spec/spec_helper.rb +5 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3eb106f129e5b690948b563085637b1bf775ffbd0258972b8fd7551021abe64e
|
4
|
+
data.tar.gz: ad19ffdff7e43f3dc4f8a81f7720022c519070cc685bf9bd489ff130ad484fe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a319a898af7c5d4282d06904bdf298efcb1aeff70715c8ba18bee62b5af289375d8fc398cfd2fe1d236518569f367500532989e55bac102ee6ea45397922d3c9
|
7
|
+
data.tar.gz: c4d26509776661ee9d52d8962f00929a8e50b3e7e14583b65568685b7f9562c3cc7412eb0151659f34c9cf7edccad8225238293c6187ab402919ab8964866204
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ruby_raider.svg)](https://badge.fury.io/rb/ruby_raider)
|
4
4
|
[![Rubocop](https://github.com/RubyRaider/ruby_raider/actions/workflows/rspec.yml/badge.svg)](https://github.com/RubyRaider/ruby_raider/actions/workflows/rspec.yml)
|
5
|
+
[![Gitter](https://badges.gitter.im/RubyRaider/community.svg)](https://gitter.im/RubyRaider/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
5
6
|
|
6
7
|
<!-- PROJECT LOGO -->
|
7
8
|
<br />
|
@@ -53,6 +54,8 @@ Ruby Raider is a generator and scaffolding gem to make UI test automation easier
|
|
53
54
|
|
54
55
|
* Generating a visual testing framework with Rspec, Applitools and Selenium
|
55
56
|
|
57
|
+
* Generating a visual testing framework with Rspec, Applitools and Watir
|
58
|
+
|
56
59
|
***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
|
57
60
|
|
58
61
|
***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.).***
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'thor'
|
4
4
|
require_relative '../utilities/utilities'
|
5
|
+
require_relative '../utilities/open_ai'
|
5
6
|
|
6
7
|
class UtilityCommands < Thor
|
7
8
|
desc 'path [PATH]', 'Sets the default path for scaffolding'
|
@@ -73,7 +74,7 @@ class UtilityCommands < Thor
|
|
73
74
|
option :delete,
|
74
75
|
type: :boolean, required: false, desc: 'This will delete the selected config file', aliases: '-d'
|
75
76
|
|
76
|
-
desc 'platform [
|
77
|
+
desc 'platform [PLATFORM]', 'Sets the default platform for a cross-platform project'
|
77
78
|
|
78
79
|
def platform(platform)
|
79
80
|
Utilities.new.platform = platform
|
@@ -81,7 +82,7 @@ class UtilityCommands < Thor
|
|
81
82
|
|
82
83
|
map '-pl' => 'platform'
|
83
84
|
|
84
|
-
desc 'download_builds [
|
85
|
+
desc 'download_builds [BUILD_TYPE]', 'It downloads the example builds for appium projects'
|
85
86
|
def download_builds(build_type)
|
86
87
|
if %w[android, ios, both].include?(build_type)
|
87
88
|
raise 'Please select one of the following build types: android, ios, both'
|
@@ -94,8 +95,22 @@ class UtilityCommands < Thor
|
|
94
95
|
|
95
96
|
desc 'version', 'It shows the version of Ruby Raider you are currently using'
|
96
97
|
def version
|
97
|
-
puts 'The Ruby Raider version is 0.
|
98
|
+
puts 'The Ruby Raider version is 0.5.0, Happy testing!'
|
98
99
|
end
|
99
100
|
|
100
101
|
map '-v' => 'version'
|
102
|
+
|
103
|
+
desc 'open_ai [REQUEST]', 'Uses open AI to create a file or generate output'
|
104
|
+
option :path,
|
105
|
+
type: :string, required: false, desc: 'The path where your file will be created', aliases: '-p'
|
106
|
+
option :output,
|
107
|
+
type: :string, required: false, desc: 'This will output the response from open AI on the terminal', aliases: '-o'
|
108
|
+
|
109
|
+
def open_ai(request)
|
110
|
+
if options[:path]
|
111
|
+
OpenAi.create_file(choice = 0, options[:path], request)
|
112
|
+
else
|
113
|
+
OpenAi.output(request)
|
114
|
+
end
|
115
|
+
end
|
101
116
|
end
|
@@ -67,18 +67,12 @@ class MenuGenerator
|
|
67
67
|
private
|
68
68
|
|
69
69
|
def framework_choice(framework, automation_type)
|
70
|
-
visual_automation = if automation_type
|
71
|
-
choose_visual_automation
|
72
|
-
end
|
70
|
+
visual_automation = choose_visual_automation if %w[selenium watir].include?(automation_type) && framework == 'Rspec'
|
73
71
|
|
74
72
|
set_up_framework(automation_type, framework.downcase, visual_automation)
|
75
73
|
prompt.say("You have chosen to use #{framework} with #{automation_type}")
|
76
74
|
end
|
77
75
|
|
78
|
-
def error_handling(platform)
|
79
|
-
pp "#{platform} appium is coming soon. Thank you for the interest"
|
80
|
-
end
|
81
|
-
|
82
76
|
def select_test_framework(automation)
|
83
77
|
prompt.select('Please select your test framework') do |menu|
|
84
78
|
menu.choice :Cucumber, -> { framework_choice('Cucumber', automation) }
|
@@ -1,7 +1,7 @@
|
|
1
|
-
<% if automation
|
2
|
-
<%= ERB.new(File.read(File.expand_path('./partials/visual_login.tt', __dir__))).result(binding) %>
|
1
|
+
<% if %w[selenium watir].include?(automation) && visual_automation == true %>
|
2
|
+
<%= ERB.new(File.read(File.expand_path('./partials/visual_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
3
3
|
<% elsif automation == 'selenium' %>
|
4
|
-
<%= ERB.new(File.read(File.expand_path('./partials/selenium_login.tt', __dir__))).result(binding) %>
|
4
|
+
<%= ERB.new(File.read(File.expand_path('./partials/selenium_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
5
5
|
<% elsif automation == 'watir' %>
|
6
|
-
<%= ERB.new(File.read(File.expand_path('./partials/watir_login.tt', __dir__))).result(binding) %>
|
6
|
+
<%= ERB.new(File.read(File.expand_path('./partials/watir_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
7
7
|
<% end %>
|
@@ -3,7 +3,9 @@
|
|
3
3
|
require_relative '../abstract/abstract_page'
|
4
4
|
|
5
5
|
class LoginPage < AbstractPage
|
6
|
+
<%- if automation == 'selenium' -%>
|
6
7
|
using Raider::SeleniumHelper
|
8
|
+
<%- end -%>
|
7
9
|
|
8
10
|
def url(_page)
|
9
11
|
'index.html'
|
@@ -12,7 +14,11 @@ class LoginPage < AbstractPage
|
|
12
14
|
# Actions
|
13
15
|
|
14
16
|
def login
|
17
|
+
<%- if automation == 'watir' -%>
|
18
|
+
login_button.click
|
19
|
+
<%- else -%>
|
15
20
|
login_button.click_when_present
|
21
|
+
<%- end -%>
|
16
22
|
end
|
17
23
|
|
18
24
|
private
|
@@ -20,6 +26,10 @@ class LoginPage < AbstractPage
|
|
20
26
|
# Elements
|
21
27
|
|
22
28
|
def login_button
|
29
|
+
<%- if automation == 'watir' -%>
|
30
|
+
browser.element(id: 'log-in')
|
31
|
+
<%- else -%>
|
23
32
|
driver.find_element(:id, 'log-in')
|
33
|
+
<%- end -%>
|
24
34
|
end
|
25
|
-
end
|
35
|
+
end
|
@@ -50,6 +50,8 @@ Ruby Raider is a generator and scaffolding gem to make UI test automation easier
|
|
50
50
|
|
51
51
|
* Generating a visual testing framework with Rspec, Applitools and Selenium
|
52
52
|
|
53
|
+
* Generating a visual testing framework with Rspec, Applitools and Watir
|
54
|
+
|
53
55
|
***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
|
54
56
|
|
55
57
|
***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.).***
|
@@ -1,22 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Raider
|
4
|
-
|
4
|
+
<%- if framework == 'rspec' -%>
|
5
5
|
require_relative 'spec_helper'
|
6
|
-
|
6
|
+
<%- end -%>
|
7
7
|
<%= ERB.new(File.read(File.expand_path('./partials/require_automation.tt', __dir__))).result(binding).strip! %>
|
8
|
-
|
8
|
+
<%- if automation == 'watir' -%>
|
9
9
|
require_relative 'browser_helper'
|
10
|
-
|
10
|
+
<%- else -%>
|
11
11
|
require_relative 'driver_helper'
|
12
|
-
|
13
|
-
|
12
|
+
<%- end -%>
|
13
|
+
<%- unless visual_automation -%>
|
14
14
|
require_relative 'allure_helper'
|
15
|
-
|
16
|
-
|
15
|
+
<%- end -%>
|
16
|
+
<%- if automation == 'cross_platform' -%>
|
17
17
|
require_relative 'appium_helper'
|
18
|
-
|
19
|
-
|
18
|
+
<%- end -%>
|
19
|
+
<%- if visual_automation -%>
|
20
20
|
require_relative 'visual_helper'
|
21
|
-
|
21
|
+
<%- end -%>
|
22
22
|
end
|
@@ -2,20 +2,28 @@
|
|
2
2
|
|
3
3
|
require 'rspec'
|
4
4
|
require 'eyes_selenium'
|
5
|
+
<%- if automation == 'selenium' -%>
|
5
6
|
require_relative 'driver_helper'
|
7
|
+
<%- else -%>
|
8
|
+
require_relative 'browser_helper'
|
9
|
+
<%- end -%>
|
6
10
|
require_relative 'visual_helper'
|
7
11
|
|
8
12
|
module Raider
|
9
13
|
module SpecHelper
|
10
14
|
RSpec.configure do |config|
|
11
|
-
config.include(DriverHelper)
|
15
|
+
config.include(<%- if automation == 'watir' -%>BrowserHelper<% else -%>DriverHelper<%- end -%>)
|
12
16
|
config.include(VisualHelper)
|
13
17
|
config.before(:each) do
|
14
18
|
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
15
19
|
@grid_runner = create_grid_runner
|
16
20
|
@eyes = create_eyes(@grid_runner)
|
17
21
|
configure_eyes @eyes
|
22
|
+
<%- if automation == 'selenium' -%>
|
18
23
|
@driver = @eyes.open(driver: new_driver)
|
24
|
+
<%- else -%>
|
25
|
+
@driver = @eyes.open(driver: new_browser.driver)
|
26
|
+
<%- end -%>
|
19
27
|
end
|
20
28
|
|
21
29
|
config.after(:each) do
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% if automation
|
1
|
+
<% if %w[selenium watir].include?(automation) && visual_automation == true %>
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require_relative 'base_spec'
|
@@ -6,10 +6,10 @@ require_relative '../page_objects/pages/login_page'
|
|
6
6
|
require_relative '../page_objects/pages/app_page'
|
7
7
|
|
8
8
|
describe 'Login Page' do
|
9
|
-
let(:app_page) { AppPage.new(
|
10
|
-
let(:login_page) { LoginPage.new(
|
9
|
+
let(:app_page) { AppPage.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
|
10
|
+
let(:login_page) { LoginPage.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
|
11
11
|
|
12
|
-
before
|
12
|
+
before do
|
13
13
|
login_page.visit
|
14
14
|
end
|
15
15
|
|
@@ -19,17 +19,16 @@ describe 'Login Page' do
|
|
19
19
|
check_page app_page
|
20
20
|
end
|
21
21
|
end
|
22
|
-
|
23
|
-
<% elsif %w[selenium watir].include? automation -%>
|
22
|
+
<%- elsif %w[selenium watir].include? automation -%>
|
24
23
|
require_relative 'base_spec'
|
25
24
|
require_relative '../page_objects/pages/login_page'
|
26
25
|
|
27
26
|
describe 'Login' do
|
28
27
|
let(:user_name) { 'aguspe' }
|
29
|
-
let(:login_page) { LoginPage.new(<% if automation == 'watir'
|
28
|
+
let(:login_page) { LoginPage.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
|
30
29
|
subject { login_page.header.customer_name }
|
31
30
|
|
32
|
-
before
|
31
|
+
before do
|
33
32
|
login_page.visit
|
34
33
|
login_page.login(user_name, password)
|
35
34
|
end
|
@@ -50,7 +49,7 @@ describe 'Login' do
|
|
50
49
|
end
|
51
50
|
end
|
52
51
|
end
|
53
|
-
|
52
|
+
<%- else -%>
|
54
53
|
require_relative '../page_objects/pages/home_page'
|
55
54
|
require_relative 'base_spec'
|
56
55
|
require_relative '../page_objects/pages/pdp_page'
|
@@ -67,4 +66,4 @@ class PdpSpec < BaseSpec
|
|
67
66
|
end
|
68
67
|
end
|
69
68
|
end
|
70
|
-
|
69
|
+
<%- end -%>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'openai'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module OpenAi
|
5
|
+
class << self
|
6
|
+
def create_client
|
7
|
+
configure_client
|
8
|
+
OpenAI::Client.new
|
9
|
+
end
|
10
|
+
|
11
|
+
def configure_client
|
12
|
+
OpenAI.configure do |config|
|
13
|
+
config.access_token = ENV.fetch('OPENAI_ACCESS_TOKEN')
|
14
|
+
config.organization_id = ENV.fetch('OPENAI_ORGANIZATION_ID', nil)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def input(model = "gpt-3.5-turbo", temperature = 0.7, request)
|
19
|
+
create_client.chat(
|
20
|
+
parameters: {
|
21
|
+
model: model,
|
22
|
+
messages: [{ role: "user", content: request }],
|
23
|
+
temperature: temperature
|
24
|
+
})
|
25
|
+
end
|
26
|
+
|
27
|
+
def create_file(choice = 0, path, request)
|
28
|
+
response = input(request)
|
29
|
+
File.write(path, response.dig("choices", choice, "message", "content"))
|
30
|
+
end
|
31
|
+
|
32
|
+
def output(choice = 0, request)
|
33
|
+
response = input(request)
|
34
|
+
puts response.dig("choices", choice, "message", "content")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
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.
|
5
|
+
s.version = '0.5.0'
|
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,4 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
|
23
23
|
s.add_runtime_dependency 'thor', '~> 1.2.1'
|
24
24
|
s.add_runtime_dependency 'tty-prompt', '~> 0.23.1'
|
25
|
+
s.add_runtime_dependency 'ruby-openai', '~> 3.5'
|
25
26
|
end
|
@@ -36,12 +36,28 @@ describe AutomationGenerator do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
shared_examples 'creates web visual automation files' do |name|
|
40
|
+
it 'creates a login page file' do
|
41
|
+
expect(File).to exist("#{name}/page_objects/pages/login_page.rb")
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'creates an abstract page file' do
|
45
|
+
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'creates an app page file' do
|
49
|
+
expect(File).to exist("#{name}/page_objects/pages/app_page.rb")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
39
53
|
context 'with rspec and selenium' do
|
40
54
|
include_examples 'creates web automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
55
|
+
include_examples 'creates web visual automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
41
56
|
end
|
42
57
|
|
43
58
|
context 'with rspec and watir' do
|
44
59
|
include_examples 'creates web automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
60
|
+
include_examples 'creates web visual automation files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
45
61
|
end
|
46
62
|
|
47
63
|
context 'with cucumber and selenium' do
|
@@ -25,7 +25,7 @@ describe CommonGenerator do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
shared_examples 'creates a capabilities file' do |name|
|
28
|
-
it 'creates a
|
28
|
+
it 'creates a capabilities file' do
|
29
29
|
expect(File).to exist("#{name}/config/capabilities.yml")
|
30
30
|
end
|
31
31
|
end
|
@@ -36,6 +36,12 @@ describe CommonGenerator do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
shared_examples 'creates an options file' do |name|
|
40
|
+
it 'creates an options file' do
|
41
|
+
expect(File).to exist("#{name}/config/options.yml")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
39
45
|
context 'with rspec and selenium' do
|
40
46
|
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
41
47
|
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
@@ -46,6 +52,18 @@ describe CommonGenerator do
|
|
46
52
|
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
47
53
|
end
|
48
54
|
|
55
|
+
context 'with rspec, selenium and applitools' do
|
56
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
57
|
+
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
58
|
+
include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'with rspec, watir and applitools' do
|
62
|
+
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
63
|
+
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
64
|
+
include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
65
|
+
end
|
66
|
+
|
49
67
|
context 'with cucumber and selenium' do
|
50
68
|
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
51
69
|
include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
@@ -44,6 +44,20 @@ describe HelpersGenerator do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
shared_examples 'creates common visual helpers' do |name|
|
48
|
+
it 'does not create an allure helper file' do
|
49
|
+
expect(File).not_to exist("#{name}/helpers/allure_helper.rb")
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'creates a raider file' do
|
53
|
+
expect(File).to exist("#{name}/helpers/raider.rb")
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'creates a visual helper file' do
|
57
|
+
expect(File).to exist("#{name}/helpers/visual_helper.rb")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
47
61
|
context 'with rspec and selenium' do
|
48
62
|
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
49
63
|
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
|
@@ -56,6 +70,18 @@ describe HelpersGenerator do
|
|
56
70
|
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}"
|
57
71
|
end
|
58
72
|
|
73
|
+
context 'with rspec, selenium and applitools' do
|
74
|
+
include_examples 'creates common visual helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
75
|
+
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
76
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
|
77
|
+
end
|
78
|
+
|
79
|
+
context 'with rspec, watir and applitools' do
|
80
|
+
include_examples 'creates common visual helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
81
|
+
include_examples 'creates watir helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
82
|
+
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
|
83
|
+
end
|
84
|
+
|
59
85
|
context 'with cucumber and selenium' do
|
60
86
|
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
61
87
|
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
|
data/spec/spec_helper.rb
CHANGED
@@ -12,13 +12,17 @@ RSpec.configure do |config|
|
|
12
12
|
FRAMEWORKS.each do |framework|
|
13
13
|
AUTOMATION_TYPES.each do |automation|
|
14
14
|
MenuGenerator.new("#{framework}_#{automation}").generate_framework(automation, framework, false)
|
15
|
+
MenuGenerator.new("#{framework}_#{automation}_visual").generate_framework(automation, framework, true)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
20
|
config.after(:all) do
|
20
21
|
FRAMEWORKS.each do |framework|
|
21
|
-
AUTOMATION_TYPES.each
|
22
|
+
AUTOMATION_TYPES.each do |automation|
|
23
|
+
FileUtils.rm_rf("#{framework}_#{automation}")
|
24
|
+
FileUtils.rm_rf("#{framework}_#{automation}_visual")
|
25
|
+
end
|
22
26
|
end
|
23
27
|
end
|
24
28
|
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.5.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:
|
11
|
+
date: 2023-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 0.23.1
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: ruby-openai
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '3.5'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '3.5'
|
125
139
|
description: This gem has everything you need to start working with test automation
|
126
140
|
email: agustin.pe94@gmail.com
|
127
141
|
executables:
|
@@ -217,6 +231,7 @@ files:
|
|
217
231
|
- lib/scaffolding/templates/helper.tt
|
218
232
|
- lib/scaffolding/templates/page_object.tt
|
219
233
|
- lib/scaffolding/templates/spec.tt
|
234
|
+
- lib/utilities/open_ai.rb
|
220
235
|
- lib/utilities/utilities.rb
|
221
236
|
- ruby_raider.gemspec
|
222
237
|
- spec/automation_generator_spec.rb
|
@@ -245,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
260
|
- !ruby/object:Gem::Version
|
246
261
|
version: '0'
|
247
262
|
requirements: []
|
248
|
-
rubygems_version: 3.3.
|
263
|
+
rubygems_version: 3.3.7
|
249
264
|
signing_key:
|
250
265
|
specification_version: 4
|
251
266
|
summary: A gem to make setup and start of UI automation projects easier
|