Class: Capybara::Playwright::Driver
- Inherits:
-
Driver::Base
- Object
- Driver::Base
- Capybara::Playwright::Driver
- Extended by:
- Forwardable
- Defined in:
- lib/capybara/playwright/driver.rb
Instance Method Summary collapse
- #browser ⇒ Object
-
#initialize(app, **options) ⇒ Driver
constructor
A new instance of Driver.
- #invalid_element_errors ⇒ Object
- #needs_server? ⇒ Boolean
- #no_such_window_error ⇒ Object
- #reset! ⇒ Object
- #wait? ⇒ Boolean
Constructor Details
#initialize(app, **options) ⇒ Driver
Returns a new instance of Driver.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/capybara/playwright/driver.rb', line 6 def initialize(app, **) @playwright_cli_executable_path = [:playwright_cli_executable_path] || 'npx playwright' @browser_type = [:browser_type] || :chromium unless i(chromium firefox webkit).include?(@browser_type) raise ArgumentError.new("Unknown browser_type: #{@browser_type}") end = BrowserOptions.new() = PageOptions.new() end |
Instance Method Details
#browser ⇒ Object
20 21 22 |
# File 'lib/capybara/playwright/driver.rb', line 20 def browser @browser ||= create_browser end |
#invalid_element_errors ⇒ Object
57 58 59 60 61 62 |
# File 'lib/capybara/playwright/driver.rb', line 57 def invalid_element_errors @invalid_element_errors ||= [ Node::NotActionableError, Node::StaleReferenceError, ].freeze end |
#needs_server? ⇒ Boolean
18 |
# File 'lib/capybara/playwright/driver.rb', line 18 def needs_server?; true; end |
#no_such_window_error ⇒ Object
64 65 66 |
# File 'lib/capybara/playwright/driver.rb', line 64 def no_such_window_error Browser::NoSuchWindowError end |
#reset! ⇒ Object
52 53 54 55 |
# File 'lib/capybara/playwright/driver.rb', line 52 def reset! quit @browser = nil end |
#wait? ⇒ Boolean
17 |
# File 'lib/capybara/playwright/driver.rb', line 17 def wait?; true; end |