Skip to content

Commit

Permalink
feat(playwright): force headless mode when running in the cloud (#2455)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy authored Feb 2, 2024
1 parent d68482d commit 1b6220c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/artillery-engine-playwright/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ class PlaywrightEngine {
self.launchOptions
);

if (process.env.WORKER_ID) {
if (launchOptions.headless) {
// Running inside a cloud worker, e.g. on AWS Fargate. Force headless mode
console.log('Running inside a cloud worker. Forcing Playwright headless mode to true');
launchOptions.headless = true;
}
}

const contextOptions = self.contextOptions || {};

let browser;
Expand Down

0 comments on commit 1b6220c

Please sign in to comment.