ruby_raider 0.2.2 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +8 -1
  3. data/bin/raider +1 -1
  4. data/lib/generators/automation_generator.rb +26 -28
  5. data/lib/generators/common_generator.rb +25 -26
  6. data/lib/generators/cucumber_generator.rb +10 -11
  7. data/lib/generators/generator.rb +8 -9
  8. data/lib/generators/helper_generator.rb +21 -31
  9. data/lib/generators/menu_generator.rb +50 -52
  10. data/lib/generators/rspec_generator.rb +7 -8
  11. data/lib/generators/templates/automation/abstract_page.tt +4 -6
  12. data/lib/generators/templates/automation/appium_settings.tt +1 -1
  13. data/lib/generators/templates/automation/confirmation_page.tt +2 -2
  14. data/lib/generators/templates/automation/home_page.tt +2 -2
  15. data/lib/generators/templates/automation/login_page.tt +4 -4
  16. data/lib/generators/templates/automation/partials/appium_login.tt +3 -3
  17. data/lib/generators/templates/automation/partials/element.tt +5 -5
  18. data/lib/generators/templates/automation/partials/initialize_selector.tt +9 -0
  19. data/lib/generators/templates/automation/partials/selenium_login.tt +4 -4
  20. data/lib/generators/templates/automation/partials/visit_method.tt +1 -5
  21. data/lib/generators/templates/automation/partials/watir_login.tt +7 -9
  22. data/lib/generators/templates/common/gemfile.tt +7 -6
  23. data/lib/generators/templates/cucumber/env.tt +4 -4
  24. data/lib/generators/templates/cucumber/partials/appium_env.tt +4 -4
  25. data/lib/generators/templates/cucumber/partials/mobile_steps.tt +6 -3
  26. data/lib/generators/templates/cucumber/partials/selenium_appium_env.tt +3 -5
  27. data/lib/generators/templates/cucumber/partials/watir_env.tt +3 -4
  28. data/lib/generators/templates/cucumber/partials/web_steps.tt +4 -3
  29. data/lib/generators/templates/cucumber/steps.tt +3 -3
  30. data/lib/generators/templates/helpers/allure_helper.tt +1 -1
  31. data/lib/generators/templates/helpers/driver_helper.tt +3 -3
  32. data/lib/generators/templates/helpers/partials/require_automation.tt +0 -2
  33. data/lib/generators/templates/helpers/partials/screenshot.tt +3 -3
  34. data/lib/generators/templates/helpers/partials/select_driver.tt +8 -0
  35. data/lib/generators/templates/helpers/raider_helper.tt +5 -6
  36. data/lib/generators/templates/helpers/spec_helper.tt +4 -11
  37. data/lib/generators/templates/rspec/spec.tt +34 -18
  38. data/lib/ruby_raider.rb +37 -8
  39. data/lib/scaffolding/scaffolding.rb +23 -0
  40. data/lib/scaffolding/templates/feature.tt +6 -0
  41. data/lib/scaffolding/templates/page_object.tt +12 -0
  42. data/lib/scaffolding/templates/spec.tt +5 -0
  43. data/lib/utilities/utilities.rb +17 -0
  44. data/ruby_raider.gemspec +2 -2
  45. data/spec/cucumber_generator_spec.rb +8 -0
  46. data/spec/helpers_generator_spec.rb +8 -16
  47. metadata +10 -8
  48. data/lib/generators/templates/automation/partials/driver_selector.tt +0 -9
  49. data/lib/generators/templates/helpers/partials/driver_requirements.tt +0 -14
  50. data/lib/generators/templates/helpers/pom_helper.tt +0 -19
  51. data/lib/generators/templates/helpers/watir_helper.tt +0 -16
@@ -3,17 +3,18 @@ source 'https://rubygems.org'
3
3
  gem 'activesupport'
4
4
  gem 'allure-rspec'
5
5
  gem 'allure-ruby-commons'
6
- <% if framework == 'cucumber' %>
6
+ <% if framework == 'cucumber' -%>
7
7
  gem 'allure-cucumber'
