From dab37c1a5a4a83c66c4880a2ef7712f1f9fe9eaf Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 26 May 2023 18:02:56 +0900 Subject: [PATCH] DEV: Run tests with new chrome headless (#21684) New headless shares the same implementation as the chrome browser instead of being a separate implementation of its own. See https://developer.chrome.com/articles/new-headless/ for more details Co-authored-by: Rafael dos Santos Silva --- app/assets/javascripts/discourse/testem.js | 2 +- spec/rails_helper.rb | 4 ++-- test/run-qunit.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/testem.js b/app/assets/javascripts/discourse/testem.js index 6f0bc0382e3..c37420a0189 100644 --- a/app/assets/javascripts/discourse/testem.js +++ b/app/assets/javascripts/discourse/testem.js @@ -96,7 +96,7 @@ module.exports = { Chrome: [ // --no-sandbox is needed when running Chrome inside a container process.env.CI ? "--no-sandbox" : null, - "--headless", + "--headless=new", "--disable-dev-shm-usage", "--disable-software-rasterizer", "--mute-audio", diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 076bab8fcc4..4b860037b9b 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -297,7 +297,7 @@ RSpec.configure do |config| end Capybara.register_driver :selenium_chrome_headless do |app| - chrome_browser_options.add_argument("--headless") + chrome_browser_options.add_argument("--headless=new") Capybara::Selenium::Driver.new(app, browser: :chrome, options: chrome_browser_options) end @@ -319,7 +319,7 @@ RSpec.configure do |config| end Capybara.register_driver :selenium_mobile_chrome_headless do |app| - mobile_chrome_browser_options.add_argument("--headless") + mobile_chrome_browser_options.add_argument("--headless=new") Capybara::Selenium::Driver.new(app, browser: :chrome, options: mobile_chrome_browser_options) end diff --git a/test/run-qunit.js b/test/run-qunit.js index 23bebaeac82..bd26d62dc34 100644 --- a/test/run-qunit.js +++ b/test/run-qunit.js @@ -37,7 +37,7 @@ async function runAllTests() { const options = { chromeFlags: [ "--disable-gpu", - "--headless", + "--headless=new", "--no-sandbox", "--disable-dev-shm-usage", "--mute-audio",