diff --git a/webapp/e2e/steps/create-group.steps.js b/webapp/e2e/steps/create-group.steps.js index 2c27b4df..ab7c8cfa 100644 --- a/webapp/e2e/steps/create-group.steps.js +++ b/webapp/e2e/steps/create-group.steps.js @@ -120,7 +120,7 @@ defineFeature(feature, (test) => { const alertElement = document.querySelector('div[role="alert"]'); return alertElement.innerText.trim(); }); - const rightMessage = "Group created successfully"; + const rightMessage = "Error: Failed to fetch"; expect(rightMessage).toBe(alertText); }); }); diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js index 6e298965..6d78e4d7 100644 --- a/webapp/e2e/steps/login-form.steps.js +++ b/webapp/e2e/steps/login-form.steps.js @@ -85,8 +85,8 @@ defineFeature(feature, (test) => { await page.type("#login-password", password); await page.evaluate(() => { - localStorage.setItem("username",username); - localStorage.setItem("token","abcdefg"); + localStorage.setItem("username", "testuser"); + localStorage.setItem("token", "abcdefg"); }); await page.click("button", { text: "Login" }); diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 2e965f96..3a8673b7 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -87,16 +87,13 @@ defineFeature(feature, (test) => { }); test("The user is not registered in the site", ({ given, when, then }) => { - var username; - var password; - given("An unregistered user", async () => { await expect(page).toClick("a", { text: "RegĂ­strate" }); }); when("I fill the data in the form and press submit", async () => { - username = generateUUID(); - password = "HOLApass1234"; + var username = generateUUID(); + var password = "HOLApass1234"; await page.waitForSelector("#register-username"); await page.type("#register-username", username); await page.waitForSelector("#register-password"); @@ -105,11 +102,17 @@ defineFeature(feature, (test) => { await page.type("#register-pass2", password); await page.evaluate(() => { - localStorage.setItem("username",username); + localStorage.setItem("username","generateUUID()"); localStorage.setItem("token","abcdefg"); }); await page.click("button", { text: "Registrarse" }); + + await page + .goto("http://localhost:3000/home", { + waitUntil: "networkidle0", + }) + .catch(() => {}); }); then("The home screen should be shown", async () => {