Fix E2E Tests and Fix broken success page and non existing user URL (#2411)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2022-04-07 08:34:19 +01:00
1 parent 652b15c9e7
commit 31a8f25bb6
7 files changed
+11 -8

No files matched your search

@@ -1,6 +1,7 @@
import { expect, test } from "@playwright/test";
test("Can delete user account", async ({ page }) => {
//FIXME: This test depends on seed.
// Login to account to delete
await page.goto(`/auth/login`);
// Click input[name="email"]
+2 -2
View File
@@ -77,11 +77,11 @@ test.describe("pro user", () => {
test.use({ storageState: "playwright/artifacts/proStorageState.json" });
test.beforeEach(async ({ page }) => {
await deleteAllBookingsByEmail("[email protected]");
await page.goto("/pro");
});
test.afterAll(async () => {
// delete test bookings
test.afterEach(async () => {
await deleteAllBookingsByEmail("[email protected]");
});
@@ -12,6 +12,8 @@ test.describe("dynamic booking", () => {
test.use({ storageState: "playwright/artifacts/proStorageState.json" });
test.beforeEach(async ({ page }) => {
await deleteAllBookingsByEmail("[email protected]");
await deleteAllBookingsByEmail("[email protected]");
await page.goto("/pro+free");
});
+2 -2
View File
@@ -72,7 +72,7 @@ export async function selectFirstAvailableTimeSlotNextMonth(page: Page) {
// @TODO: Find a better way to make test wait for full month change render to end
// so it can click up on the right day, also when resolve remove other todos
// Waiting for full month increment
await page.waitForTimeout(400);
await page.waitForTimeout(1000);
// TODO: Find out why the first day is always booked on tests
await page.locator('[data-testid="day"][data-disabled="false"]').nth(1).click();
await page.click('[data-testid="time"]');
@@ -83,7 +83,7 @@ export async function selectSecondAvailableTimeSlotNextMonth(page: Page) {
// @TODO: Find a better way to make test wait for full month change render to end
// so it can click up on the right day, also when resolve remove other todos
// Waiting for full month increment
await page.waitForTimeout(400);
await page.waitForTimeout(1000);
// TODO: Find out why the first day is always booked on tests
await page.locator('[data-testid="day"][data-disabled="false"]').nth(1).click();
await page.locator('[data-testid="time"]').nth(1).click();