Skip to content

Commit 9f76d3a

Browse files
committed
test(e2e): adjust config
1 parent 9fc6c59 commit 9f76d3a

File tree

5 files changed

+7436
-19
lines changed

5 files changed

+7436
-19
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: 1.x
5+
pull_request:
6+
branches: 1.x
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v3
14+
with:
15+
node-version: 18
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Build
19+
run: npm run build
20+
- name: Install Playwright Browsers
21+
run: npx playwright install --with-deps
22+
- name: Run Playwright tests
23+
run: npx playwright test
24+
- uses: actions/upload-artifact@v3
25+
if: always()
26+
with:
27+
name: playwright-report
28+
path: playwright-report/
29+
retention-days: 30

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
pnpm-lock.yaml
32

43
.DS_Store
54

e2e/VuePreview.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import TestBasic from './components/Basic.vue'
33
import TestCssVars from './components/CssVars.vue'
44
import TestProps from './components/Props.vue'
55

6-
test.describe.skip('basic', () => {
6+
test.describe('basic', () => {
77
test('mount successfully', async ({ mount }) => {
88
const sfc = await mount(TestBasic)
99
await expect(sfc).toHaveClass('vue-preview')
1010
await expect(sfc).toContainText('vite-plugin-vue-preview')
1111
})
1212

13-
// test failure in chromium and expect PR
13+
// test failure with clipboard in chromium, and expect PR
1414
test.skip('copy code', async ({ mount }) => {
1515
const sfc = await mount(TestBasic)
1616
const vuePreviewContainer = await sfc.locator('.vue-preview__container')
@@ -132,7 +132,7 @@ test.describe.skip('css', () => {
132132
})
133133
})
134134

135-
test.describe('props', () => {
135+
test.describe.skip('props', () => {
136136
test('default props', async ({ mount }) => {
137137
const sfc = await mount(TestBasic)
138138
const iframe = await sfc.frameLocator('iframe')

playwright-ct.config.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,18 @@ import { defineConfig, devices } from '@playwright/experimental-ct-vue'
55
*/
66
export default defineConfig({
77
testDir: './e2e',
8-
/* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
98
snapshotDir: './__snapshots__',
10-
/* Maximum time one test can run for. */
119
timeout: 10 * 1000,
12-
/* Run tests in files in parallel */
1310
fullyParallel: true,
14-
/* Fail the build on CI if you accidentally left test.only in the source code. */
1511
forbidOnly: !!process.env.CI,
16-
/* Retry on CI only */
17-
retries: process.env.CI ? 2 : 0,
18-
/* Opt out of parallel tests on CI. */
19-
workers: process.env.CI ? 1 : undefined,
20-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
12+
retries: 2,
13+
workers: 2,
2114
reporter: 'html',
22-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2315
use: {
24-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
25-
trace: 'on-first-retry',
26-
27-
/* Port to use for Playwright component endpoint. */
16+
trace: 'retain-on-failure',
2817
ctPort: 3100,
2918
},
3019

31-
/* Configure projects for major browsers */
3220
projects: [
3321
{
3422
name: 'chromium',

0 commit comments

Comments
 (0)