diff --git a/webapp/e2e/steps/login_register_negative_incorrect_credentials.steps.js b/webapp/e2e/steps/login_register_negative_incorrect_credentials.steps.js index 66b941fc..1aaeb444 100644 --- a/webapp/e2e/steps/login_register_negative_incorrect_credentials.steps.js +++ b/webapp/e2e/steps/login_register_negative_incorrect_credentials.steps.js @@ -9,8 +9,8 @@ let browser; defineFeature(feature, test => { let username = "t.login.neg.bad_crd" - let user; - let password; + let user = "@email.com"; + let password = "wrongpassword"; beforeAll(async () => { browser = process.env.GITHUB_ACTIONS diff --git a/webapp/e2e/steps/logout_positive_logged_user.steps.js b/webapp/e2e/steps/logout_positive_logged_user.steps.js index d06f8633..5c32d1a1 100644 --- a/webapp/e2e/steps/logout_positive_logged_user.steps.js +++ b/webapp/e2e/steps/logout_positive_logged_user.steps.js @@ -23,21 +23,16 @@ defineFeature(feature, test => { }) .catch(() => {}); - // Registering the user before the tests - await registerUserFromRootDirectory(username, page); + + // Logging it out + await logOutUser(page); }, 120000); test("A logged user wants to log out the webpage", ({given,when,and,then}) => { - let gameURL = "http://localhost:3000/dashboard/game"; - given('A logged user in main menu', async () => { - await new Promise(resolve => setTimeout(resolve, 5000)); - let newHeader = await page.$eval("h2", (element) => { - return element.innerHTML - }) - let newValue = newHeader === "Bienvenid@ " + username || header === "Welcome " + username; - expect(newValue).toBeTruthy(); + // Registering the user before the tests + await registerUserFromRootDirectory(username, page); }); when('User presses the button for deploying the lateral menu', async() => { @@ -91,3 +86,4 @@ async function registerUserFromRootDirectory(username, page) { return [email, password]; } + diff --git a/webapp/e2e/steps/playing_game_negative_non_logged_user.steps.js b/webapp/e2e/steps/playing_game_negative_non_logged_user.steps.js index f1674fd7..320abdb4 100644 --- a/webapp/e2e/steps/playing_game_negative_non_logged_user.steps.js +++ b/webapp/e2e/steps/playing_game_negative_non_logged_user.steps.js @@ -1,8 +1,3 @@ -import { registerUserFromRootDirectory}from '../e2e_utils/e2e_utils_register.js'; -import { waitForPageToLoad } from '../e2e_utils/e2e_utils_timeout.js'; -import { logOutUser } from '../e2e_utils/e2e_utils_logout.js'; -import { loginUserFromRootDirectory } from '../e2e_utils/e2e_utils_login.js' - const { defineFeature, loadFeature }=require('jest-cucumber'); const puppeteer = require('puppeteer'); const setDefaultOptions = require("expect-puppeteer").setDefaultOptions; diff --git a/webapp/e2e/steps/seeing_rules_positive.steps.js b/webapp/e2e/steps/seeing_rules_positive.steps.js index 18fec061..afd61b96 100644 --- a/webapp/e2e/steps/seeing_rules_positive.steps.js +++ b/webapp/e2e/steps/seeing_rules_positive.steps.js @@ -8,8 +8,8 @@ let browser; defineFeature(feature, test => { let username = "t.rules.pos" - let user; - let password; + let user = username + "@email.com"; + let password = username + "psw"; beforeAll(async () => { browser = process.env.GITHUB_ACTIONS diff --git a/webapp/e2e/steps/seeing_stats_positive.steps.js b/webapp/e2e/steps/seeing_stats_positive.steps.js index 87c83dd0..55e70202 100644 --- a/webapp/e2e/steps/seeing_stats_positive.steps.js +++ b/webapp/e2e/steps/seeing_stats_positive.steps.js @@ -8,8 +8,8 @@ let browser; defineFeature(feature, test => { let username = "t.stats.pos" - let user; - let password; + let user = username + "@email.com"; + let password = username +"psw"; beforeAll(async () => {