ruby_raider 0.9.3 → 0.9.5

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/integration.yml +5 -5
  3. data/.github/workflows/selenium.yml +22 -0
  4. data/.github/workflows/watir.yml +22 -0
  5. data/README.md +24 -18
  6. data/lib/generators/automation/templates/account.tt +2 -2
  7. data/lib/generators/automation/templates/appium_caps.tt +2 -2
  8. data/lib/generators/automation/templates/home.tt +3 -2
  9. data/lib/generators/automation/templates/login.tt +2 -2
  10. data/lib/generators/automation/templates/page.tt +4 -4
  11. data/lib/generators/automation/templates/partials/element.tt +1 -1
  12. data/lib/generators/automation/templates/partials/home_page_selector.tt +2 -2
  13. data/lib/generators/automation/templates/partials/initialize_selector.tt +1 -1
  14. data/lib/generators/automation/templates/partials/pdp_page_selector.tt +2 -2
  15. data/lib/generators/automation/templates/partials/selenium_login.tt +1 -1
  16. data/lib/generators/automation/templates/partials/url_methods.tt +1 -1
  17. data/lib/generators/automation/templates/partials/visit_method.tt +2 -2
  18. data/lib/generators/automation/templates/pdp.tt +3 -2
  19. data/lib/generators/cucumber/templates/env.tt +6 -7
  20. data/lib/generators/cucumber/templates/feature.tt +7 -3
  21. data/lib/generators/cucumber/templates/partials/appium_env.tt +1 -4
  22. data/lib/generators/cucumber/templates/partials/driver_world.tt +4 -3
  23. data/lib/generators/cucumber/templates/partials/mobile_steps.tt +7 -7
  24. data/lib/generators/cucumber/templates/partials/selenium_env.tt +6 -6
  25. data/lib/generators/cucumber/templates/partials/watir_env.tt +1 -4
  26. data/lib/generators/cucumber/templates/partials/web_steps.tt +10 -3
  27. data/lib/generators/cucumber/templates/steps.tt +3 -3
  28. data/lib/generators/cucumber/templates/world.tt +1 -1
  29. data/lib/generators/generator.rb +15 -5
  30. data/lib/generators/helper_generator.rb +1 -1
  31. data/lib/generators/invoke_generators.rb +2 -6
  32. data/lib/generators/menu_generator.rb +7 -21
  33. data/lib/generators/rspec/rspec_generator.rb +1 -1
  34. data/lib/generators/rspec/templates/spec.tt +7 -7
  35. data/lib/generators/templates/common/config.tt +1 -1
  36. data/lib/generators/templates/common/gemfile.tt +13 -13
  37. data/lib/generators/templates/common/partials/automation_gems.tt +1 -1
  38. data/lib/generators/templates/common/partials/web_config.tt +1 -1
  39. data/lib/generators/templates/common/read_me.tt +21 -15
  40. data/lib/generators/templates/common/rubocop.tt +1 -1
  41. data/lib/generators/templates/helpers/allure_helper.tt +2 -2
  42. data/lib/generators/templates/helpers/driver_helper.tt +10 -8
  43. data/lib/generators/templates/helpers/partials/allure_imports.tt +1 -1
  44. data/lib/generators/templates/helpers/partials/allure_requirements.tt +1 -1
  45. data/lib/generators/templates/helpers/partials/driver_and_options.tt +3 -3
  46. data/lib/generators/templates/helpers/partials/quit_driver.tt +5 -6
  47. data/lib/generators/templates/helpers/partials/screenshot.tt +6 -7
  48. data/lib/generators/templates/helpers/spec_helper.tt +5 -5
  49. data/lib/utilities/utilities.rb +1 -1
  50. data/lib/version +1 -1
  51. data/spec/integration/commands/scaffolding_commands_spec.rb +1 -1
  52. data/spec/integration/commands/utility_commands_spec.rb +3 -3
  53. data/spec/integration/generators/actions_generator_spec.rb +1 -1
  54. data/spec/integration/generators/automation_generator_spec.rb +4 -4
  55. data/spec/integration/generators/common_generator_spec.rb +13 -20
  56. data/spec/integration/generators/cucumber_generator_spec.rb +2 -2
  57. data/spec/integration/generators/helpers_generator_spec.rb +13 -13
  58. data/spec/integration/generators/rspec_generator_spec.rb +2 -2
  59. data/spec/{support → integration}/settings_helper.rb +1 -3
  60. data/spec/integration/spec_helper.rb +33 -0
  61. data/spec/system/selenium_spec.rb +40 -0
  62. data/spec/system/watir_spec.rb +40 -0
  63. metadata +8 -6
  64. data/.github/workflows/rspec_selenium.yml +0 -42
  65. data/.github/workflows/rspec_watir.yml +0 -42
  66. data/spec/spec_helper.rb +0 -35