8
- <% end %>
8
+ <% end -%>
9
9
  gem 'parallel_split_test'
10
10
  gem 'parallel_tests'
11
11
  gem 'rake'
12
12
  gem '<%= framework %>'
13
- <% if framework == 'cucumber' %>
13
+ <% if framework == 'cucumber' -%>
14
14
  gem 'rspec'
15
- <% end %>
15
+ gem 'ruby_raider'
16
+ <% end -%>
16
17
  <%= ERB.new(File.read(File.expand_path('./partials/automation_gems.tt', __dir__))).result(binding).strip! %>
17
- <% if %w[selenium watir].include? automation %>
18
+ <% if %w[selenium watir].include? automation -%>
18
19
  gem 'webdrivers'
19
- <% end %>
20
+ <% end -%>
@@ -1,8 +1,8 @@
1
1
  <% case automation
2
- when 'selenium' %>
2
+ when 'selenium' -%>
3
3
  <%= ERB.new(File.read(File.expand_path('./partials/selenium_appium_env.tt', __dir__))).result(binding).strip! -%>
4
- <% when 'watir' %>
4
+ <% when 'watir' -%>
5
5
  <%= ERB.new(File.read(File.expand_path('./partials/watir_env.tt', __dir__))).result(binding).strip! -%>
6
- <% else %>
6
+ <% else -%>
7
7
  <%= ERB.new(File.read(File.expand_path('./partials/appium_env.tt', __dir__))).result(binding).strip! -%>
8
- <% end %>
8
+ <% end -%>
@@ -2,12 +2,12 @@ require_relative '../../helpers/driver_helper'
2
2
 
3
3
  Before do
4
4
  Raider::AllureHelper.configure
5
- Raider::DriverHelper.new_driver
6
- Raider::DriverHelper.driver.start_driver
5
+ @driver = Raider::DriverHelper.new_driver
6
+ @driver.start_driver
7
7
  end
8
8
 
9
9
  After do |scenario|
10
- Raider::DriverHelper.driver.screenshot("allure-results/screenshots/#{scenario.name}.png")
10
+ @driver.screenshot("allure-results/screenshots/#{scenario.name}.png")
11
11
  Raider::AllureHelper.add_screenshot(scenario.name)
12
- Raider::DriverHelper.driver.quit_driver
12
+ @driver.quit_driver
13
13
  end
@@ -5,13 +5,16 @@ require_relative '../../page_objects/pages/home_page'
5
5
  require_relative '../../page_objects/pages/login_page'
6
6
 
7
7
  Given("I'm a registered user on the login page") do
8
- HomePage.go_to_login
8
+ home_page = HomePage.new(@driver)
9
+ home_page.go_to_login
9
10
  end
10
11
 
11
12
  When('I login with my credentials') do
12
- LoginPage.login('alice', 'mypassword')
13
+ login_page = LoginPage.new(@driver)
14
+ login_page.login('alice', 'mypassword')
13
15
  end
14
16
 
15
17
  When('I can see the main page') do
16
- expect(ConfirmationPage.login_message).to eq 'You are logged in as alice'
18
+ confirmation_page = ConfirmationPage.new(@driver)
19
+ expect(confirmation_page.login_message).to eq 'You are logged in as alice'
17
20
  end
@@ -1,13 +1,11 @@
1
1
  require_relative '../../helpers/driver_helper'
2
2
 
3
3
  Before do
4
- Raider::AllureHelper.configure
5
- Raider::DriverHelper.new_driver
4
+ @driver = Raider::DriverHelper.new_driver
6
5
  end
7
6
 
8
7
  After do |scenario|
9
- driver = Raider::DriverHelper.driver
10
- driver.save_screenshot("allure-results/screenshots/#{scenario.name}.png")
8
+ @driver.save_screenshot("allure-results/screenshots/#{scenario.name}.png")
11
9
  Raider::AllureHelper.add_screenshot(scenario.name)
12
- driver.quit
10
+ @driver.quit
13
11
  end
@@ -2,12 +2,11 @@ require_relative '../../helpers/browser_helper'
2
2
 
