Skip to content

Commit

Permalink
A ver si ye de esta
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 26, 2024
1 parent 3a5122c commit ee489d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ defineFeature(feature, (test) => {
await page.type("#login-username", username);
await page.waitForSelector("#login-password");
await page.type("#login-password", password);

await page.evaluate(() => {
localStorage.setItem("username",username);
localStorage.setItem("token","abcdefg");
});

await page.click("button", { text: "Login" });
});

Expand Down
10 changes: 8 additions & 2 deletions webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,24 @@ defineFeature(feature, (test) => {

when("I fill the data in the form and press submit", async () => {
username = generateUUID();
password = generateUUID();
password = "HOLApass1234";
await page.waitForSelector("#register-username");
await page.type("#register-username", username);
await page.waitForSelector("#register-password");
await page.type("#register-password", password);
await page.waitForSelector("#register-pass2");
await page.type("#register-pass2", password);

await page.evaluate(() => {
localStorage.setItem("username",username);
localStorage.setItem("token","abcdefg");
});

await page.click("button", { text: "Registrarse" });
});

then("The home screen should be shown", async () => {
await page.waitForTimeout(1000);
await page.waitForTimeout(2000);
const url = page.url();
expect(url).toContain("/home");
browser.close();
Expand Down

0 comments on commit ee489d8

Please sign in to comment.