test: Add Playwright tests for mobile responsiveness
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'playwright'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.before(:suite) do
|
||||
puts "Starting Playwright..."
|
||||
@playwright = Playwright.create(playwright_cli_executable_path: './node_modules/.bin/playwright')
|
||||
@browser = @playwright.chromium.launch(headless: true)
|
||||
end
|
||||
|
||||
config.after(:suite) do
|
||||
@browser.close
|
||||
@playwright.stop
|
||||
puts "Playwright stopped."
|
||||
end
|
||||
|
||||
# Make Playwright available to all specs
|
||||
config.before(:all) do
|
||||
@playwright = Playwright.create(playwright_cli_executable_path: './node_modules/.bin/playwright')
|
||||
@browser = @playwright.chromium.launch(headless: true)
|
||||
end
|
||||
|
||||
config.after(:all) do
|
||||
@browser.close
|
||||
@playwright.stop
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user