mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 16:02:46 +08:00
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 <xfalcox@gmail.com>
This commit is contained in:
parent
4676524094
commit
dab37c1a5a
|
@ -96,7 +96,7 @@ module.exports = {
|
||||||
Chrome: [
|
Chrome: [
|
||||||
// --no-sandbox is needed when running Chrome inside a container
|
// --no-sandbox is needed when running Chrome inside a container
|
||||||
process.env.CI ? "--no-sandbox" : null,
|
process.env.CI ? "--no-sandbox" : null,
|
||||||
"--headless",
|
"--headless=new",
|
||||||
"--disable-dev-shm-usage",
|
"--disable-dev-shm-usage",
|
||||||
"--disable-software-rasterizer",
|
"--disable-software-rasterizer",
|
||||||
"--mute-audio",
|
"--mute-audio",
|
||||||
|
|
|
@ -297,7 +297,7 @@ RSpec.configure do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
Capybara.register_driver :selenium_chrome_headless do |app|
|
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)
|
Capybara::Selenium::Driver.new(app, browser: :chrome, options: chrome_browser_options)
|
||||||
end
|
end
|
||||||
|
@ -319,7 +319,7 @@ RSpec.configure do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
Capybara.register_driver :selenium_mobile_chrome_headless do |app|
|
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)
|
Capybara::Selenium::Driver.new(app, browser: :chrome, options: mobile_chrome_browser_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ async function runAllTests() {
|
||||||
const options = {
|
const options = {
|
||||||
chromeFlags: [
|
chromeFlags: [
|
||||||
"--disable-gpu",
|
"--disable-gpu",
|
||||||
"--headless",
|
"--headless=new",
|
||||||
"--no-sandbox",
|
"--no-sandbox",
|
||||||
"--disable-dev-shm-usage",
|
"--disable-dev-shm-usage",
|
||||||
"--mute-audio",
|
"--mute-audio",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user