mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Remove tests for unsupported legacy firefox
This commit is contained in:
parent
1a899c2a73
commit
8ca0d15d8b
5 changed files with 0 additions and 79 deletions
8
Rakefile
8
Rakefile
|
@ -4,12 +4,6 @@ require 'cucumber/rake/task'
|
|||
require 'yard'
|
||||
|
||||
desc "Run all examples with Firefox non-marionette"
|
||||
RSpec::Core::RakeTask.new(:spec_firefox) do |t|
|
||||
t.rspec_opts = %w[--color]
|
||||
# When we drop RSpec 2.x support we can rename spec_chrome.rb and implement this properly
|
||||
# t.exclude_pattern = './spec/*{_chrome_spec.rb, _marionette_spec.rb}'
|
||||
t.pattern = './spec{,/*/**}/*{_spec.rb,_spec_firefox.rb}'
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec_marionette) do |t|
|
||||
t.rspec_opts = %w[--color]
|
||||
|
@ -40,8 +34,6 @@ end
|
|||
task :travis do
|
||||
if ENV['CAPYBARA_FF']
|
||||
Rake::Task[:spec_marionette].invoke
|
||||
elsif ENV['CAPYBARA_LEGACY_FF']
|
||||
Rake::Task[:spec_firefox].invoke
|
||||
Rake::Task[:cucumber].invoke
|
||||
else
|
||||
Rake::Task[:spec_chrome].invoke
|
||||
|
|
|
@ -5,7 +5,6 @@ require 'selenium-webdriver'
|
|||
RSpec.describe Capybara::Selenium::Driver do
|
||||
it "should exit with a non-zero exit status" do
|
||||
options = { browser: (ENV['SELENIUM_BROWSER'] || :firefox).to_sym }
|
||||
options[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false) if ENV['LEGACY_FIREFOX']
|
||||
browser = Capybara::Selenium::Driver.new(TestApp, options).browser
|
||||
expect(true).to eq(false)
|
||||
end
|
||||
|
|
|
@ -5,7 +5,6 @@ require 'selenium-webdriver'
|
|||
RSpec.describe Capybara::Selenium::Driver do
|
||||
it "should exit with a zero exit status" do
|
||||
options = { browser: (ENV['SELENIUM_BROWSER'] || :firefox).to_sym }
|
||||
options[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false) if ENV['LEGACY_FIREFOX']
|
||||
browser = Capybara::Selenium::Driver.new(TestApp, options ).browser
|
||||
expect(true).to eq(true)
|
||||
end
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
require "selenium-webdriver"
|
||||
require 'shared_selenium_session'
|
||||
require 'rspec/shared_spec_matchers'
|
||||
|
||||
Capybara.register_driver :selenium_firefox do |app|
|
||||
Capybara::Selenium::Driver.new(
|
||||
app,
|
||||
browser: :firefox,
|
||||
desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false)
|
||||
)
|
||||
end
|
||||
|
||||
Capybara.register_driver :selenium_firefox_cant_clear_storage do |app|
|
||||
Capybara::Selenium::Driver.new(
|
||||
app,
|
||||
browser: :firefox,
|
||||
desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false),
|
||||
clear_local_storage: true,
|
||||
clear_session_storage: true
|
||||
)
|
||||
end
|
||||
|
||||
module TestSessions
|
||||
Selenium = Capybara::Session.new(:selenium_firefox, TestApp)
|
||||
end
|
||||
|
||||
skipped_tests = [
|
||||
:response_headers,
|
||||
:status_code,
|
||||
:trigger
|
||||
]
|
||||
skipped_tests << :windows if ENV['TRAVIS'] && ENV['SKIP_WINDOW']
|
||||
|
||||
Capybara::SpecHelper.run_specs TestSessions::Selenium, "selenium", capybara_skip: skipped_tests
|
||||
|
||||
RSpec.describe "Capybara::Session with legacy firefox" do
|
||||
include Capybara::SpecHelper
|
||||
include_examples "Capybara::Session", TestSessions::Selenium, :selenium_firefox
|
||||
include_examples Capybara::RSpecMatchers, TestSessions::Selenium, :selenium_firefox
|
||||
|
||||
context "storage" do
|
||||
it "warns storage clearing isn't available" do
|
||||
@session = Capybara::Session.new(:selenium_firefox_cant_clear_storage, TestApp)
|
||||
expect_any_instance_of(Kernel).to receive(:warn).with('sessionStorage clear requested but is not available for this driver')
|
||||
expect_any_instance_of(Kernel).to receive(:warn).with('localStorage clear requested but is not available for this driver')
|
||||
@session.visit('/')
|
||||
@session.reset!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.describe Capybara::Selenium::Driver do
|
||||
before do
|
||||
@driver = Capybara::Selenium::Driver.new(TestApp, browser: :firefox, desired_capabilities: Selenium::WebDriver::Remote::Capabilities.firefox(marionette: false))
|
||||
end
|
||||
|
||||
describe '#quit' do
|
||||
it "should reset browser when quit" do
|
||||
expect(@driver.browser).to be
|
||||
@driver.quit
|
||||
#access instance variable directly so we don't create a new browser instance
|
||||
expect(@driver.instance_variable_get(:@browser)).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -35,7 +35,6 @@ RSpec.shared_examples "Capybara::Session" do |session, mode|
|
|||
@current_dir = Dir.getwd
|
||||
Dir.chdir(File.join(File.dirname(__FILE__), '..'))
|
||||
@env = { 'SELENIUM_BROWSER' => @session.driver.options[:browser].to_s }
|
||||
@env['LEGACY_FIREFOX'] = 'TRUE' if mode == :selenium_firefox
|
||||
end
|
||||
|
||||
after do
|
||||
|
|
Loading…
Reference in a new issue