forked from calcom/cal.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Create password change test (calcom#1333)
- Loading branch information
1 parent
9b5da1b
commit 4537117
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect, test } from "@playwright/test"; | ||
|
||
// Using logged in state from globalSteup | ||
test.use({ storageState: "playwright/artifacts/proStorageState.json" }); | ||
|
||
test("change password", async ({ page }) => { | ||
// Try to go homepage | ||
await page.goto("/"); | ||
// It should redirect you to the event-types page | ||
await page.waitForSelector("[data-testid=event-types]"); | ||
|
||
// Go to http://localhost:3000/settings/security | ||
await page.goto("/settings/security"); | ||
|
||
// Fill form | ||
await page.fill('[name="current_password"]', "pro"); | ||
await page.fill('[name="new_password"]', "pro1"); | ||
await page.press('[name="new_password"]', "Enter"); | ||
|
||
expect(page.locator(`text=Your password has been successfully changed.`)).toBeTruthy(); | ||
|
||
// Let's revert back to prevent errors on other tests | ||
await page.fill('[name="current_password"]', "pro1"); | ||
await page.fill('[name="new_password"]', "pro"); | ||
await page.press('[name="new_password"]', "Enter"); | ||
|
||
expect(page.locator(`text=Your password has been successfully changed.`)).toBeTruthy(); | ||
}); |