@@ -21,14 +21,6 @@ class MenuGenerator
21
21
  end
22
22
  end
23
23
 
24
- def choose_visual_automation
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)
30
- end
31
-
32
24
  def choose_test_framework(automation)
33
25
  return choose_mobile_platform if automation == 'appium'
34
26
 
@@ -39,9 +31,7 @@ class MenuGenerator
39
31
  structure = {
40
32
  automation: options[:automation],
41
33
  framework: options[:framework],
42
- name: @name,
43
- visual: options[:visual_automation],
44
- axe_support: options[:axe_support]
34
+ name: @name
45
35
  }
46
36
  generate_framework(structure)
47
37
  system "cd #{name} && gem install bundler && bundle install"
@@ -66,26 +56,20 @@ class MenuGenerator
66
56
  end
67
57
  end
68
58
 
69
- FrameworkOptions = Struct.new(:automation, :framework, :visual_automation, :axe_support)
59
+ FrameworkOptions = Struct.new(:automation, :framework)
70
60
 
71
61
  def create_framework_options(params)
72
- FrameworkOptions.new(params[:automation], params[:framework], params[:visual_automation], params[:axe_support])
62
+ FrameworkOptions.new(params[:automation], params[:framework])
73
63
  end
74
64
 
75
65
  def create_framework(framework, automation_type)
76
- visual_automation = choose_visual_automation if %w[selenium].include?(automation_type)
77
- axe = choose_axe_support if automation_type == 'selenium' && framework == 'Rspec' && visual_automation == false
78
66
  options = create_framework_options(automation: automation_type,
79
- framework: framework.downcase,
80
- visual_automation:,
81
- axe_support: axe)
67
+ framework: framework.downcase)
82
68
 
83
69
  # Print the chosen options
84
70
  puts 'Chosen Options:'
85
71
  puts " Automation Type: #{options[:automation]}"
86
72
  puts " Framework: #{options[:framework]}"
87
- puts " Visual Automation: #{options[:visual_automation]}"
88
- puts " Axe Support: #{options[:axe_support]}"
89
73
 
90
74
  set_up_framework(options)
91
75
  prompt.say("You have chosen to use #{framework} with #{automation_type}")
@@ -100,9 +84,11 @@ class MenuGenerator
100
84
  end
101
85
 
102
86
  def select_automation_framework(menu)
103
- menu.choice :Appium, -> { choose_test_framework('appium') }
104
87
  menu.choice :Selenium, -> { choose_test_framework('selenium') }
88
+ menu.choice :Appium, -> { choose_test_framework('appium') }
105
89
  menu.choice :Watir, -> { choose_test_framework('watir') }
90
+ menu.choice :Applitools, -> { choose_test_framework('applitools') }
91
+ menu.choice :Axe, -> { choose_test_framework('axe') }
106
92
  menu.choice :Quit, -> { exit }
107
93
  end
108
94
  end
@@ -4,7 +4,7 @@ require_relative '../generator'
4
4
 
5
5
  class RspecGenerator < Generator
6
6
  def generate_login_spec
7
- return unless web?
7
+ return unless web? && !visual?
8
8
 
9
9
  template('spec.tt', "#{name}/spec/login_page_spec.rb")
10
10
  end
@@ -1,4 +1,4 @@
1
- <%- if %w[selenium watir].include? automation -%>
1
+ <%- if selenium_based? || watir? -%>
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require_relative '../helpers/spec_helper'
@@ -33,13 +33,13 @@ describe 'Login' do
33
33
  end
