Skip to content

Commit

Permalink
Switch to headless browsers on the bots
Browse files Browse the repository at this point in the history
The UI is of no use on the bots since we can only see the console logs,
so not having to start it might be faster and less error-prone.
  • Loading branch information
timvandermeij committed Jul 26, 2020
1 parent 8f6dcf8 commit cc246d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ function unitTestPostHandler(req, res) {
return true;
}

async function startBrowser(browserName, startUrl) {
async function startBrowser(browserName, startUrl, headless = false) {
const revisions = require("puppeteer/package.json").puppeteer;
const wantedRevision =
browserName === "chrome"
Expand All @@ -788,7 +788,7 @@ async function startBrowser(browserName, startUrl) {

const browser = await puppeteer.launch({
product: browserName,
headless: false,
headless,
defaultViewport: null,
// Firefox must complete its execution before starting, mainly on Windows.
// Refer to https://github.com/puppeteer/puppeteer/issues/5376 and
Expand Down Expand Up @@ -828,8 +828,9 @@ function startBrowsers(rootUrl, initSessionCallback) {
`&delay=${options.statsDelay}` +
`&masterMode=${options.masterMode}`;
const startUrl = rootUrl + queryParameters;
const headless = options.strictVerify;

startBrowser(browserName, startUrl)
startBrowser(browserName, startUrl, headless)
.then(function (browser) {
session.browser = browser;
if (initSessionCallback) {
Expand Down

0 comments on commit cc246d3

Please sign in to comment.