chore: migrate vue component example to a new vite plugin (#13750)
This commit is contained in:
parent
6fe02eb5f1
commit
f933f766f4
4303
examples/components-vue/package-lock.json
generated
4303
examples/components-vue/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -11,9 +11,9 @@
|
|||
"vue": "^3.2.31"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/experimental-ct-vue": "^0.0.2",
|
||||
"@playwright/test": "^1.21.0-alpha-mar-12-2022",
|
||||
"@vitejs/plugin-vue": "^2.2.2",
|
||||
"vite": "^2.8.4"
|
||||
"@playwright/experimental-ct-vue": "^0.0.5",
|
||||
"@playwright/test": "1.22.0-alpha-apr-26-2022",
|
||||
"@vitejs/plugin-vue": "^2.3.1",
|
||||
"vite": "^2.9.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { PlaywrightTestConfig, devices } from '@playwright/test';
|
||||
import vite from '@playwright/experimental-ct-vue/vitePlugin';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
testDir: 'src',
|
||||
|
|
@ -9,13 +11,10 @@ const config: PlaywrightTestConfig = {
|
|||
] : [
|
||||
['html', { open: 'on-failure' }]
|
||||
],
|
||||
webServer: {
|
||||
url: 'http://localhost:3000/tests.html',
|
||||
command: 'npm run dev',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
},
|
||||
plugins: [
|
||||
vite({ config: { plugins: [ vue() ] }}),
|
||||
],
|
||||
use: {
|
||||
baseURL: 'http://localhost:3000/tests.html',
|
||||
trace: 'on-first-retry',
|
||||
},
|
||||
projects: [
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<style>@import '/src/assets/base.css';</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/tests.js"></script>
|
||||
<script type="module" src="/playwright/index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1
examples/components-vue/playwright/index.js
Normal file
1
examples/components-vue/playwright/index.js
Normal file
|
|
@ -0,0 +1 @@
|
|||
import '../src/assets/base.css'
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { test, expect } from '@playwright/experimental-ct-vue/test'
|
||||
|
||||
import NamedSlots from './components/NamedSlots.vue'
|
||||
import NamedSlots from './NamedSlots.vue'
|
||||
|
||||
test.use({ viewport: { width: 500, height: 500 } })
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { test, expect } from '@playwright/experimental-ct-vue/test'
|
||||
import NamedSlots from './components/NamedSlots.vue'
|
||||
|
||||
import NamedSlots from './NamedSlots.vue'
|
||||
|
||||
test.use({ viewport: { width: 500, height: 500 } })
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { test, expect } from '@playwright/experimental-ct-vue/test'
|
||||
|
||||
import DocumentationIcon from './icons/DocumentationIcon.vue'
|
||||
import DocumentationIcon from './icons/IconDocumentation.vue'
|
||||
import WelcomeItem from './WelcomeItem.vue'
|
||||
|
||||
test.use({ viewport: { width: 500, height: 500 } })
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
import register from '@playwright/experimental-ct-vue/register'
|
||||
|
||||
import Counter from './src/components/Counter.vue'
|
||||
import DocumentationIcon from './src/components/icons/IconDocumentation.vue'
|
||||
import HelloWorld from './src/components/HelloWorld.vue'
|
||||
import NamedSlots from './src/components/NamedSlots.vue'
|
||||
import TheWelcome from './src/components/TheWelcome.vue'
|
||||
import WelcomeItem from './src/components/WelcomeItem.vue'
|
||||
|
||||
register({
|
||||
Counter,
|
||||
DocumentationIcon,
|
||||
HelloWorld,
|
||||
NamedSlots,
|
||||
TheWelcome,
|
||||
WelcomeItem,
|
||||
})
|
||||
Loading…
Reference in a new issue