playwright/tests/components/ct-vue-cli/playwright/index.ts
2022-11-08 08:40:29 -08:00

17 lines
486 B
TypeScript

import { beforeMount, afterMount } from '@playwright/experimental-ct-vue/hooks';
import { router } from '../src/router';
import '../src/assets/index.css';
export type HooksConfig = {
route: string;
}
beforeMount<HooksConfig>(async ({ app, hooksConfig }) => {
app.use(router);
console.log(`Before mount: ${JSON.stringify(hooksConfig)}, app: ${!!app}`);
});
afterMount<HooksConfig>(async ({ instance }) => {
console.log(`After mount el: ${instance.$el.constructor.name}`);
});