calcom/apps/web/playwright/auth/forgot-password.test.ts
Omar López ec58a9dd70
The Dotenv Refactor (#2275)
* dotenv refactoring

* dotenv fixes

* Env variables cleanup

* Updates e2e variables

* Moves environment file to types

* Removes conflicting configs

* Readds missing variables

* Fixes

* More fixes

* Update .env.example

* Update yarn.lock

* Update turbo.json

* Fixes e2e

* Temp fix

* disables cache for lint

* Please work

* I'm getting desperate here.

* Matches node versions

* Take 2

* Revert "Take 2"

This reverts commit a735f47f2325c2040168e0cd99dea0fc357a791f.

* Update .env.example
2022-03-25 17:39:38 -07:00

42 lines
1.3 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("Can reset forgotten password", async ({ page }) => {
// Got to reset password flow
await page.goto("/auth/forgot-password");
// Fill [placeholder="john.doe@example.com"]
await page.fill('input[name="email"]', "pro@example.com");
// Press Enter
await Promise.all([
page.waitForNavigation({
url: "/auth/forgot-password/*",
}),
page.press('input[name="email"]', "Enter"),
]);
// Wait for page to fully load
await page.waitForSelector("text=Reset Password");
// Fill input[name="password"]
await page.fill('input[name="password"]', "pro");
// Click text=Submit
await page.click('button[type="submit"]');
await page.waitForSelector("text=Success", {
timeout: 3000,
});
await expect(page.locator(`text=Success`)).toBeVisible();
// Click button:has-text("Login")
await Promise.all([page.waitForNavigation({ url: "/auth/login" }), page.click('button:has-text("Login")')]);
// Fill input[name="email"]
await page.fill('input[name="email"]', "pro@example.com");
await page.fill('input[name="password"]', "pro");
await page.press('input[name="password"]', "Enter");
await page.waitForSelector("[data-testid=dashboard-shell]");
await expect(page.locator("[data-testid=dashboard-shell]")).toBeVisible();
});