aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/system_testing/driver_test.rb
blob: 8f8777b19f48c1711b42c10a157e84f1b9826a17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require "abstract_unit"
require "action_dispatch/system_testing/driver"

class DriverTest < ActiveSupport::TestCase
  test "initializing the driver" do
    driver = ActionDispatch::SystemTesting::Driver.new(:selenium)
    assert_equal :selenium, driver.instance_variable_get(:@name)
  end

  test "initializing the driver with a browser" do
    driver = ActionDispatch::SystemTesting::Driver.new(:selenium, using: :chrome, screen_size: [1400, 1400])
    assert_equal :selenium, driver.instance_variable_get(:@name)
    assert_equal :chrome, driver.instance_variable_get(:@browser)
    assert_equal [1400, 1400], driver.instance_variable_get(:@screen_size)
  end

  test "selenium? returns false if driver is poltergeist" do
    assert_not ActionDispatch::SystemTesting::Driver.new(:poltergeist).send(:selenium?)
  end
end