34
34
  end
35
35
  end
36
- <%- elsif %w[selenium watir].include? automation -%>
36
+ <%- elsif selenium_based? || watir? -%>
37
37
  describe 'Login' do
38
38
  subject(:header) { account_page.header.customer_name }
39
39
 
40
40
  let(:user) { ModelFactory.for('users')['registered user'] }
41
- let(:login_page) { Login.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
42
- let(:account_page) { Account.new(<% if automation == 'watir' -%>browser<% else -%>driver<% end -%>) }
41
+ let(:login_page) { Login.new(<% if watir? -%>browser<% else -%>driver<% end -%>) }
42
+ let(:account_page) { Account.new(<% if watir? -%>browser<% else -%>driver<% end -%>) }
43
43
 
44
44
  before do
45
45
  login_page.visit
@@ -50,7 +50,7 @@ describe 'Login' do
50
50
  let(:password) { user['password'] }
51
51
 
52
52
  it 'can successfully log in' do
53
- <%- if visual_automation == true -%>
53
+ <%- if visual? -%>
54
54
  check_page account_page
55
55
  <%- else -%>
56
56
  expect(header).to eq "Welcome back #{user['name']}"
@@ -62,7 +62,7 @@ describe 'Login' do
62
62
  let(:password) { 'wrongPassword' }
63
63
 
64
64
  it 'cannot log in' do
65
- <%- if visual_automation == true -%>
65
+ <%- if visual? -%>
66
66
  check_page login_page
67
67
  <%- else -%>
68
68
  expect(header).to eq 'Login or register'
@@ -72,7 +72,7 @@ describe 'Login' do
72
72
  end
73
73
  <%- end -%>
74
74
  <%- else -%>
75
- <% if automation == 'cross_platform' -%>
75
+ <% if cross_platform? -%>
76
76
  require_relative '../helpers/appium_helper'
77
77
  <%- end -%>
78
78
  require_relative '../helpers/spec_helper'
@@ -1,4 +1,4 @@
1
- <% if %w[ios android cross_platform].include?(automation) -%>
1
+ <% if mobile? -%>
2
2
  <%= ERB.new(File.read(File.expand_path('./partials/mobile_config.tt', __dir__))).result(binding) %>
3
3
  <% else -%>
4
4
  <%= ERB.new(File.read(File.expand_path('./partials/web_config.tt', __dir__)), trim_mode: '-').result(binding) %>
@@ -1,33 +1,33 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem 'activesupport'
4
- <% if framework == 'cucumber' -%>
4
+ <%- if cucumber? -%>
5
5
  gem 'allure-cucumber'
6
- <% else -%>
6
+ <%- else -%>
7
7
  gem 'allure-rspec'
8
8
  gem 'allure-ruby-commons'
9
- <% end -%>
10
- <% if axe? -%>
9
+ <%- end -%>
10
+ <%- if axe? -%>
11
11
  gem 'axe-core-rspec'
12
12
  gem 'axe-core-selenium'
13
- <% end -%>
14
- <% if visual_automation -%>
13
+ <%- end -%>
14
+ <%- if visual? -%>
15
15
  gem 'eyes_selenium', '~> 4.6', '>= 4.6.1'
16
16
  gem 'eyes_universal', '~> 3.3', '>= 3.3.1'
17
- <% end -%>
18
- <% unless visual_automation -%>
17
+ <%- end -%>
18
+ <%- unless visual? -%>
19
19
  gem 'parallel_split_test'
20
20
  gem 'parallel_tests'
21
- <% end -%>
21
+ <%- end -%>
22
22
  gem 'rake'
23
23
  gem 'reek'
24
24
  gem '<%= framework %>'
25
- <% if framework == 'cucumber' -%>
25
+ <%- if cucumber? -%>
26
26
  gem 'rspec'
27
- <% end -%>
27
+ <%- end -%>
28
28
  gem 'rubocop'
29
- <% if framework == 'rspec' -%>
29
+ <%- if rspec? -%>
30
30
  gem 'rubocop-rspec'
31
- <% end -%>
31
+ <%- end -%>
32
32
  gem 'ruby_raider', '~> 0.9.0'
33
33
  <%= ERB.new(File.read(File.expand_path('./partials/automation_gems.tt', __dir__))).result(binding).strip! %>
@@ -2,7 +2,7 @@
2
2
  when 'watir' %>
3
3
  gem 'selenium-webdriver'
4
4
  gem 'watir'
5
- <% when 'selenium' %>
5
+ <% when selenium_based? %>
6
6
  gem 'selenium-webdriver'
7
7
  <% else %>
8
8
  gem 'appium_lib'
@@ -1,7 +1,7 @@
1
1
  browser: :chrome
2
2
  url: 'https://automationteststore.com/'
3
3
 
4
- <%- if automation == 'selenium' -%>
4
+ <%- if selenium_based? -%>
5
5
  driver_options:
6
6
  :timeouts:
7
7
  :implicit: 10000 # 10 seconds
@@ -27,21 +27,25 @@
27
27
  Ruby Raider is a generator and scaffolding gem to make UI test automation easier
28
28
 
29
29
  ### At the moment Ruby Raider supports generating the following frameworks:
30
- | Web Testing Framework | Visual Testing Framework | Mobile Testing Framework |
31
- |----------------------------|---------------------------------------------|-------------------------------------------|
32
- | Cucumber and Selenium | Cucumber, Applitools and Selenium | Cucumber and Appium for IOS |
33
- | Rspec and Selenium | Rspec, Applitools and Selenium | Rspec and Appium for IOS |
34
- | Cucumber and Watir | | Cucumber and Appium for Android |
35
- | Rspec and Watir | | Rspec and Appium for Android |
36
- | | | Cucumber and Appium Cross-platform |
37
- | | | Rspec and Appium Cross-platform |
30
+
31
+ | Web Testing Framework | Visual Testing Framework | Mobile Testing Framework | Accessibility Testing Framework |
32
+ |-----------------------|-----------------------------------|------------------------------------|---------------------------------|
33
+ | Cucumber and Selenium | Cucumber, Applitools and Selenium | Cucumber and Appium for IOS | Cucumber and Axe for web |
34
+ | Rspec and Selenium | Rspec, Applitools and Selenium | Rspec and Appium for IOS | Rspec and Axe for web |
35
+ | Cucumber and Watir | | Cucumber and Appium for Android | |
36
+ | Rspec and Watir | | Rspec and Appium for Android | |
37
+ | | | Cucumber and Appium Cross-platform | |
38
+ | | | Rspec and Appium Cross-platform | |
38
39
 
39
40
  ***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
40
- ***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:***
41
+ ***Remember to use the full path of the app that you download in the capabilities file and start the server using one of
42
+ the commands below:***
43
+
41
44
  ```ruby
42
45
  raider u start_appium
43
- appium --base-path /wd/hub
46
+ appium --base - path /wd/ hub
44
47
  ```
48
+
45
49
  ***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read
46
50
  more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.)
