Skip to content

Commit feee094

Browse files
committed
feat: add Playwright for end-to-end testing
1 parent be09c6d commit feee094

File tree

17 files changed

+2818
-149
lines changed

17 files changed

+2818
-149
lines changed

index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ async function init() {
5656
// --with-tests / --tests (equals to `--vitest --cypress`)
5757
// --vitest
5858
// --cypress
59+
// --playwright
5960
// --eslint
6061
// --eslint-with-prettier (only support prettier through eslint for simplicity)
6162
// --force (for force overwriting)
@@ -80,6 +81,7 @@ async function init() {
8081
argv.tests ??
8182
argv.vitest ??
8283
argv.cypress ??
84+
argv.playwright ??
8385
argv.eslint
8486
) === 'boolean'
8587

@@ -112,6 +114,7 @@ async function init() {
112114
// - Install Vue Router for SPA development?
113115
// - Install Pinia for state management?
114116
// - Add Cypress for testing?
117+
// - Add Playwright for end-to-end testing?
115118
// - Add ESLint for code quality?
116119
// - Add Prettier for code formatting?
117120
result = await prompts(
@@ -200,6 +203,14 @@ async function init() {
200203
active: 'Yes',
201204
inactive: 'No'
202205
},
206+
{
207+
name: 'needsPlaywright',
208+
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
209+
message: 'Add Playwright for End-to-End testing?',
210+
initial: false,
211+
active: 'Yes',
212+
inactive: 'No'
213+
},
203214
{
204215
name: 'needsEslint',
205216
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
@@ -244,6 +255,7 @@ async function init() {
244255
needsRouter = argv.router,
245256
needsPinia = argv.pinia,
246257
needsCypress = argv.cypress || argv.tests,
258+
needsPlaywright = argv.playwright,
247259
needsVitest = argv.vitest || argv.tests,
248260
needsEslint = argv.eslint || argv['eslint-with-prettier'],
249261
needsPrettier = argv['eslint-with-prettier']
@@ -294,6 +306,9 @@ async function init() {
294306
if (needsCypressCT) {
295307
render('config/cypress-ct')
296308
}
309+
if (needsPlaywright) {
310+
render('config/playwright')
311+
}
297312
if (needsTypeScript) {
298313
render('config/typescript')
299314

@@ -395,6 +410,7 @@ async function init() {
395410
needsTypeScript,
396411
needsVitest,
397412
needsCypress,
413+
needsPlaywright,
398414
needsCypressCT,
399415
needsEslint
400416
})

0 commit comments

Comments
 (0)