calcom/playwright/auth/delete-account.test.ts
Yevhen Laichenkov 55f25d9194
fix/playwright test (#1533)
* add: playright-test eslint plugin

* add: missed awaits in playwright tests
2022-01-17 18:15:18 +00:00

29 lines
1 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("Can delete user account", async ({ page }) => {
// Login to account to delete
await page.goto(`/auth/login`);
// Click input[name="email"]
await page.click('input[name="email"]');
// Fill input[name="email"]
await page.fill('input[name="email"]', `delete-me@example.com`);
// Press Tab
await page.press('input[name="email"]', "Tab");
// Fill input[name="password"]
await page.fill('input[name="password"]', "delete-me");
// Press Enter
await page.press('input[name="password"]', "Enter");
await page.waitForSelector("[data-testid=dashboard-shell]");
await page.goto(`/settings/profile`);
await page.click("[data-testid=delete-account]");
await expect(page.locator(`[data-testid=delete-account-confirm]`)).toBeVisible();
await Promise.all([
page.waitForNavigation({ url: "/auth/logout" }),
page.click("[data-testid=delete-account-confirm]"),
]);
await expect(page.locator(`[id="modal-title"]`)).toHaveText("You've been logged out");
});