3
3
  Before do
4
4
  Raider::AllureHelper.configure
5
- Raider::BrowserHelper.new_browser
5
+ @browser = Raider::BrowserHelper.new_browser
6
6
  end
7
7
 
8
8
  After do |scenario|
9
- browser = Raider::BrowserHelper.browser
10
- browser.screenshot.save("allure-results/screenshots/#{scenario.name}.png")
9
+ @browser.screenshot.save("allure-results/screenshots/#{scenario.name}.png")
11
10
  Raider::AllureHelper.add_screenshot(scenario.name)
12
- browser.quit
11
+ @browser.quit
13
12
  end
@@ -3,13 +3,14 @@
3
3
  require_relative '../../page_objects/pages/login_page'
4
4
 
5
5
  Given("I'm a registered user on the login page") do
6
- LoginPage.visit
6
+ @login_page = LoginPage.new(<% if automation == 'watir'%>@browser<% else %>@driver<% end %>)
7
+ @login_page.visit
7
8
  end
8
9
 
9
10
  When('I login with my credentials') do
10
- LoginPage.login('aguspe', '12341234')
11
+ @login_page.login('aguspe', '12341234')
11
12
  end
12
13
 
13
14
  When('I can see the main page') do
14
- expect(LoginPage.header.customer_name).to eq 'Welcome back Agustin'
15
+ expect(@login_page.header.customer_name).to eq 'Welcome back Agustin'
15
16
  end
@@ -1,5 +1,5 @@
1
- <% if %w[selenium watir].include? automation %>
1
+ <% if %w[selenium watir].include? automation -%>
2
2
  <%= ERB.new(File.read(File.expand_path('./partials/web_steps.tt', __dir__))).result(binding).strip! -%>
3
- <% else %>
3
+ <% else -%>
4
4
  <%= ERB.new(File.read(File.expand_path('./partials/mobile_steps.tt', __dir__))).result(binding).strip! -%>
5
- <% end %>
5
+ <% end -%>
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- <%= ERB.new(File.read(File.expand_path('./partials/allure_requirements.tt', __dir__))).result(binding).strip! %>
3
+ <%= ERB.new(File.read(File.expand_path('./partials/allure_requirements.tt', __dir__))).result(binding).strip! -%>
4
4
  <% allure = ERB.new(File.read(File.expand_path('./partials/allure_imports.tt', __dir__))).result(binding).strip! %>
5
5
 
6
6
  module Raider
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- <% if automation == 'selenium' %>
3
+ <% if automation == 'selenium' -%>
4
4
  require 'webdrivers'
5
- <% else %>
5
+ <% else -%>
6
6
  require 'appium_lib'
7
- <% end %>
7
+ <% end -%>
8
8
  require_relative 'driver_helper'
9
9
 
10
10
  module Raider
@@ -1,5 +1,3 @@
1
1
  <% if automation == 'selenium' %>
2
2
  require_relative 'selenium_helper'
3
- <% elsif automation == 'watir' %>
4
- require_relative 'watir_helper'
5
3
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <% case automation
2
2
  when 'selenium' %>
3
- driver.save_screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
3
+ @driver.save_screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
4
4
  <% when 'watir' %>
5
- browser.save_screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
5
+ @browser.save_screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
6
6
  <% else %>
7
- driver.screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
7
+ @driver.screenshot("allure-results/screenshots/#{example_name}.png") if status == :failed
8
8
  <% end %>
@@ -0,0 +1,8 @@
1
+ <% if automation == 'watir' %>
2
+ @browser = BrowserHelper.new_browser
3
+ <% else %>
4
+ @driver = DriverHelper.new_driver
5
+ <% end %>
6
+ <% if %w[appium_ios].include? automation %>
7
+ @driver.start_driver
8
+ <% end %>
@@ -1,15 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Raider
4
- <% if framework == 'rspec' %>
4
+ <% if framework == 'rspec' -%>
5
5
  require_relative 'spec_helper'
