2022-03-28 20:06:41 +00:00
|
|
|
import { test as base } from "@playwright/test";
|
|
|
|
|
2022-05-14 03:02:10 +00:00
|
|
|
import { createBookingsFixture } from "../fixtures/bookings";
|
|
|
|
import { createPaymentsFixture } from "../fixtures/payments";
|
2022-03-28 20:06:41 +00:00
|
|
|
import { createUsersFixture } from "../fixtures/users";
|
|
|
|
|
|
|
|
interface Fixtures {
|
2022-04-06 15:13:09 +00:00
|
|
|
users: ReturnType<typeof createUsersFixture>;
|
2022-05-14 03:02:10 +00:00
|
|
|
bookings: ReturnType<typeof createBookingsFixture>;
|
|
|
|
payments: ReturnType<typeof createPaymentsFixture>;
|
2022-03-28 20:06:41 +00:00
|
|
|
}
|
|
|
|
|
2022-05-14 03:02:10 +00:00
|
|
|
/**
|
|
|
|
* @see https://playwright.dev/docs/test-fixtures
|
|
|
|
*/
|
2022-03-28 20:06:41 +00:00
|
|
|
export const test = base.extend<Fixtures>({
|
2022-05-14 03:02:10 +00:00
|
|
|
users: async ({ page }, use, workerInfo) => {
|
|
|
|
const usersFixture = createUsersFixture(page, workerInfo);
|
2022-03-28 20:06:41 +00:00
|
|
|
await use(usersFixture);
|
|
|
|
},
|
2022-05-14 03:02:10 +00:00
|
|
|
bookings: async ({ page }, use) => {
|
|
|
|
const bookingsFixture = createBookingsFixture(page);
|
|
|
|
await use(bookingsFixture);
|
|
|
|
},
|
|
|
|
payments: async ({ page }, use) => {
|
|
|
|
const payemntsFixture = createPaymentsFixture(page);
|
|
|
|
await use(payemntsFixture);
|
|
|
|
},
|
2022-03-28 20:06:41 +00:00
|
|
|
});
|