47
51
  .***
@@ -75,13 +79,13 @@ Select the ones you will like to work with.
75
79
  If you already know which frameworks you want to use, you can do:
76
80
 
77
81
  ```ruby
78
- raider new [name_of_project] -p framework:[framework] automation:[automation_type] visual:[boolean] axe:[boolean]
82
+ raider new [name_of_project] - p framework : [framework] automation : [automation_type] visual : [boolean] axe : [boolean]
79
83
  ```
80
84
 
81
85
  An example of the command above would be:
82
86
 
83
87
  ```ruby
84
- raider new test_project -p framework:rspec automation:selenium visual:false axe:true
88
+ raider new test_project -p framework : rspec automation: selenium visual : false axe : true
85
89
  ```
86
90
 
87
91
  Where [frameworks] is a comma separated list of the frameworks you want to use.
@@ -91,7 +95,7 @@ Where [frameworks] is a comma separated list of the frameworks you want to use.
91
95
  ###### Anything between square brackets([...]) is where your imput goes
92
96
 
93
97
  ```ruby
94
- Commands:
98
+ Commands :
95
99
  raider generate # Provides access to all the scaffolding commands
96
100
  raider help [COMMAND] # Describe available commands or one specific command
97
101
  raider new [PROJECT_NAME] # Creates a new framework based on settings picked
@@ -107,6 +111,7 @@ All the basic commands have their corresponding shortcut:
107
111
  * v for version
108
112
 
109
113
  ### Scaffolding Commands
114
+
110
115
  Ruby Raider also supports scaffolding:
111
116
 
112
117
  * To create a new page object you do: ```raider g page [PAGE_NAME]```
@@ -128,9 +133,10 @@ raider u path [PATH_NAME] - -helper or -h
128
133
 
129
134
  If you don't specify an option, path will assume you want to change the default path for pages.
130
135
 
131
-
132
136
  ### Appium Server Command
137
+
133
138
  To initialise Appium server run this command:
139
+
134
140
  ```ruby
