Files
calendar/apps/web/playwright/change-password.e2e.ts
T
50d2dad62c fix: Toast Onclose is removing specific toast (#9960)
* toast behaviour fixed

* Update showToast.tsx

* Adjust E2E test for toast

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-07-25 22:27:14 +00:00

31 lines
880 B
TypeScript

import { expect } from "@playwright/test";
import { test } from "./lib/fixtures";
test.afterEach(({ users }) => users.deleteAll());
test.describe("Change Password Test", () => {
test("change password", async ({ page, users }) => {
const pro = await users.create();
await pro.apiLogin();
// Go to http://localhost:3000/settings/security
await page.goto("/settings/security/password");
expect(pro.username).toBeTruthy();
await page.waitForLoadState("networkidle");
// Fill form
await page.locator('[name="oldPassword"]').fill(String(pro.username));
const $newPasswordField = page.locator('[name="newPassword"]');
$newPasswordField.fill(`${pro.username}Aa1111`);
await page.locator("text=Update").click();
const toast = await page.waitForSelector('[data-testid="toast-success"]');
expect(toast).toBeTruthy();
});
});