From 3573df0914c207d2d70b4f74e4d3e7b582f55fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Su=C3=A1rez=20Losada?= Date: Sat, 4 May 2024 16:18:09 +0200 Subject: [PATCH] test: the previous attempt failed, im almost copy pasting the working code on the failing one as it failed on the h2 selector --- webapp/e2e/jest.config.js | 2 +- webapp/e2e/steps/playing_full_game_positive.steps.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/webapp/e2e/jest.config.js b/webapp/e2e/jest.config.js index a350a40c..6de0bd2a 100644 --- a/webapp/e2e/jest.config.js +++ b/webapp/e2e/jest.config.js @@ -1,5 +1,5 @@ module.exports = { - testMatch: ["**/register_positive*.steps.js"], + testMatch: ["**/playing_full_game_pos*.steps.js"], moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], testTimeout: 30000 } \ No newline at end of file diff --git a/webapp/e2e/steps/playing_full_game_positive.steps.js b/webapp/e2e/steps/playing_full_game_positive.steps.js index b9e40135..c44a92a8 100644 --- a/webapp/e2e/steps/playing_full_game_positive.steps.js +++ b/webapp/e2e/steps/playing_full_game_positive.steps.js @@ -9,9 +9,9 @@ let TEST_TIMEOUT = 300 * 1000; // 5minutes defineFeature(feature, test => { - let username = "t.playing.pos3" - let email; - let password; + let username = "t.playing.pos" + let email = username + "@gmail.com" + let password = username + ".psw" beforeAll(async () => { @@ -46,9 +46,9 @@ defineFeature(feature, test => { await expect(page).toClick("button[data-testid='Sign up'"); // Checking for the process to be correct - await new Promise(resolve => setTimeout(resolve, 5000)); + await new Promise(resolve => setTimeout(resolve, 6000)); // Checking user is in main screen - let header = await page.$eval("h2[data-testid='Welcome']", (element) => { + let header = await page.$eval("h2", (element) => { return element.innerHTML }) let value = header === "Bienvenid@ " + username || header === "Welcome " + username;