File: selenium_firefox_spec.rb

package info (click to toggle)
ruby-capybara 2.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,376 kB
  • ctags: 779
  • sloc: ruby: 12,494; makefile: 4
file content (44 lines) | stat: -rw-r--r-- 1,272 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true
require 'spec_helper'
require 'shared_selenium_session'

Capybara.register_driver :selenium_focus do |app|
  # profile = Selenium::WebDriver::Firefox::Profile.new
  # profile["focusmanager.testmode"] = true
  # Capybara::Selenium::Driver.new(app, browser: :firefox, profile: profile)
  Capybara::Selenium::Driver.new(app, browser: :firefox)
end

<<PENDING
module TestSessions
  Selenium = Capybara::Session.new(:selenium_focus, TestApp)
end

skipped_tests = [
  :response_headers,
  :status_code,
  :trigger
]
skipped_tests << :windows if ENV['TRAVIS'] && !ENV['WINDOW_TEST']

Capybara::SpecHelper.run_specs TestSessions::Selenium, "selenium", capybara_skip: skipped_tests

RSpec.describe "Capybara::Session with firefox" do
  include_examples  "Capybara::Session", TestSessions::Selenium, :selenium_focus
end

RSpec.describe Capybara::Selenium::Driver do
  before do
    @driver = Capybara::Selenium::Driver.new(TestApp, browser: :firefox)
  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
PENDING