From 6b424e37221c588c8b6031eb1598ce77a3265144 Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Sun, 5 May 2024 21:17:58 +0200 Subject: [PATCH] fix: added timeout --- ...about_positive_non_logged_user_seeing_about_screen.steps.js | 2 +- webapp/e2e/steps/logout_positive_logged_user.steps.js | 3 ++- webapp/e2e/steps/seeing_rules_positive.steps.js | 3 ++- webapp/e2e/steps/seeing_stats_positive.steps.js | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webapp/e2e/steps/about_positive_non_logged_user_seeing_about_screen.steps.js b/webapp/e2e/steps/about_positive_non_logged_user_seeing_about_screen.steps.js index 28d0ac4f..86d271c2 100644 --- a/webapp/e2e/steps/about_positive_non_logged_user_seeing_about_screen.steps.js +++ b/webapp/e2e/steps/about_positive_non_logged_user_seeing_about_screen.steps.js @@ -9,7 +9,7 @@ let browser; defineFeature(feature, test => { beforeAll(async () => { browser = process.env.GITHUB_ACTIONS - ? await puppeteer.launch() + ? await puppeteer.launch({ ignoreHTTPSErrors: true}) : await puppeteer.launch({ headless: false, slowMo: 100, ignoreHTTPSErrors: true }); page = await browser.newPage(); //Way of setting up the timeout diff --git a/webapp/e2e/steps/logout_positive_logged_user.steps.js b/webapp/e2e/steps/logout_positive_logged_user.steps.js index 535d607f..8bc91a95 100644 --- a/webapp/e2e/steps/logout_positive_logged_user.steps.js +++ b/webapp/e2e/steps/logout_positive_logged_user.steps.js @@ -38,7 +38,8 @@ defineFeature(feature, test => { }); and('User presses the log out button', async() => { - await expect(page).toClick("button[data-testid='LogOut']"); + await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load + await expect(page).toClick("button[data-testid='LogOut']"); }); diff --git a/webapp/e2e/steps/seeing_rules_positive.steps.js b/webapp/e2e/steps/seeing_rules_positive.steps.js index afd61b96..2b941522 100644 --- a/webapp/e2e/steps/seeing_rules_positive.steps.js +++ b/webapp/e2e/steps/seeing_rules_positive.steps.js @@ -64,7 +64,8 @@ defineFeature(feature, test => { }); and('The user presses the button for seeing the rules', async() => { - await expect(page).toClick("button[data-testid='rules']"); + await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load + await expect(page).toClick("button[data-testid='rules']"); }); diff --git a/webapp/e2e/steps/seeing_stats_positive.steps.js b/webapp/e2e/steps/seeing_stats_positive.steps.js index 55e70202..5d1eac41 100644 --- a/webapp/e2e/steps/seeing_stats_positive.steps.js +++ b/webapp/e2e/steps/seeing_stats_positive.steps.js @@ -65,7 +65,8 @@ defineFeature(feature, test => { }); and('The user presses the button for seeing stats', async() => { - await expect(page).toClick("button[data-testid='statistics']"); + await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load + await expect(page).toClick("button[data-testid='statistics']"); });