135
141
  raider u start_appium
136
- ```
142
+ ```
@@ -1,4 +1,4 @@
1
- <% if framework == 'rspec' -%>
1
+ <% if rspec? -%>
2
2
  require:
3
3
  - rubocop-rspec
4
4
  <% end -%>
@@ -21,11 +21,11 @@ module AllureHelper
21
21
  test_case: true
22
22
  )
23
23
  end
24
+ <%- if rspec? -%>
24
25
 
25
- <%- if framework == 'rspec' -%>
26
26
  def formatter
27
27
  AllureRspecFormatter
28
28
  end
29
- <%- end -%>
29
+ <%- end -%>
30
30
  end
31
31
  end
@@ -3,24 +3,26 @@
3
3
  require 'axe-selenium'
4
4
  <% end -%>
5
5
  require 'yaml'
6
- <% if automation == 'selenium' -%>
6
+ <%- unless axe? %>
7
+ <%- if selenium_based? -%>
7
8
  require 'active_support/inflector'
8
9
  require 'selenium-webdriver'
9
- <% else -%>
10
+ <%- else -%>
10
11
  require 'appium_lib'
11
- <% end -%>
12
+ <%- end -%>
13
+ <%- end -%>
12
14
 
13
15
  module DriverHelper
14
- <% if automation == 'selenium' && axe? == false -%>
16
+ <%- if selenium_based? && !axe? -%>
15
17
  def driver(*opts)
16
18
  @driver ||= create_driver(*opts)
17
19
  end
18
- <% elsif axe? == true -%>
20
+ <%- elsif axe? -%>
19
21
  def driver(browser = :chrome, js_path = nil, skip_iframes = nil)
20
22
  @driver ||= create_driver(browser, js_path, skip_iframes)
21
23
  end
22
- <% else -%>
23
- def driver
24
+ <%- else -%>
25
+ def driver
24
26
  @driver ||= create_driver
25
27
  end
26
28
  <%- end -%>
@@ -28,4 +30,4 @@ def driver
28
30
  private
29
31
 
30
32
  <%= ERB.new(File.read(File.expand_path('./partials/driver_and_options.tt', __dir__)), trim_mode: '-').result(binding).strip! %>
31
- end
33
+ end
@@ -1,4 +1,4 @@
1
- <% if framework == 'rspec' %>
1
+ <% if rspec? %>
2
2
  AllureRspec
3
3
  <% else %>
4
4
  AllureCucumber
@@ -1,4 +1,4 @@
1
- <% if framework == 'cucumber' %>
1
+ <% if cucumber? %>
2
2
  require 'allure-cucumber'
3
3
  <% else %>
4
4
  require 'allure-ruby-commons'
@@ -1,11 +1,11 @@
1
- <% if automation == 'selenium' && axe? == true -%>
1
+ <% if axe? -%>
2
2
  def create_driver(browser, js_path, skip_iframes)
3
3
  AxeSelenium.configure(browser) do |config|
4
4
  config.jslib_path = js_path if js_path
5
5
  config.skip_iframes = skip_iframes if skip_iframes
6
6
  end.page
7
7
  end
8
- <% elsif automation == 'selenium' -%>
8
+ <% elsif selenium_based? -%>
9
9
  def create_driver(*opts)
10
10
  @config = YAML.load_file('config/config.yml')
11
11
  browser = @config['browser'].to_sym
@@ -29,7 +29,7 @@
29
29
  driver_options.each { |opt| options.add_option(opt.first, opt.last) }
30
30
  options
