base.ts 450 B

1234567891011121314151617
  1. import { test as base } from '@playwright/test';
  2. import { MockApi } from './mock-api';
  3. type Fixtures = {
  4. mockApi: MockApi;
  5. };
  6. export const test = base.extend<Fixtures>({
  7. mockApi: async ({ page }, use) => {
  8. const mockApi = new MockApi(page);
  9. // Always mock server-providers — called on every page load by root layout
  10. await mockApi.mockServerProviders();
  11. await use(mockApi);
  12. },
  13. });
  14. export { expect } from '@playwright/test';