30 lines
867 B
TypeScript
30 lines
867 B
TypeScript
import { test as base } from '@playwright/test';
|
|
import { PerformanceMonitor } from '../utils/performance/PerformanceMonitor';
|
|
import { LighthouseRunner } from '../utils/performance/LighthouseRunner';
|
|
import { CoreWebVitals } from '../utils/performance/CoreWebVitals';
|
|
|
|
type MyFixtures = {
|
|
performanceMonitor: PerformanceMonitor;
|
|
lighthouseRunner: LighthouseRunner;
|
|
coreWebVitals: CoreWebVitals;
|
|
};
|
|
|
|
export const test = base.extend<MyFixtures>({
|
|
performanceMonitor: async ({ page }, use) => {
|
|
const monitor = new PerformanceMonitor(page);
|
|
await use(monitor);
|
|
},
|
|
|
|
lighthouseRunner: async ({ page }, use) => {
|
|
const runner = new LighthouseRunner(page);
|
|
await use(runner);
|
|
},
|
|
|
|
coreWebVitals: async ({ page }, use) => {
|
|
const vitals = new CoreWebVitals(page);
|
|
await use(vitals);
|
|
}
|
|
});
|
|
|
|
export { expect } from '@playwright/test';
|