From 23211ae065833796162198e97b5a84fa97a0414d Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Wed, 6 Jan 2021 13:50:34 +0100 Subject: [PATCH] Click on download and print buttons using element.click function in scripting integration tests --- test/integration/scripting_spec.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/integration/scripting_spec.js b/test/integration/scripting_spec.js index 490eedb745cd71..a1016509d6e895 100644 --- a/test/integration/scripting_spec.js +++ b/test/integration/scripting_spec.js @@ -307,8 +307,12 @@ describe("Interaction", () => { if (process.platform === "win32" && browserName === "firefox") { pending("Disabled in Firefox on Windows, because of bug 1662471."); } + await page.waitForSelector("#print", { + timeout: 0, + }); + let text = await actAndWaitForInput(page, "#\\34 7R", async () => { - await page.click("#print"); + await page.evaluate(() => document.querySelector("#print").click()); }); expect(text).withContext(`In ${browserName}`).toEqual("WillPrint"); @@ -337,6 +341,10 @@ describe("Interaction", () => { it("must execute WillSave and DidSave actions", async () => { await Promise.all( pages.map(async ([browserName, page]) => { + await page.waitForSelector("#download", { + timeout: 0, + }); + try { // Disable download in chrome // (it leads to an error in firefox so the try...) @@ -346,7 +354,9 @@ describe("Interaction", () => { } catch (_) {} await clearInput(page, "#\\34 7R"); let text = await actAndWaitForInput(page, "#\\34 7R", async () => { - await page.click("#download"); + await page.evaluate(() => + document.querySelector("#download").click() + ); }); expect(text).withContext(`In ${browserName}`).toEqual("WillSave");