playwright/tests/components/ct-vue2-cli/playwright/index.js

18 lines
490 B
JavaScript
Raw Normal View History

import { beforeMount, afterMount } from '@playwright/experimental-ct-vue2/hooks';
2022-12-20 00:33:50 +01:00
import Router from 'vue-router';
import { router } from '../src/router';
import '../src/assets/index.css';
beforeMount(async ({ Vue, hooksConfig }) => {
console.log(`Before mount: ${JSON.stringify(hooksConfig)}`);
if (hooksConfig?.routing) {
Vue.use(Router);
return { router }
}
});
afterMount(async ({ instance }) => {
console.log(`After mount el: ${instance.$el.constructor.name}`);
});