From 730308e3089591949510200e4d9bc6b7416a18ac Mon Sep 17 00:00:00 2001 From: sgiehl Date: Tue, 19 Sep 2023 17:10:33 +0200 Subject: [PATCH] avoid unnecessary screenshots in updater tests --- plugins/Login/tests/UI/Invite_spec.js | 4 ++-- .../expected-screenshots/OneClickLastForcedUpdate_login.png | 3 --- tests/UI/expected-screenshots/OneClickUpdate_login.png | 3 --- tests/UI/specs/OneClickLastForcedUpdate_spec.js | 6 +++--- tests/UI/specs/OneClickUpdate_spec.js | 6 +++--- 5 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 tests/UI/expected-screenshots/OneClickLastForcedUpdate_login.png delete mode 100644 tests/UI/expected-screenshots/OneClickUpdate_login.png diff --git a/plugins/Login/tests/UI/Invite_spec.js b/plugins/Login/tests/UI/Invite_spec.js index 290023b282a9..5af16b14342f 100644 --- a/plugins/Login/tests/UI/Invite_spec.js +++ b/plugins/Login/tests/UI/Invite_spec.js @@ -45,7 +45,7 @@ describe('Invite', function () { $('#login_form_submit').click(); }); // should show site without data page - await page.waitForNetworkIdle(); - await page.waitForSelector('#site-without-data'); + await page.waitForSelector('#site-without-data', {visible: true}); + await page.evaluate(() => window.stop()); // stop ongoing requests }); }); diff --git a/tests/UI/expected-screenshots/OneClickLastForcedUpdate_login.png b/tests/UI/expected-screenshots/OneClickLastForcedUpdate_login.png deleted file mode 100644 index 68246f652205..000000000000 --- a/tests/UI/expected-screenshots/OneClickLastForcedUpdate_login.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7632ac01c132e5db315407e5da5ebf727a0975c5a0aae4c9bcd321e3074b63a8 -size 243879 diff --git a/tests/UI/expected-screenshots/OneClickUpdate_login.png b/tests/UI/expected-screenshots/OneClickUpdate_login.png deleted file mode 100644 index 68246f652205..000000000000 --- a/tests/UI/expected-screenshots/OneClickUpdate_login.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7632ac01c132e5db315407e5da5ebf727a0975c5a0aae4c9bcd321e3074b63a8 -size 243879 diff --git a/tests/UI/specs/OneClickLastForcedUpdate_spec.js b/tests/UI/specs/OneClickLastForcedUpdate_spec.js index 29a706dd10df..0acdade238df 100644 --- a/tests/UI/specs/OneClickLastForcedUpdate_spec.js +++ b/tests/UI/specs/OneClickLastForcedUpdate_spec.js @@ -90,9 +90,9 @@ describe("OneClickLastForcedUpdate", function () { } } - await page.waitForSelector('#start-tracking-method-list', { visible: true }); - await page.waitForNetworkIdle(); - expect(await element.screenshot()).to.matchImage('login'); + // avoid taking an unnecessary screenshot, as knowing we land on #site-without-data is enough + await page.waitForSelector('#site-without-data', { visible: true }); + await page.evaluate(() => window.stop()); // stop ongoing requests }); it('should have a working cron archiving process', async function () { diff --git a/tests/UI/specs/OneClickUpdate_spec.js b/tests/UI/specs/OneClickUpdate_spec.js index cfb83e2c473c..721bdeabdcf7 100644 --- a/tests/UI/specs/OneClickUpdate_spec.js +++ b/tests/UI/specs/OneClickUpdate_spec.js @@ -96,9 +96,9 @@ describe("OneClickUpdate", function () { } } - await page.waitForSelector('#start-tracking-method-list', { visible: true }); - await page.waitForNetworkIdle(); - expect(await element.screenshot()).to.matchImage('login'); + // avoid taking an unnecessary screenshot, as knowing we land on #site-without-data is enough + await page.waitForSelector('#site-without-data', { visible: true }); + await page.evaluate(() => window.stop()); // stop ongoing requests }); it('should have a working cron archiving process', async function () {