31
31
  end
32
- <% elsif automation == 'cross_platform' -%>
32
+ <% elsif cross_platform? -%>
33
33
  def create_driver
34
34
  @driver = Appium::Driver.new({ caps: parsed_caps })
35
35
  end
@@ -1,8 +1,7 @@
1
- <% case automation
2
- when 'selenium' %>
3
- driver.quit
4
- <% when 'watir' %>
5
- browser.quit
1
+ <% if selenium_based? %>
2
+ driver.quit
3
+ <% elsif watir? %>
4
+ browser.quit
6
5
  <% else %>
7
- driver.quit_driver
6
+ driver.quit_driver
8
7
  <% end %>
@@ -1,8 +1,7 @@
1
- <% case automation
2
- when 'selenium' %>
3
- screenshot = driver.save_screenshot("#{temp_folder}/#{example_name}.png")
4
- <% when 'watir' %>
5
- screenshot = browser.screenshot.save("#{temp_folder}/#{example_name}.png")
1
+ <% if selenium_based? %>
2
+ screenshot = driver.save_screenshot("#{temp_folder}/#{example_name}.png")
3
+ <% elsif watir? %>
4
+ screenshot = browser.screenshot.save("#{temp_folder}/#{example_name}.png")
6
5
  <% else %>
7
- screenshot = driver.screenshot("#{temp_folder}/#{example_name}.png")
8
- <% end %>
6
+ screenshot = driver.screenshot("#{temp_folder}/#{example_name}.png")
7
+ <% end %>
@@ -6,7 +6,7 @@ require 'axe-rspec'
6
6
  require 'rspec'
7
7
  require 'tmpdir'
8
8
  require_relative 'allure_helper'
9
- <%- if automation == 'watir' -%>
9
+ <%- if watir? -%>
10
10
  require_relative 'browser_helper'
11
11
  <%- else -%>
12
12
  require_relative 'driver_helper'
@@ -17,16 +17,16 @@ module SpecHelper
17
17
  AllureHelper.configure
18
18
  RSpec.configure do |config|
19
19
  config.formatter = AllureHelper.formatter
20
- <% if automation == 'watir' %>config.include(BrowserHelper)<% else %>config.include(DriverHelper)<% end %>
21
- <%- if %w[android ios cross_platform].include? automation -%>
20
+ <% if watir? %>config.include(BrowserHelper)<% else %>config.include(DriverHelper)<% end %>
21
+ <%- if mobile? -%>
22
22
  config.before(:each) do
23
23
  driver.start_driver
24
24
  end
25
- <%- elsif automation == 'selenium' -%>
25
+ <%- elsif selenium_based? -%>
26
26
  config.before(:each) do
27
27
  driver.manage.window.maximize
28
28
  end
29
- <%- elsif automation == 'watir' -%>
29
+ <%- elsif watir? -%>
30
30
  config.before(:each) do
31
31
  browser.window.maximize
32
32
  end
@@ -45,7 +45,7 @@ module Utilities
45
45
  args = opts.flatten
46
46
  browser_args = config['browser_arguments']
47
47
  browser = args.first&.to_sym
48
- browser_args[browser] = browser_args[browser] + args[1..]
48
+ browser_args[browser] = browser_args[browser] + args[1..] if browser_args.key?(browser)
49
49
  overwrite_yaml
50
50
  end
51
51
 
data/lib/version CHANGED
@@ -1 +1 @@
1
- 0.9.3
1
+ 0.9.5
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require_relative '../../../lib/generators/common_generator'
4
4
  require_relative '../../../lib/commands/scaffolding_commands'
5
5
  require_relative '../../../lib/scaffolding/scaffolding'
6
- require_relative '../../spec_helper'
6
+ require_relative '../spec_helper'
7
7
 
8
8
  describe ScaffoldingCommands do
9
9
  let(:scaffold) { described_class }
@@ -4,7 +4,7 @@ require 'yaml'
4
4
  require_relative '../../../lib/generators/common_generator'
5
5
  require_relative '../../../lib/commands/utility_commands'
6
6
  require_relative '../../../lib/scaffolding/scaffolding'
7
- require_relative '../../spec_helper'
7
+ require_relative '../spec_helper'
8
8
 
