teamcapybara--capybara/spec
James Mead e382792352 Fix access to specializations when Selenium::Driver is subclassed
The specializations are stored in a class instance variable. However,
they are accessed from the specialize_driver method via `self.class`.

Previously if this method was called on an instance of a subclass of
Selenium::Driver, then it accessed the class instance variable
associated with the subclass (which is nil by default) and not the class
instance variable associated with the Selenium::Driver class as intended
resulting in an exception like this:

     NoMethodError:
       private method `select' called for nil:NilClass
       ./lib/capybara/selenium/driver.rb:417:in `specialize_driver'
       ./lib/capybara/selenium/driver.rb:49:in `browser'
       ./lib/capybara/selenium/driver.rb:66:in `visit'
       ./lib/capybara/session.rb:277:in `visit'
       ./spec/selenium_spec_chrome.rb:118:in `block (3 levels) in <top (required)>'

This commit adds a spec using a subclass of Selenium::Driver with Chrome
to demonstrate the problem and fixes it by changing the
specialize_driver method to access the specializations via the
explicitly specified class name.

An alternative fix would be to use a class variable for specializations
and do away with the class attribute reader altogether.
2019-05-11 12:07:16 +01:00
..
fixtures style updates 2018-07-16 15:04:52 -07:00
rspec Implement the _field disabled: false filter partially as an expression filter 2019-04-03 14:51:50 -07:00
basic_node_spec.rb Change gumbo usage default to be false 2019-01-16 09:53:09 -08:00
capybara_spec.rb Remove unnecessary instance variables from specs 2019-02-26 09:48:09 -08:00
css_builder_spec.rb Remove unnecessary instance variables from specs 2019-02-26 09:48:09 -08:00
css_splitter_spec.rb style updates 2018-07-16 15:04:52 -07:00
dsl_spec.rb Remove unnecessary instance variables from specs 2019-02-26 09:48:09 -08:00
filter_set_spec.rb style updates 2018-07-16 15:04:52 -07:00
minitest_spec.rb Deprecate assert_style/has_style?/have_style in favor of assert_matches_style/matches_styles?/match_style to match naming convention 2018-12-06 11:12:18 -08:00
minitest_spec_spec.rb Enable Coveralls on Travis 2019-04-25 11:39:41 -07:00
per_session_config_spec.rb style updates 2018-07-16 15:04:52 -07:00
rack_test_spec.rb Enable partial double verification and cleanup some specs 2019-04-20 10:23:07 -07:00
regexp_dissassembler_spec.rb Code refactor 2018-11-08 11:05:02 -08:00
result_spec.rb Enable partial double verification and cleanup some specs 2019-04-20 10:23:07 -07:00
rspec_matchers_spec.rb style updates 2018-07-16 15:04:52 -07:00
rspec_spec.rb Remove unnecessary instance variables from specs 2019-02-26 09:48:09 -08:00
sauce_spec_chrome.rb Add another spec config and associated rake task 2019-03-28 13:23:56 -07:00
selector_spec.rb Support multiple expression types in one selector 2019-04-23 09:16:07 -07:00
selenium_spec_chrome.rb Fix access to specializations when Selenium::Driver is subclassed 2019-05-11 12:07:16 +01:00
selenium_spec_chrome_remote.rb Stop skipping window tests and pend #maximize tests for headless Chrome 2018-11-26 13:09:24 -08:00
selenium_spec_edge.rb Move selenium driver version logging into helper method 2019-04-19 12:37:39 -07:00
selenium_spec_firefox.rb Workaround Chrome 75 appending files to file inputs 2019-05-03 11:41:33 -07:00
selenium_spec_firefox_remote.rb Workaround Chrome 75 appending files to file inputs 2019-05-03 11:41:33 -07:00
selenium_spec_ie.rb Update appveyor and disable requireWindowFocus for IE - it causes too many failures for what it fixes 2019-04-27 12:48:42 -07:00
selenium_spec_safari.rb Correct reasons for pending tests 2019-05-09 18:13:06 -07:00
server_spec.rb No need for automatic retries in checker 2019-05-01 11:23:47 -07:00
session_spec.rb Add test for document reset 2019-04-10 15:02:02 -07:00
shared_selenium_session.rb Fix test guard 2019-04-26 13:11:21 -07:00
spec_helper.rb Run Safari Technology Preview tests on Travis 2019-04-30 16:40:46 -07:00
xpath_builder_spec.rb Remove unnecessary instance variables from specs 2019-02-26 09:48:09 -08:00