6
- <% end %>
6
+ <% end -%>
7
7
  <%= ERB.new(File.read(File.expand_path('./partials/require_automation.tt', __dir__))).result(binding).strip! %>
8
- require_relative 'pom_helper'
9
- <% if automation == 'watir' %>
8
+ <% if automation == 'watir' -%>
10
9
  require_relative 'browser_helper'
11
- <% else %>
10
+ <% else -%>
12
11
  require_relative 'driver_helper'
13
- <% end %>
12
+ <% end -%>
14
13
  require_relative 'allure_helper'
15
14
  end
@@ -2,11 +2,11 @@
2
2
 
3
3
  require 'rspec'
4
4
  require_relative 'allure_helper'
5
- <% if automation == 'watir' %>
5
+ <% if automation == 'watir' -%>
6
6
  require_relative 'browser_helper'
7
- <% else %>
7
+ <% else -%>
8
8
  require_relative 'driver_helper'
9
- <% end %>
9
+ <% end -%>
10
10
 
11
11
  module Raider
12
12
  module SpecHelper
@@ -15,14 +15,7 @@ module Raider
15
15
  RSpec.configure do |config|
16
16
  config.formatter = AllureHelper.formatter
17
17
  config.before(:each) do
18
- <% if automation == 'watir' %>
19
- BrowserHelper.new_browser
20
- <% else %>
21
- DriverHelper.new_driver
22
- <% end %>
23
- <% if %w[appium_ios].include? automation %>
24
- DriverHelper.driver.start_driver
25
- <% end %>
18
+ <%= ERB.new(File.read(File.expand_path('./partials/select_driver.tt', __dir__))).result(binding).strip! %>
26
19
  end
27
20
 
28
21
  config.after(:each) do
@@ -1,25 +1,34 @@
1
- <% if %w[selenium watir].include? automation %>
1
+ <% if %w[selenium watir].include? automation -%>
2
2
  require_relative 'base_spec'
3
3
  require_relative '../page_objects/pages/login_page'
4
4
 
5
- class LoginSpec < BaseSpec
6
- describe 'Login' do
7
- before(:each) do
8
- LoginPage.visit
9
- end
5
+ describe 'Login' do
6
+ let(:user_name) { 'aguspe' }
7
+ let(:login_page) { LoginPage.new(<% if automation == 'watir' -%>@browser<% else -%>@driver<% end -%>) }
8
+ subject { login_page.header.customer_name }
9
+
10
+ before(:example) do
11
+ login_page.visit
12
+ login_page.login(user_name, password)
13
+ end
10
14
 
11
- it 'can login with valid credentials' do
12
- LoginPage.login('aguspe', '12341234')
13
- expect(LoginPage.header.customer_name).to eq 'Welcome back Agustin'
15
+ context 'with right credentials' do
16
+ let(:password) { '12341234' }
17
+
18
+ it 'can successfully log in' do
19
+ expect(subject).to eq 'Welcome back Agustin'
14
20
  end
21
+ end
22
+
23
+ context 'with wrong credentials' do
24
+ let(:password) { 'wrongPassword' }
15
25
 
16
- it 'cannot login with wrong credentials' do
17
- LoginPage.login('aguspe', 'wrongPassword')
18
- expect(LoginPage.header.customer_name).to be_empty
26
+ it 'it cannot login in' do
27
+ expect(subject).to be_empty
19
28
  end
20
29
  end
21
30
  end
22
- <% else %>
31
+ <% else -%>
23
32
  require_relative '../page_objects/pages/confirmation_page'
24
33
  require_relative '../page_objects/pages/home_page'
25
34
  require_relative 'base_spec'
@@ -27,11 +36,18 @@ require_relative '../page_objects/pages/login_page'
27
36
 
28
37
  class LoginSpec < BaseSpec
29
38
  describe 'Login' do
