2022-09-02 02:00:48 +00:00
|
|
|
import { expect } from "@playwright/test";
|
|
|
|
|
|
|
|
import { test } from "./lib/fixtures";
|
|
|
|
|
|
|
|
test.afterEach(({ users }) => users.deleteAll());
|
|
|
|
|
2022-09-07 23:29:24 +00:00
|
|
|
test.describe("Change Password Test", () => {
|
2022-09-02 02:00:48 +00:00
|
|
|
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");
|
|
|
|
if (!pro.username) throw Error("Test user doesn't have a username");
|
|
|
|
|
|
|
|
// Fill form
|
2022-09-07 23:29:24 +00:00
|
|
|
await page.waitForSelector('[name="current_password"]');
|
2022-09-02 02:00:48 +00:00
|
|
|
await page.fill('[name="current_password"]', pro.username);
|
|
|
|
await page.fill('[name="new_password"]', `${pro.username}1111`);
|
|
|
|
await page.press('[name="new_password"]', "Enter");
|
|
|
|
|
|
|
|
await expect(page.locator(`text=Your password has been successfully changed.`)).toBeVisible();
|
|
|
|
});
|
|
|
|
});
|