Configure the Playwright driver for Capybara
mainTo use Playwright, register the :playwright driver within your Capybara configuration. You can specify the browser_type (e.g., :firefox) and whether to run in headless mode. It is also recommended to set Capybara.default_max_wait_time and a Capybara.save_path for screenshots/logs.
require 'capybara-playwright-driver'
Capybara.register_driver(:playwright) do |app|
Capybara::Playwright::Driver.new(app, browser_type: :firefox, headless: false)
end
Capybara.default_max_wait_time = 15
Capybara.default_driver = :playwright
Capybara.save_path = 'tmp/capybara'require 'capybara-playwright-driver'
# setup
Capybara.register_driver(:playwright) do |app|
Capybara::Playwright::Driver.new(app, browser_type: :firefox, headless: false)
end
Capybara.default_max_wait_time = 15
Capybara.default_driver = :playwright
Capybara.save_path = 'tmp/capybara'