Skip to content

Commit

Permalink
Pasan todos los tests, un saludo
Browse files Browse the repository at this point in the history
  • Loading branch information
CANCI0 committed Apr 26, 2024
1 parent aa212f5 commit 74e5cd1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion webapp/e2e/steps/create-group.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" });
Expand Down
15 changes: 9 additions & 6 deletions webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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 () => {
Expand Down

0 comments on commit 74e5cd1

Please sign in to comment.