mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 05:06:35 +00:00
test: auth/change password
Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
committed by
Muhammed Mustafa
parent
5845745fd5
commit
773023b954
62
scripts/playwright/tests/authChangePassword.spec.ts
Normal file
62
scripts/playwright/tests/authChangePassword.spec.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { DashboardPage } from "../pages/Dashboard";
|
||||
import setup from "../setup";
|
||||
import { ToolbarPage } from "../pages/Dashboard/common/Toolbar";
|
||||
import { LoginPage } from "../pages/LoginPage";
|
||||
|
||||
test.describe("Auth", () => {
|
||||
let dashboard: DashboardPage;
|
||||
let toolbar: ToolbarPage;
|
||||
let context: any;
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
context = await setup({ page });
|
||||
dashboard = new DashboardPage(page, context.project);
|
||||
toolbar = dashboard.grid.toolbar;
|
||||
});
|
||||
|
||||
test("Change password", async ({ page }) => {
|
||||
await dashboard.clickHome();
|
||||
await dashboard.openPasswordChangeModal();
|
||||
|
||||
// Existing active pass incorrect
|
||||
await dashboard.changePassword({
|
||||
oldPass: "123456789",
|
||||
newPass: "123456789",
|
||||
repeatPass: "123456789",
|
||||
});
|
||||
await dashboard.rootPage
|
||||
.locator(
|
||||
'[data-cy="nc-user-settings-form__error"]:has-text("Current password is wrong")'
|
||||
)
|
||||
.waitFor();
|
||||
|
||||
// New pass and repeat pass mismatch
|
||||
await dashboard.changePassword({
|
||||
oldPass: "Password123.",
|
||||
newPass: "123456789",
|
||||
repeatPass: "987654321",
|
||||
});
|
||||
await dashboard.rootPage
|
||||
.locator(
|
||||
'.ant-form-item-explain-error:has-text("Passwords do not match")'
|
||||
)
|
||||
.waitFor();
|
||||
|
||||
// All good
|
||||
await dashboard.changePassword({
|
||||
oldPass: "Password123.",
|
||||
newPass: "NewPasswordConfigured",
|
||||
repeatPass: "NewPasswordConfigured",
|
||||
});
|
||||
|
||||
const loginPage = new LoginPage(page);
|
||||
await loginPage.fillEmail("user@nocodb.com");
|
||||
await loginPage.fillPassword("NewPasswordConfigured");
|
||||
await loginPage.submit();
|
||||
|
||||
await page
|
||||
.locator('.nc-project-page-title:has-text("My Projects")')
|
||||
.waitFor();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user