-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
117 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require_relative '../../lib/ruby_raider' | ||
|
||
FRAMEWORKS = %w[cucumber rspec].freeze | ||
|
||
describe 'Selenium based frameworks' do | ||
before do | ||
FRAMEWORKS.each do |framework| | ||
RubyRaider::Raider | ||
.new.invoke(:new, nil, %W[selenium_#{framework} -p framework:#{framework} automation:selenium]) | ||
end | ||
end | ||
|
||
after do | ||
FRAMEWORKS.each do |framework| | ||
FileUtils.rm_rf("selenium_#{framework}") | ||
end | ||
end | ||
|
||
shared_examples 'creates web automation framework' do |type| | ||
it 'executes without errors' do | ||
run_tests_with(type) | ||
expect($stdout).not_to match(/StandardError/) | ||
end | ||
end | ||
|
||
context 'with rspec' do | ||
include_examples 'creates web automation framework', 'rspec' | ||
end | ||
|
||
context 'with cucumber' do | ||
include_examples 'creates web automation framework', 'cucumber' | ||
end | ||
|
||
private | ||
|
||
def run_tests_with(framework) | ||
folder = framework == 'rspec' ? 'spec' : 'features' | ||
system("cd selenium_#{framework} && bundle install && raider utility browser_options chrome headless && bundle exec #{framework} #{folder}") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require_relative '../../lib/ruby_raider' | ||
|
||
FRAMEWORKS = %w[cucumber rspec].freeze | ||
|
||
describe 'Watir based frameworks' do | ||
before do | ||
FRAMEWORKS.each do |framework| | ||
RubyRaider::Raider | ||
.new.invoke(:new, nil, %W[watir_#{framework} -p framework:#{framework} automation:watir]) | ||
end | ||
end | ||
|
||
after do | ||
FRAMEWORKS.each do |framework| | ||
FileUtils.rm_rf("watir_#{framework}") | ||
end | ||
end | ||
|
||
shared_examples 'creates web automation framework' do |type| | ||
it 'executes without errors' do | ||
run_tests_with(type) | ||
expect($stdout).not_to match(/StandardError/) | ||
end | ||
end | ||
|
||
context 'with rspec' do | ||
include_examples 'creates web automation framework', 'rspec' | ||
end | ||
|
||
context 'with cucumber' do | ||
include_examples 'creates web automation framework', 'cucumber' | ||
end | ||
|
||
private | ||
|
||
def run_tests_with(framework) | ||
system("cd selenium_#{framework} && bundle install && raider utility browser_options chrome headless && bundle exec #{framework}") | ||
end | ||
end |