Skip to content

Commit

Permalink
Switch headless mode to new due to chrome update
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Feb 22, 2023
1 parent 069b1c1 commit c14b332
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/selenium.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test("Selenium Chrome test", async () => {
// Save file incase there is a layout change
const source = await driver.getPageSource();

fs.mkdirSync("./test-results");
if (!fs.existsSync("./test-results")) fs.mkdirSync("./test-results");
fs.writeFileSync("./test-results/source.html", source);

throw e;
Expand All @@ -55,7 +55,7 @@ async function setup(): Promise<WebDriver> {
options.addArguments("--load-extension=" + Path.join(__dirname, "../dist/"));
options.addArguments("--mute-audio");
options.addArguments("--disable-features=PreloadMediaEngagementData, MediaEngagementBypassAutoplayPolicies");
options.addArguments("--headless=chrome");
options.addArguments("--headless=new");
options.addArguments("--window-size=1920,1080");

const driver = await new Builder().forBrowser("chrome").setChromeOptions(options).build();
Expand Down

0 comments on commit c14b332

Please sign in to comment.