cal/apps/web/playwright/change-password.e2e.ts
Alex van Andel fc74b686b6
Hotfix/fix tests (#4494)
* Comment userv2Banner

* Fixed wipemycal test

* Fixed 'Delete my account' and WipeMyCal tests

* Fixed at least one test, need stripe for others.

* Disable embed tests for now

* Fixed console error due to illegal setState

* Hopefully fixed change-password functionality

* Partially implement new team flow

* Fix Change password test by setting a password with both capital and small letters

* recurring event text fix

* Fixed hash-my-url test

* Fixed event-types tests, done?

* fixing event type edit first event e2e

* Temp disable

Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Leo Giovanetti <hello@leog.me>
2022-09-15 16:59:48 +00:00

30 lines
918 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.login();
// Go to http://localhost:3000/settings/security
await page.goto("/settings/security/password");
if (!pro.username) throw Error("Test user doesn't have a username");
await page.waitForLoadState("networkidle");
// Fill form
await page.locator('[name="oldPassword"]').fill(pro.username);
const $newPasswordField = page.locator('[name="newPassword"]');
$newPasswordField.fill(`${pro.username}Aa1111`);
await page.locator("text=Update").click();
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
await expect(toast).toBeTruthy();
});
});