@@ -56,6 +56,7 @@ async function init() {
56
56
// --with-tests / --tests (equals to `--vitest --cypress`)
57
57
// --vitest
58
58
// --cypress
59
+ // --playwright
59
60
// --eslint
60
61
// --eslint-with-prettier (only support prettier through eslint for simplicity)
61
62
// --force (for force overwriting)
@@ -80,6 +81,7 @@ async function init() {
80
81
argv . tests ??
81
82
argv . vitest ??
82
83
argv . cypress ??
84
+ argv . playwright ??
83
85
argv . eslint
84
86
) === 'boolean'
85
87
@@ -98,6 +100,7 @@ async function init() {
98
100
needsPinia ? : boolean
99
101
needsVitest ? : boolean
100
102
needsCypress ? : boolean
103
+ needsPlaywright ? : boolean
101
104
needsEslint ? : boolean
102
105
needsPrettier ? : boolean
103
106
} = { }
@@ -112,6 +115,7 @@ async function init() {
112
115
// - Install Vue Router for SPA development?
113
116
// - Install Pinia for state management?
114
117
// - Add Cypress for testing?
118
+ // - Add Playwright for end-to-end testing?
115
119
// - Add ESLint for code quality?
116
120
// - Add Prettier for code formatting?
117
121
result = await prompts (
@@ -200,6 +204,19 @@ async function init() {
200
204
active : 'Yes' ,
201
205
inactive : 'No'
202
206
} ,
207
+ {
208
+ name : 'needsPlaywright' ,
209
+ type : ( prev , values ) => {
210
+ if ( isFeatureFlagsUsed || values . needsCypress ) {
211
+ return null
212
+ }
213
+ return 'toggle'
214
+ } ,
215
+ message : 'Add Playwright for End-to-End testing?' ,
216
+ initial : false ,
217
+ active : 'Yes' ,
218
+ inactive : 'No'
219
+ } ,
203
220
{
204
221
name : 'needsEslint' ,
205
222
type : ( ) => ( isFeatureFlagsUsed ? null : 'toggle' ) ,
@@ -244,6 +261,7 @@ async function init() {
244
261
needsRouter = argv . router ,
245
262
needsPinia = argv . pinia ,
246
263
needsCypress = argv . cypress || argv . tests ,
264
+ needsPlaywright = argv . playwright ,
247
265
needsVitest = argv . vitest || argv . tests ,
248
266
needsEslint = argv . eslint || argv [ 'eslint-with-prettier' ] ,
249
267
needsPrettier = argv [ 'eslint-with-prettier' ]
@@ -294,6 +312,9 @@ async function init() {
294
312
if ( needsCypressCT ) {
295
313
render ( 'config/cypress-ct' )
296
314
}
315
+ if ( needsPlaywright ) {
316
+ render ( 'config/playwright' )
317
+ }
297
318
if ( needsTypeScript ) {
298
319
render ( 'config/typescript' )
299
320
@@ -395,6 +416,7 @@ async function init() {
395
416
needsTypeScript,
396
417
needsVitest,
397
418
needsCypress,
419
+ needsPlaywright,
398
420
needsCypressCT,
399
421
needsEslint
400
422
} )
0 commit comments