30
- it 'Login with valid credentials' do
31
- HomePage.go_to_login
32
- LoginPage.login('alice', 'mypassword')
33
- expect(ConfirmationPage.login_message).to eq 'You are logged in as alice'
39
+
40
+ let(:user_name) { 'alice' }
41
+ let(:password) { 'mypassword' }
42
+ let(:login_page) { LoginPage.new(@driver) }
43
+ let(:home_page) { HomePage.new(@driver) }
44
+ let(:confirmation_page) { ConfirmationPage.new(@driver) }
45
+
46
+ it 'can login' do
47
+ home_page.go_to_login
48
+ login_page.login(user_name, password)
49
+ expect(confirmation_page.login_message).to eq 'You are logged in as alice'
34
50
  end
35
51
  end
36
52
  end
37
- <% end %>
53
+ <% end -%>
data/lib/ruby_raider.rb CHANGED
@@ -1,12 +1,41 @@
1
- # frozen_string_literal: true
2
-
1
+ require 'thor'
3
2
  require_relative 'generators/menu_generator'
3
+ require_relative '../lib/scaffolding/scaffolding'
4
+ require_relative '../lib/utilities/utilities'
4
5
 
5
- # Main module to load all the generators
6
- module RubyRaider
7
- module_function
8
-
9
- def generate_project(project_name)
6
+ class RubyRaider < Thor
7
+ desc "new [PROJECT_NAME]", "Creates a new framework based on settings picked"
8
+ def new(project_name)
10
9
  MenuGenerator.generate_choice_menu(project_name)
11
10
  end
12
- end
11
+
12
+ desc "page [PAGE_NAME]", "Creates a new page object"
13
+ def page(name)
14
+ Scaffolding.new([name]).generate_class
15
+ end
16
+
17
+ desc "feature [FEATURE_NAME]", "Creates a new feature"
18
+ def feature(name)
19
+ Scaffolding.new([name]).generate_feature
20
+ end
21
+
22
+ desc "spec [SPEC_NAME]", "Creates a new spec"
23
+ def spec(name)
24
+ Scaffolding.new([name]).generate_spec
25
+ end
26
+
27
+ desc "path [PATH]", "Sets the default path for scaffolding"
28
+ def path(default_path)
29
+ Utilities.path = default_path
30
+ end
31
+
32
+ desc "url [URL]", "Sets the default url for a project"
33
+ def url(default_url)
34
+ Utilities.url = default_url
35
+ end
36
+
37
+ desc "browser [BROWSER]", "Sets the default browser for a project"
38
+ def browser(default_browser)
39
+ Utilities.browser = default_browser
40
+ end
41
+ end
@@ -0,0 +1,23 @@
1
+ require 'thor'
2
+
3
+ class Scaffolding < Thor::Group
4
+ include Thor::Actions
5
+
6
+ argument :name
7
+
8
+ def self.source_root
9
+ File.dirname(__FILE__) + '/templates'
10
+ end
11
+
12
+ def generate_class
13
+ template('page_object.tt', "page_objects/pages/#{name}_page.rb")
14
+ end
15
+
16
+ def generate_feature
17
+ template('feature.tt', "features/#{name}.feature")
18
+ end
19
+
20
+ def generate_spec
21
+ template('spec.tt', "./spec/#{name}_page.rb")
22
+ end
23
+ end
@@ -0,0 +1,6 @@
1
+ Feature: <%= name %>
2
+
3
+ Scenario: Scenario name
4
+ Given I am
5
+ When I do
6
+ Then I see
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../abstract/abstract_page'
4
+
5
+ class <%= name.split('_').map {|word| word.capitalize }.join + 'Page' %> < AbstractPage
6
+
7
+ #Actions
8
+
9
+ private
10
+
11
+ # Elements
12
+ end
@@ -0,0 +1,5 @@
1
+ require_relative 'base_spec'
2
+ require_relative '../page_objects/pages/<%= name %>_page'
3
+
4
+ describe <%= name.split('_').map {|word| word.capitalize }.join + 'Page' %> do
5
+ end
@@ -0,0 +1,17 @@
1
+ require 'thor'
2
+
3
+ class Utilities < Thor::Group
4
+ include Thor::Actions
5
+
6
+ def browser=(browser)
7
+
8
+ end
9
+
10
+ def path=(path)
11
+
12
+ end
13
+
14
+ def url=(url)
15
+
16
+ end
17
+ end
data/ruby_raider.gemspec CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ruby_raider'
5
- s.version = '0.2.2'
5
+ s.version = '0.2.5'
6
6
  s.summary = 'A gem to make setup and start of UI automation projects easier'
