Skip to content

Commit

Permalink
chore: playwright stability (login) (evcc-io#17973)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored and jonilala796 committed Jan 3, 2025
1 parent 3580b55 commit 9b4ece9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/auth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ test("http iframe hint", async ({ page }) => {

test("update password", async ({ page }) => {
await start(BASIC, "password.sql", "");
await page.goto("/");

const oldPassword = "secret";
const newPassword = "newsecret";

// login modal
page.goto("/#/config");
const loginOld = page.getByTestId("login-modal");
await loginOld.getByLabel("Password").fill(oldPassword);
await loginOld.getByRole("button", { name: "Login" }).click();
await expect(loginOld).not.toBeVisible();
await page.goto("/#/config");
const loginModal = page.getByTestId("login-modal");
await expect(loginModal).toBeVisible();
await loginModal.getByLabel("Password").fill(oldPassword);
await loginModal.getByRole("button", { name: "Login" }).click();
await expect(loginModal).not.toBeVisible();

// update password
await page.getByTestId("generalconfig-password").getByRole("button", { name: "edit" }).click();
Expand All @@ -123,6 +123,7 @@ test("update password", async ({ page }) => {
await expect(page.getByRole("button", { name: "Logout" })).not.toBeVisible();
await page.getByRole("link", { name: "Configuration" }).click();
const loginNew = page.getByTestId("login-modal");
await expect(loginNew).toBeVisible();
await loginNew.getByLabel("Password").fill(newPassword);
await loginNew.getByRole("button", { name: "Login" }).click();
await expect(page.getByRole("heading", { name: "Configuration" })).toBeVisible();
Expand Down

0 comments on commit 9b4ece9

Please sign in to comment.