From 9a3254cd53d94d19d0aee3a618fd53be16bc3bac Mon Sep 17 00:00:00 2001 From: "Dario G. Mori" Date: Sun, 5 May 2024 18:15:01 +0200 Subject: [PATCH] fix: about_positive_non_logged_user_seeing_about_screen.steps.js --- webapp/e2e/jest.config.js | 3 ++- ..._non_logged_user_seeing_about_screen.steps.js | 16 +--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/webapp/e2e/jest.config.js b/webapp/e2e/jest.config.js index 461bc936..2112e935 100644 --- a/webapp/e2e/jest.config.js +++ b/webapp/e2e/jest.config.js @@ -1,5 +1,6 @@ module.exports = { - testMatch: ["**/playing_full_game_pos*.steps.js","**/about.steps.js", "**/login_positive.steps.js","**/about_positive_logged_user_seeing_about_screen.steps.js"], + testMatch: ["**/playing_full_game_pos*.steps.js","**/about.steps.js", "**/login_positive.steps.js","**/about_positive_logged_user_seeing_about_screen.steps.js" + ,"**/about_positive_non_logged_user_seeing_about_screen.steps.js"], moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], testTimeout: 30000 } \ No newline at end of file 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 5004e42d..aed45e63 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 @@ -1,5 +1,3 @@ -import { waitForPageToLoad } from '../e2e_utils/e2e_utils_timeout.js'; - const { defineFeature, loadFeature }=require('jest-cucumber'); const puppeteer = require('puppeteer'); const setDefaultOptions = require("expect-puppeteer").setDefaultOptions; @@ -9,10 +7,6 @@ let browser; defineFeature(feature, test => { - let username = "t.about.pos" - let user; - let password; - beforeAll(async () => { browser = process.env.GITHUB_ACTIONS ? await puppeteer.launch() @@ -26,14 +20,6 @@ defineFeature(feature, test => { waitUntil: "networkidle0", }) .catch(() => {}); - - // Registering the user before the tests - let credentials = registerUserFromRootDirectory(username, page); - email = credentials[0]; - username = credentials[1]; - - // Logging it out - logOutUser(page); }, 120000); test("A non-logged user wants to see the about screen of the webpage", ({given,when,and,then}) => { @@ -51,7 +37,7 @@ defineFeature(feature, test => { }); then("The user is presented to the about screen", async () => { - waitForPageToLoad(); + await new Promise(resolve => setTimeout(resolve, 5000)); // Waiting for page to fully load let header = await page.$eval("h2", (element) => { return element.innerHTML })