playwright/tests/components/ct-vue-cli/playwright/index.ts

17 lines
486 B
TypeScript
Raw Normal View History

2022-08-23 20:35:43 +02:00
import { beforeMount, afterMount } from '@playwright/experimental-ct-vue/hooks';
2022-11-08 17:40:29 +01:00
import { router } from '../src/router';
import '../src/assets/index.css';
2022-08-23 20:35:43 +02:00
2022-10-18 22:04:54 +02:00
export type HooksConfig = {
route: string;
}
beforeMount<HooksConfig>(async ({ app, hooksConfig }) => {
2022-11-08 17:40:29 +01:00
app.use(router);
2022-08-23 20:35:43 +02:00
console.log(`Before mount: ${JSON.stringify(hooksConfig)}, app: ${!!app}`);
});
2022-10-18 22:04:54 +02:00
afterMount<HooksConfig>(async ({ instance }) => {
2022-08-23 20:35:43 +02:00
console.log(`After mount el: ${instance.$el.constructor.name}`);
});