7
- s.description = 'This gem contents everything you need to start doing web automation in one simple package'
7
+ s.description = 'This gem has everything you need to start working with test automation'
8
8
  s.authors = ['Agustin Pequeno']
9
9
  s.email = 'agustin.pe94@gmail.com'
10
10
  s.homepage = 'http://github.com/aguspe/ruby_raider'
@@ -22,6 +22,10 @@ describe RubyRaider::CucumberGenerator do
22
22
  expect(File.exist?("#{@name}/features/support/env.rb")).to be_truthy
23
23
  end
24
24
 
25
+ it 'does not create a spec file' do
26
+ expect(File.exist?("#{@name}/spec/login_spec.rb")).to be_falsey
27
+ end
28
+
25
29
  after(:all) do
26
30
  FileUtils.rm_rf(@name)
27
31
  end
@@ -44,6 +48,10 @@ describe RubyRaider::CucumberGenerator do
44
48
  it 'creates an env file' do
45
49
  expect(File.exist?("#{@name}/features/support/env.rb")).to be_truthy
46
50
  end
51
+
52
+ after(:all) do
53
+ FileUtils.rm_rf(@name)
54
+ end
47
55
  end
48
56
 
49
57
  context 'with appium' do
@@ -14,10 +14,6 @@ describe RubyRaider::HelpersGenerator do
14
14
  expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
15
15
  end
16
16
 
17
- it 'creates a pom helper file' do
18
- expect(File.exist?("#{@name}/helpers/pom_helper.rb")).to be_truthy
19
- end
20
-
21
17
  it 'creates an allure helper file' do
22
18
  expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
23
19
  end
@@ -45,10 +41,6 @@ describe RubyRaider::HelpersGenerator do
45
41
  expect(File.exist?("#{@name}/helpers/browser_helper.rb")).to be_truthy
46
42
  end
47
43
 
48
- it 'creates a pom helper file' do
49
- expect(File.exist?("#{@name}/helpers/pom_helper.rb")).to be_truthy
50
- end
51
-
52
44
  it 'creates a raider file' do
53
45
  expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
54
46
  end
@@ -72,10 +64,6 @@ describe RubyRaider::HelpersGenerator do
72
64
  expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
73
65
  end
74
66
 
75
- it 'creates a pom helper file' do
76
- expect(File.exist?("#{@name}/helpers/pom_helper.rb")).to be_truthy
77
- end
78
-
79
67
  it 'creates an allure helper file' do
80
68
  expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
81
69
  end
@@ -94,10 +82,6 @@ describe RubyRaider::HelpersGenerator do
94
82
  RubyRaider::HelpersGenerator.new(['selenium', 'cucumber', @name]).invoke_all
95
83
  end
96
84
 
97
- it 'creates a pom helper file' do
98
- expect(File.exist?("#{@name}/helpers/pom_helper.rb")).to be_truthy
99
- end
100
-
101
85
  it 'creates an allure helper file' do
102
86
  expect(File.exist?("#{@name}/helpers/allure_helper.rb")).to be_truthy
103
87
  end
@@ -106,6 +90,10 @@ describe RubyRaider::HelpersGenerator do
106
90
  expect(File.exist?("#{@name}/helpers/driver_helper.rb")).to be_truthy
107
91
  end
108
92
 
93
+ it 'does not create a spec helper' do
94
+ expect(File.exist?("#{@name}/helpers/spec_helper.rb")).to be_falsey
95
+ end
96
+
109
97
  after(:all) do
110
98
  FileUtils.rm_rf(@name)
111
99
  end
@@ -125,6 +113,10 @@ describe RubyRaider::HelpersGenerator do
125
113
  expect(File.exist?("#{@name}/helpers/raider.rb")).to be_truthy
