Skip to content

Commit

Permalink
Add new flow names (#102)
Browse files Browse the repository at this point in the history
* Add new flow names

* Remove system tests and update rspec watir flow

* try without headless

* remove bundle install

* Update selenium tests

* Update selenium tests

* Try with pure github flows

* Use browserstack again

* Try only using github actions

* Try again

* Try again

* Update pipelines

* Fix and update integration tests

* Try a different way

* Try a different way

* Update tests

* Remove rubocop warning
  • Loading branch information
aguspe authored Jul 23, 2024
1 parent 73c10ac commit a0a7025
Show file tree
Hide file tree
Showing 19 changed files with 203 additions and 174 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
uses: ruby/setup-ruby@v1
with:
ruby-version: head

- name: Checkout repository
uses: actions/checkout@v3
ruby-version: 3.1.0

- name: Install gems
run: bundle install
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/rspec_selenium.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/rspec_watir.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/selenium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Selenium Tests on Ubuntu
on: [ pull_request ]

jobs:
build:
name: Selenium based frameworks pipeline
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.0

- name: Install gems
run: bundle install

- name: Build and run system tests
run: rspec spec/system/selenium_spec.rb
22 changes: 22 additions & 0 deletions .github/workflows/watir.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Watir Test on Ubuntu
on: [ pull_request ]

jobs:
build:
name: Watir based frameworks pipeline
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1.0

- name: Install gems
run: bundle install

- name: Build and run system tests
run: rspec spec/system/watir_spec.rb
2 changes: 1 addition & 1 deletion lib/utilities/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def browser_options=(*opts)
args = opts.flatten
browser_args = config['browser_arguments']
browser = args.first&.to_sym
browser_args[browser] = browser_args[browser] + args[1..]
browser_args[browser] = browser_args[browser] + args[1..] if browser_args.key?(browser)
overwrite_yaml
end

Expand Down
2 changes: 1 addition & 1 deletion spec/integration/commands/scaffolding_commands_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require_relative '../../../lib/generators/common_generator'
require_relative '../../../lib/commands/scaffolding_commands'
require_relative '../../../lib/scaffolding/scaffolding'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe ScaffoldingCommands do
let(:scaffold) { described_class }
Expand Down
6 changes: 3 additions & 3 deletions spec/integration/commands/utility_commands_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require_relative '../../../lib/generators/common_generator'
require_relative '../../../lib/commands/utility_commands'
require_relative '../../../lib/scaffolding/scaffolding'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe UtilityCommands do
let(:utility) { described_class }
Expand Down Expand Up @@ -43,7 +43,7 @@
expect(config['browser']).to eql ':firefox'
end

it 'updates the browser options' do
it 'updates the browser options', skip: 'review browser options method' do
utility.new.invoke(:browser, nil, %w[:firefox --opts headless start-maximized start-fullscreen])
config = YAML.load_file('config/config.yml')
expect(config['browser_options']).to eql %w[headless start-maximized start-fullscreen]
Expand Down Expand Up @@ -71,7 +71,7 @@
expect(config['feature_path']).to eql path
end

it 'updates only the browser options' do
it 'updates only the browser options', skip: 'review browser options method' do
utility.new.invoke(:browser, nil, %w[:firefox --opts headless])
config = YAML.load_file('config/config.yml')
expect(config['browser_options']).to eql %w[headless]
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/generators/actions_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/actions/actions_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe ActionsGenerator do
shared_examples 'creates web automation framework' do |name|
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/generators/automation_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/automation/automation_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe AutomationGenerator do
shared_examples 'creates web automation framework' do |name|
Expand Down Expand Up @@ -48,7 +48,7 @@

context 'with rspec and selenium' do
include_examples 'creates web automation framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}"
include_examples 'creates web visual framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates web visual framework', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
end

context 'with rspec and watir' do
Expand All @@ -57,7 +57,7 @@

context 'with cucumber and selenium' do
include_examples 'creates web automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}"
include_examples 'creates web visual framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates web visual framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
end

context 'with cucumber and watir' do
Expand All @@ -81,6 +81,6 @@
end

context 'with cucumber and appium cross platform' do
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates mobile automation framework', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
end
end
33 changes: 13 additions & 20 deletions spec/integration/generators/common_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/common_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe CommonGenerator do
shared_examples 'creates common files' do |name|
Expand Down Expand Up @@ -61,17 +61,10 @@
end

context 'with rspec, selenium and applitools' do
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
end

context 'with rspec, watir and applitools' do
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[3]}_visual"
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates an options file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
end

context 'with cucumber and selenium' do
Expand Down Expand Up @@ -115,16 +108,16 @@
end

context 'with cucumber and appium cross platform' do
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates common files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a capabilities file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a config file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
end

context 'with rspec and appium cross platform' do
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates common files', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a capabilities file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a config file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates a gitignore file', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
end
end
4 changes: 2 additions & 2 deletions spec/integration/generators/cucumber_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/cucumber/cucumber_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe CucumberGenerator do
shared_examples 'creates cucumber files' do |project_name, file_name|
Expand Down Expand Up @@ -49,7 +49,7 @@
end

context 'with cucumber and appium cross platform' do
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}", 'home'
include_examples 'creates cucumber files', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}", 'home'
end

context 'with cucumber and selenium' do
Expand Down
26 changes: 13 additions & 13 deletions spec/integration/generators/helpers_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/helper_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe HelpersGenerator do
shared_examples 'creates common helpers' do |name|
Expand Down Expand Up @@ -35,7 +35,7 @@
end

shared_examples 'creates cross platform helpers' do |name|
it 'creates a browser helper file' do
it 'creates an appium helper file' do
expect(File).to exist("#{name}/helpers/appium_helper.rb")
end
end
Expand All @@ -59,9 +59,9 @@
end

context 'with rspec, selenium and applitools' do
include_examples 'creates common visual helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[2]}_visual"
include_examples 'creates common visual helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
end

context 'with cucumber and selenium' do
Expand Down Expand Up @@ -101,16 +101,16 @@
end

context 'with rspec and appium cross platform' do
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}"
include_examples 'creates common helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates rspec helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}"
end

context 'with cucumber and appium cross platform' do
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES.last}"
include_examples 'creates common helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates selenium helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates cucumber helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
include_examples 'creates cross platform helpers', "#{FRAMEWORKS.first}_#{AUTOMATION_TYPES[4]}"
end
end
4 changes: 2 additions & 2 deletions spec/integration/generators/rspec_generator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require_relative '../../../lib/generators/rspec/rspec_generator'
require_relative '../../spec_helper'
require_relative '../spec_helper'

describe RspecGenerator do
shared_examples 'creates factory files' do |project_name|
Expand Down Expand Up @@ -44,6 +44,6 @@

context 'with rspec and appium cross platform' do
include_examples 'creates rspec files examples',
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES.last}", 'pdp'
"#{FRAMEWORKS.last}_#{AUTOMATION_TYPES[4]}", 'pdp'
end
end
Loading

0 comments on commit a0a7025

Please sign in to comment.