Sha256: 456f761d7009c999adc9ad2cc853f07132304b8a8f945bced962593280ac466e

Contents?: true

Size: 1.04 KB

Versions: 17

Compression:

Stored size: 1.04 KB

Contents

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_raider-1.1.1 spec/system/selenium_spec.rb
ruby_raider-1.1.0 spec/system/selenium_spec.rb
ruby_raider-1.0.9 spec/system/selenium_spec.rb
ruby_raider-1.0.8 spec/system/selenium_spec.rb
ruby_raider-1.0.7 spec/system/selenium_spec.rb
ruby_raider-1.0.6 spec/system/selenium_spec.rb
ruby_raider-1.0.5 spec/system/selenium_spec.rb
ruby_raider-1.0.4 spec/system/selenium_spec.rb
ruby_raider-1.0.3 spec/system/selenium_spec.rb
ruby_raider-1.0.2 spec/system/selenium_spec.rb
ruby_raider-1.0.1 spec/system/selenium_spec.rb
ruby_raider-1.0.0 spec/system/selenium_spec.rb
ruby_raider-0.9.9 spec/system/selenium_spec.rb
ruby_raider-0.9.8 spec/system/selenium_spec.rb
ruby_raider-0.9.7 spec/system/selenium_spec.rb
ruby_raider-0.9.6 spec/system/selenium_spec.rb
ruby_raider-0.9.5 spec/system/selenium_spec.rb