Skip to content

Commit 02d7baf

Browse files
committed
feat: add Playwright for end-to-end testing
1 parent 9b2b1e4 commit 02d7baf

File tree

15 files changed

+1909
-7
lines changed

15 files changed

+1909
-7
lines changed

index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ async function init() {
5757
// --with-tests / --tests (equals to `--vitest --cypress`)
5858
// --vitest
5959
// --cypress
60+
// --playwright
6061
// --eslint
6162
// --eslint-with-prettier (only support prettier through eslint for simplicity)
6263
// --force (for force overwriting)
@@ -81,6 +82,7 @@ async function init() {
8182
argv.tests ??
8283
argv.vitest ??
8384
argv.cypress ??
85+
argv.playwright ??
8486
argv.eslint
8587
) === 'boolean'
8688

@@ -101,6 +103,7 @@ async function init() {
101103
// - Install Vue Router for SPA development?
102104
// - Install Pinia for state management?
103105
// - Add Cypress for testing?
106+
// - Add Playwright for end-to-end testing?
104107
// - Add ESLint for code quality?
105108
// - Add Prettier for code formatting?
106109
result = await prompts(
@@ -189,6 +192,14 @@ async function init() {
189192
active: 'Yes',
190193
inactive: 'No'
191194
},
195+
{
196+
name: 'needsPlaywright',
197+
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
198+
message: 'Add Playwright for End-to-End testing?',
199+
initial: false,
200+
active: 'Yes',
201+
inactive: 'No'
202+
},
192203
{
193204
name: 'needsEslint',
194205
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
@@ -233,6 +244,7 @@ async function init() {
233244
needsRouter = argv.router,
234245
needsPinia = argv.pinia,
235246
needsCypress = argv.cypress || argv.tests,
247+
needsPlaywright = argv.playwright,
236248
needsVitest = argv.vitest || argv.tests,
237249
needsEslint = argv.eslint || argv['eslint-with-prettier'],
238250
needsPrettier = argv['eslint-with-prettier']
@@ -283,6 +295,9 @@ async function init() {
283295
if (needsCypressCT) {
284296
render('config/cypress-ct')
285297
}
298+
if (needsPlaywright) {
299+
render('config/playwright')
300+
}
286301
if (needsTypeScript) {
287302
render('config/typescript')
288303

@@ -384,6 +399,7 @@ async function init() {
384399
needsTypeScript,
385400
needsVitest,
386401
needsCypress,
402+
needsPlaywright,
387403
needsCypressCT,
388404
needsEslint
389405
})

0 commit comments

Comments
 (0)