diff --git a/tests/components/ct-vue2-cli/playwright.config.ts b/tests/components/ct-vue2-cli/playwright.config.ts index d2e42fcc67..3ddd17c7ea 100644 --- a/tests/components/ct-vue2-cli/playwright.config.ts +++ b/tests/components/ct-vue2-cli/playwright.config.ts @@ -15,14 +15,22 @@ */ import { type PlaywrightTestConfig, devices } from '@playwright/experimental-ct-vue2'; +import { resolve } from 'path'; const config: PlaywrightTestConfig = { - testDir: 'src', + testDir: 'tests', forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, reporter: 'html', use: { trace: 'on-first-retry', + ctViteConfig: { + resolve: { + alias: { + '@': resolve(__dirname, './src'), + } + } + } }, projects: [ { diff --git a/tests/components/ct-vue2-cli/playwright/index.html b/tests/components/ct-vue2-cli/playwright/index.html index 943d4d14db..9ee6c8206e 100644 --- a/tests/components/ct-vue2-cli/playwright/index.html +++ b/tests/components/ct-vue2-cli/playwright/index.html @@ -7,6 +7,6 @@
- + diff --git a/tests/components/ct-vue2-cli/playwright/index.ts b/tests/components/ct-vue2-cli/playwright/index.js similarity index 57% rename from tests/components/ct-vue2-cli/playwright/index.ts rename to tests/components/ct-vue2-cli/playwright/index.js index d608a40218..f5bd21d70d 100644 --- a/tests/components/ct-vue2-cli/playwright/index.ts +++ b/tests/components/ct-vue2-cli/playwright/index.js @@ -3,20 +3,15 @@ import Router from 'vue-router'; import { router } from '../src/router'; import '../src/assets/index.css'; -export type HooksConfig = { - route?: string; - routing?: boolean; -} - -beforeMount(async ({ Vue, hooksConfig }) => { +beforeMount(async ({ Vue, hooksConfig }) => { console.log(`Before mount: ${JSON.stringify(hooksConfig)}`); if (hooksConfig?.routing) { - Vue.use(Router as any); // TODO: remove any and fix the various installed conflicting Vue versions + Vue.use(Router); return { router } } }); -afterMount(async ({ instance }) => { +afterMount(async ({ instance }) => { console.log(`After mount el: ${instance.$el.constructor.name}`); }); diff --git a/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx b/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx deleted file mode 100644 index f023394b50..0000000000 --- a/tests/components/ct-vue2-cli/src/notation-jsx.spec.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import { test, expect } from '@playwright/experimental-ct-vue2' -import App from './App.vue'; -import Button from './components/Button.vue'; -import Counter from './components/Counter.vue'; -import DefaultSlot from './components/DefaultSlot.vue'; -import NamedSlots from './components/NamedSlots.vue'; -import EmptyTemplate from './components/EmptyTemplate.vue'; -import type { HooksConfig } from '../playwright'; - -test.use({ viewport: { width: 500, height: 500 } }) - -test('render props', async ({ mount }) => { - const component = await mount(