Sha256: d6930d218c81a517188d8c2da4d5a05024d46a396f99b826aa179fcdd029b647
Contents?: true
Size: 1.94 KB
Versions: 9
Compression:
Stored size: 1.94 KB
Contents
# frozen_string_literal: true require 'spec_helper' require 'selenium-webdriver' require 'shared_selenium_session' Capybara.register_driver :selenium_chrome do |app| args = ENV['TRAVIS'] ? ['no-sandbox' ] : [] Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args) end Capybara.register_driver :selenium_chrome_clear_storage do |app| args = ENV['TRAVIS'] ? ['no-sandbox' ] : [] Capybara::Selenium::Driver.new(app, :browser => :chrome, :args => args, clear_local_storage: true, clear_session_storage: true) end module TestSessions Chrome = Capybara::Session.new(:selenium_chrome, TestApp) end skipped_tests = [:response_headers, :status_code, :trigger] skipped_tests << :windows if ENV['TRAVIS'] && !ENV['WINDOW_TEST'] Capybara::SpecHelper.run_specs TestSessions::Chrome, "selenium_chrome", capybara_skip: skipped_tests RSpec.describe "Capybara::Session with chrome" do include_examples "Capybara::Session", TestSessions::Chrome, :selenium_chrome context "storage" do describe "#reset!" do it "does not clear either storage by default" do @session = TestSessions::Chrome @session.visit('/with_js') @session.find(:css, '#set-storage').click @session.reset! @session.visit('/with_js') expect(@session.driver.browser.local_storage.keys).not_to be_empty expect(@session.driver.browser.session_storage.keys).not_to be_empty end it "clears storage when set" do @session = Capybara::Session.new(:selenium_chrome_clear_storage, TestApp) @session.visit('/with_js') @session.find(:css, '#set-storage').click @session.reset! @session.visit('/with_js') expect(@session.driver.browser.local_storage.keys).to be_empty expect(@session.driver.browser.session_storage.keys).to be_empty end end end end
Version data entries
9 entries across 8 versions & 3 rubygems