126
114
  end
127
115
 
116
+ it 'does not create a spec helper' do
117
+ expect(File.exist?("#{@name}/helpers/spec_helper.rb")).to be_falsey
118
+ end
119
+
128
120
  after(:all) do
129
121
  FileUtils.rm_rf(@name)
130
122
  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.2.2
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-08 00:00:00.000000000 Z
11
+ date: 2022-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -108,8 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.2.1
111
- description: This gem contents everything you need to start doing web automation in
112
- one simple package
111
+ description: This gem has everything you need to start working with test automation
113
112
  email: agustin.pe94@gmail.com
114
113
  executables:
115
114
  - raider
@@ -138,8 +137,8 @@ files:
138
137
  - lib/generators/templates/automation/home_page.tt
139
138
  - lib/generators/templates/automation/login_page.tt
140
139
  - lib/generators/templates/automation/partials/appium_login.tt
141
- - lib/generators/templates/automation/partials/driver_selector.tt
142
140
  - lib/generators/templates/automation/partials/element.tt
141
+ - lib/generators/templates/automation/partials/initialize_selector.tt
143
142
  - lib/generators/templates/automation/partials/require_raider.tt
144
143
  - lib/generators/templates/automation/partials/selenium_login.tt
145
144
  - lib/generators/templates/automation/partials/url_methods.tt
@@ -163,19 +162,22 @@ files:
163
162
  - lib/generators/templates/helpers/driver_helper.tt
164
163
  - lib/generators/templates/helpers/partials/allure_imports.tt
165
164
  - lib/generators/templates/helpers/partials/allure_requirements.tt
166
- - lib/generators/templates/helpers/partials/driver_requirements.tt
167
165
  - lib/generators/templates/helpers/partials/new_driver.tt
168
166
  - lib/generators/templates/helpers/partials/quit_driver.tt
169
167
  - lib/generators/templates/helpers/partials/require_automation.tt
170
168
  - lib/generators/templates/helpers/partials/screenshot.tt
171
- - lib/generators/templates/helpers/pom_helper.tt
169
+ - lib/generators/templates/helpers/partials/select_driver.tt
172
170
  - lib/generators/templates/helpers/raider_helper.tt
173
171
  - lib/generators/templates/helpers/selenium_helper.tt
174
172
  - lib/generators/templates/helpers/spec_helper.tt
175
- - lib/generators/templates/helpers/watir_helper.tt
176
173
  - lib/generators/templates/rspec/base_spec.tt
177
174
  - lib/generators/templates/rspec/spec.tt
178
175
  - lib/ruby_raider.rb
176
+ - lib/scaffolding/scaffolding.rb
177
+ - lib/scaffolding/templates/feature.tt
178
+ - lib/scaffolding/templates/page_object.tt
179
+ - lib/scaffolding/templates/spec.tt
180
+ - lib/utilities/utilities.rb
179
181
  - ruby_raider.gemspec
180
182
  - spec/automation_generator_spec.rb
181
183
  - spec/common_generator_spec.rb
@@ -1,9 +0,0 @@
1
- <% if automation == 'watir' %>
2
- def browser
3
- Raider::BrowserHelper.browser
4
- end
5
- <% else %>
6
- def driver
7
- Raider::DriverHelper.driver
8
- end
9
- <% end %>
@@ -1,14 +0,0 @@
1
- def requirements
2
- case automation
3
- when 'selenium'
4
- require 'selenium-webdriver'
5
- require 'webdrivers'
6
-
7
- when 'watir'
8
-
9
- require 'watir'
10
- require 'webdrivers'
11
- else
12
- "require 'appium_lib'"
13
- end
14
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Raider
4
- module PomHelper
5
- def instance
6
- @instance ||= new
7
- end
8
-
9
- def method_missing(message, *args, &block)
10
- return super unless instance.respond_to?(message)
11
-
12
- instance.public_send(message, *args, &block)
13
- end
14
-
15
- def respond_to_missing?(method, *_args, &block)
16
- instance.respond_to?(method) || super
17
- end
18
- end
19
- end