ruby_raider 0.6.8 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/automation/automation_examples_generator.rb +0 -7
- data/lib/generators/automation/automation_generator.rb +0 -1
- data/lib/generators/automation/templates/login_page.tt +1 -3
- data/lib/generators/rspec/templates/spec.tt +11 -7
- data/lib/generators/templates/common/gemfile.tt +3 -3
- data/lib/generators/templates/common/partials/web_config.tt +1 -4
- data/lib/ruby_raider.rb +1 -3
- data/ruby_raider.gemspec +2 -2
- data/spec/automation_generator_spec.rb +0 -4
- data/spec/open_ai_commands_spec.rb +37 -37
- metadata +4 -6
- data/lib/generators/automation/templates/app_page.tt +0 -13
- data/lib/generators/automation/templates/partials/visual_login.tt +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb170c4c6622158ba4088d25feebd10507348502651317c347c12700a548dbb6
|
4
|
+
data.tar.gz: ea3cc03c9fb1be421f8e984af79a4d91c42f98882e002047f1d55cda8252f2eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4342e7ae85754d140bf5831cedf1e2403154ff5be7805ff06c346bc68ba91d0c63f6e1ee4a904ab6b2bbc31b32b3676f4cdaa58b0a69515fe6013f1708d7e628
|
7
|
+
data.tar.gz: 4c44dd2157bfbe3d38cf0e353a9a78639ef98c2baaa8469f2d10ec756dc313bc4c98fed5a5ccc23bef8e583c6faf8da3a66f52b049efba5f9d5ee25abee837ea
|
@@ -7,9 +7,6 @@ class AutomationExamplesGenerator < Generator
|
|
7
7
|
if mobile_platform?
|
8
8
|
generate_home_page
|
9
9
|
generate_pdp_page
|
10
|
-
elsif visual_selected?
|
11
|
-
generate_login_page
|
12
|
-
generate_app_page
|
13
10
|
else
|
14
11
|
generate_model_factory
|
15
12
|
generate_model_data
|
@@ -36,10 +33,6 @@ class AutomationExamplesGenerator < Generator
|
|
36
33
|
template('component.tt', "#{name}/page_objects/components/header_component.rb")
|
37
34
|
end
|
38
35
|
|
39
|
-
def generate_app_page
|
40
|
-
template('app_page.tt', "#{name}/page_objects/pages/app_page.rb")
|
41
|
-
end
|
42
|
-
|
43
36
|
def generate_model_factory
|
44
37
|
template('factory.tt', "#{name}/models/model_factory.rb")
|
45
38
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
<% if
|
2
|
-
<%= ERB.new(File.read(File.expand_path('./partials/visual_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
3
|
-
<% elsif automation == 'selenium' %>
|
1
|
+
<% if automation == 'selenium' %>
|
4
2
|
<%= ERB.new(File.read(File.expand_path('./partials/selenium_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
5
3
|
<% elsif automation == 'watir' %>
|
6
4
|
<%= ERB.new(File.read(File.expand_path('./partials/watir_login.tt', __dir__)), trim_mode: '-').result(binding) %>
|
@@ -2,21 +2,25 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require_relative 'base_spec'
|
5
|
+
require_relative '../models/model_factory'
|
5
6
|
require_relative '../page_objects/pages/login_page'
|
6
|
-
require_relative '../page_objects/pages/app_page'
|
7
7
|
|
8
|
-
describe 'Login
|
9
|
-
|
8
|
+
describe 'Login' do
|
9
|
+
subject(:header) { login_page.header.customer_name }
|
10
|
+
|
11
|
+
let(:user) { ModelFactory.for('users')['registered user'] }
|
10
12
|
let(:login_page) { LoginPage.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
|
11
13
|
|
12
14
|
before do
|
13
15
|
login_page.visit
|
14
16
|
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
context 'with right credentials' do
|
19
|
+
let(:password) { user['password'] }
|
20
|
+
|
21
|
+
it 'cannot see unexpected changes on the login page' do
|
22
|
+
check_page login_page
|
23
|
+
end
|
20
24
|
end
|
21
25
|
end
|
22
26
|
<%- elsif %w[selenium watir].include? automation -%>
|
@@ -9,8 +9,8 @@ gem 'allure-ruby-commons'
|
|
9
9
|
gem 'allure-cucumber'
|
10
10
|
<% end -%>
|
11
11
|
<% if visual_automation -%>
|
12
|
-
gem 'eyes_selenium'
|
13
|
-
gem 'eyes_universal'
|
12
|
+
gem 'eyes_selenium', '~> 4.6', '>= 4.6.1'
|
13
|
+
gem 'eyes_universal', '~> 3.3', '>= 3.3.1'
|
14
14
|
<% end -%>
|
15
15
|
<% unless visual_automation -%>
|
16
16
|
gem 'parallel_split_test'
|
@@ -26,7 +26,7 @@ gem 'rubocop'
|
|
26
26
|
<% if framework == 'rspec' -%>
|
27
27
|
gem 'rubocop-rspec'
|
28
28
|
<% end -%>
|
29
|
-
gem 'ruby_raider', '~> 0.
|
29
|
+
gem 'ruby_raider', '~> 0.7.0'
|
30
30
|
<%= ERB.new(File.read(File.expand_path('./partials/automation_gems.tt', __dir__))).result(binding).strip! %>
|
31
31
|
<% if %w[selenium watir].include? automation -%>
|
32
32
|
gem 'webdrivers'
|
data/lib/ruby_raider.rb
CHANGED
@@ -26,9 +26,7 @@ module RubyRaider
|
|
26
26
|
desc 'version', 'It shows the version of Ruby Raider you are currently using'
|
27
27
|
|
28
28
|
def version
|
29
|
-
|
30
|
-
version = spec.version
|
31
|
-
puts "The Ruby Raider version is #{version}, Happy testing!"
|
29
|
+
puts 'The Ruby Raider version is 0.7.0, Happy testing!'
|
32
30
|
end
|
33
31
|
|
34
32
|
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.
|
5
|
+
s.version = '0.7.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']
|
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_development_dependency 'rubocop-performance', '~> 1.15.0'
|
22
22
|
s.add_development_dependency 'rubocop-rspec', '~> 2.9.0'
|
23
23
|
|
24
|
-
s.add_runtime_dependency 'faraday', '~> 2.
|
24
|
+
s.add_runtime_dependency 'faraday', '~> 1.2.0'
|
25
25
|
s.add_runtime_dependency 'glimmer-dsl-libui', '~> 0.7.3'
|
26
26
|
s.add_runtime_dependency 'ruby-openai', '~> 3.5'
|
27
27
|
s.add_runtime_dependency 'thor', '~> 1.2.1'
|
@@ -76,10 +76,6 @@ describe AutomationGenerator do
|
|
76
76
|
it 'creates an abstract page file' do
|
77
77
|
expect(File).to exist("#{name}/page_objects/abstract/abstract_page.rb")
|
78
78
|
end
|
79
|
-
|
80
|
-
it 'creates an app page file' do
|
81
|
-
expect(File).to exist("#{name}/page_objects/pages/app_page.rb")
|
82
|
-
end
|
83
79
|
end
|
84
80
|
|
85
81
|
shared_examples 'creates web visual framework without example files' do |name|
|
@@ -1,37 +1,37 @@
|
|
1
|
-
require 'dotenv'
|
2
|
-
require 'fileutils'
|
3
|
-
require 'pathname'
|
4
|
-
require 'yaml'
|
5
|
-
require_relative '../lib/generators/common_generator'
|
6
|
-
require_relative '../lib/commands/open_ai_commands'
|
7
|
-
require_relative '../lib/scaffolding/scaffolding'
|
8
|
-
require_relative 'spec_helper'
|
9
|
-
|
10
|
-
describe OpenAiCommands do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
1
|
+
# require 'dotenv'
|
2
|
+
# require 'fileutils'
|
3
|
+
# require 'pathname'
|
4
|
+
# require 'yaml'
|
5
|
+
# require_relative '../lib/generators/common_generator'
|
6
|
+
# require_relative '../lib/commands/open_ai_commands'
|
7
|
+
# require_relative '../lib/scaffolding/scaffolding'
|
8
|
+
# require_relative 'spec_helper'
|
9
|
+
#
|
10
|
+
# describe OpenAiCommands do
|
11
|
+
# let(:open_ai) { described_class }
|
12
|
+
# let(:name) { 'test' }
|
13
|
+
#
|
14
|
+
# orig_dir = Dir.pwd
|
15
|
+
# Dotenv.load
|
16
|
+
#
|
17
|
+
# after do
|
18
|
+
# Dir.chdir orig_dir
|
19
|
+
# end
|
20
|
+
#
|
21
|
+
# context 'without any project' do
|
22
|
+
# after do
|
23
|
+
# FileUtils.rm_rf('joke.txt')
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# # TODO: Enable test once the paid account is setup
|
27
|
+
# # it 'creates a file using open ai' do
|
28
|
+
# # open_ai.new.invoke(:make, nil, ['tell me a joke', '--path', 'joke.txt'])
|
29
|
+
# # expect(File).to be_size('joke.txt')
|
30
|
+
# # end
|
31
|
+
#
|
32
|
+
# # it 'edits an existing file using open ai' do
|
33
|
+
# # FileUtils.touch('joke.txt')
|
34
|
+
# # open_ai.new.invoke(:make, nil, ['tell me a better joke', '--edit', 'joke.txt'])
|
35
|
+
# # end
|
36
|
+
# end
|
37
|
+
# 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.7.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: 2023-
|
11
|
+
date: 2023-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 1.2.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 1.2.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: glimmer-dsl-libui
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -212,7 +212,6 @@ files:
|
|
212
212
|
- lib/generators/automation/automation_generator.rb
|
213
213
|
- lib/generators/automation/templates/abstract_component.tt
|
214
214
|
- lib/generators/automation/templates/abstract_page.tt
|
215
|
-
- lib/generators/automation/templates/app_page.tt
|
216
215
|
- lib/generators/automation/templates/appium_caps.tt
|
217
216
|
- lib/generators/automation/templates/component.tt
|
218
217
|
- lib/generators/automation/templates/home_page.tt
|
@@ -228,7 +227,6 @@ files:
|
|
228
227
|
- lib/generators/automation/templates/partials/selenium_login.tt
|
229
228
|
- lib/generators/automation/templates/partials/url_methods.tt
|
230
229
|
- lib/generators/automation/templates/partials/visit_method.tt
|
231
|
-
- lib/generators/automation/templates/partials/visual_login.tt
|
232
230
|
- lib/generators/automation/templates/partials/watir_login.tt
|
233
231
|
- lib/generators/automation/templates/pdp_page.tt
|
234
232
|
- lib/generators/automation/templates/visual_options.tt
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../abstract/abstract_page'
|
4
|
-
|
5
|
-
class LoginPage < AbstractPage
|
6
|
-
<%- if automation == 'selenium' -%>
|
7
|
-
using Raider::SeleniumHelper
|
8
|
-
<%- end -%>
|
9
|
-
|
10
|
-
def url(_page)
|
11
|
-
'index.html'
|
12
|
-
end
|
13
|
-
|
14
|
-
# Actions
|
15
|
-
|
16
|
-
def login
|
17
|
-
<%- if automation == 'watir' -%>
|
18
|
-
login_button.click
|
19
|
-
<%- else -%>
|
20
|
-
login_button.click_when_present
|
21
|
-
<%- end -%>
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
# Elements
|
27
|
-
|
28
|
-
def login_button
|
29
|
-
<%- if automation == 'watir' -%>
|
30
|
-
browser.element(id: 'log-in')
|
31
|
-
<%- else -%>
|
32
|
-
driver.find_element(:id, 'log-in')
|
33
|
-
<%- end -%>
|
34
|
-
end
|
35
|
-
end
|