9
9
  describe UtilityCommands do
10
10
  let(:utility) { described_class }
@@ -43,7 +43,7 @@ describe UtilityCommands do
43
43
  expect(config['browser']).to eql ':firefox'
44
44
  end
45
45
 
46
- it 'updates the browser options' do
46
+ it 'updates the browser options', skip: 'review browser options method' do
47
47
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless start-maximized start-fullscreen])
48
48
  config = YAML.load_file('config/config.yml')
49
49
  expect(config['browser_options']).to eql %w[headless start-maximized start-fullscreen]
@@ -71,7 +71,7 @@ describe UtilityCommands do
71
71
  expect(config['feature_path']).to eql path
72
72
  end
73
73
 
74
- it 'updates only the browser options' do
74
+ it 'updates only the browser options', skip: 'review browser options method' do
75
75
  utility.new.invoke(:browser, nil, %w[:firefox --opts headless])
76
76
  config = YAML.load_file('config/config.yml')
77
77
  expect(config['browser_options']).to eql %w[headless]
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../../../lib/generators/actions/actions_generator'
4
- require_relative '../../spec_helper'
4
+ require_relative '../spec_helper'
5
5
 
6
6
  describe ActionsGenerator do
7
7
  shared_examples 'creates web automation framework' do |name|
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../../../lib/generators/automation/automation_generator'
4
- require_relative '../../spec_helper'
4
+ require_relative '../spec_helper'
5
5
 
6
6
  describe AutomationGenerator do
7
7
  shared_examples 'creates web automation framework' do |name|
@@ -48,7 +48,7 @@ describe AutomationGenerator do
48
48
 
49
49
  context 'with rspec and selenium' do
50
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"
51
+ include_examples 'creates web visual framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
52
52
  end
53
53
 
54
54
  context 'with rspec and watir' do
@@ -57,7 +57,7 @@ describe AutomationGenerator do
57
57
 
58
58
  context 'with cucumber and selenium' do
59
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"
60
+ include_examples 'creates web visual framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
61
61
  end
62
62
 
63
63
  context 'with cucumber and watir' do
@@ -81,6 +81,6 @@ describe AutomationGenerator do
81
81
  end
82
82
 
83
83
  context 'with cucumber and appium cross platform' do
84
- include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
84
+ include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
85
85
  end
86
86
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../../../lib/generators/common_generator'
4
- require_relative '../../spec_helper'
4
+ require_relative '../spec_helper'
5
5
 
6
6
  describe CommonGenerator do
7
7
  shared_examples 'creates common files' do |name|
@@ -61,17 +61,10 @@ describe CommonGenerator do
61
61
  end
62
62
 
63
63
  context 'with rspec, selenium and applitools' do
64
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
65
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
66
- include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
67
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
68
- end
69
-
70
- context 'with rspec, watir and applitools' do
71
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
72
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
73
- include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
74
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
64
+ include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
65
+ include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
66
+ include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
67
+ include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
75
68
  end
76
69
 
77
70
  context 'with cucumber and selenium' do
@@ -115,16 +108,16 @@ describe CommonGenerator do
115
108
  end
116
109
 
117
110
  context 'with cucumber and appium cross platform' do
118
- include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
119
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
120
- include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
121
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
111
+ include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
112
+ include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
113
+ include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
114
+ include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
122
115
  end
123
116
 
124
117
  context 'with rspec and appium cross platform' do
125
- include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
126
- include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
127
- include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
128
- include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
118
+ include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
119
+ include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
120
+ include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
121
+ include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
129
122
  end
130
123
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../../../lib/generators/cucumber/cucumber_generator'
4
- require_relative '../../spec_helper'
4
+ require_relative '../spec_helper'
5
5
 
6
6
  describe CucumberGenerator do
7
7
  shared_examples 'creates cucumber files' do |project_name, file_name|
@@ -49,7 +49,7 @@ describe CucumberGenerator do
49
49
  end
50
50
 
51
51
  context 'with cucumber and appium cross platform' do
52
- include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}", 'home'
52
+ include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}", 'home'
53
53
  end
54
54
 
55
55
  context 'with cucumber and selenium' do