Skip to content

feat: add Playwright for end-to-end testing #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async function init() {
// --with-tests / --tests (equals to `--vitest --cypress`)
// --vitest
// --cypress
// --playwright
// --eslint
// --eslint-with-prettier (only support prettier through eslint for simplicity)
// --force (for force overwriting)
Expand All @@ -92,6 +93,7 @@ async function init() {
argv.tests ??
argv.vitest ??
argv.cypress ??
argv.playwright ??
argv.eslint
) === 'boolean'

Expand All @@ -110,6 +112,7 @@ async function init() {
needsPinia?: boolean
needsVitest?: boolean
needsCypress?: boolean
needsPlaywright?: boolean
needsEslint?: boolean
needsPrettier?: boolean
} = {}
Expand All @@ -124,6 +127,7 @@ async function init() {
// - Install Vue Router for SPA development?
// - Install Pinia for state management?
// - Add Cypress for testing?
// - Add Playwright for end-to-end testing?
// - Add ESLint for code quality?
// - Add Prettier for code formatting?
result = await prompts(
Expand Down Expand Up @@ -212,6 +216,19 @@ async function init() {
active: 'Yes',
inactive: 'No'
},
{
name: 'needsPlaywright',
type: (prev, values) => {
if (isFeatureFlagsUsed || values.needsCypress) {
return null
}
return 'toggle'
},
message: 'Add Playwright for End-to-End testing?',
initial: false,
active: 'Yes',
inactive: 'No'
},
{
name: 'needsEslint',
type: () => (isFeatureFlagsUsed ? null : 'toggle'),
Expand Down Expand Up @@ -256,6 +273,7 @@ async function init() {
needsRouter = argv.router,
needsPinia = argv.pinia,
needsCypress = argv.cypress || argv.tests,
needsPlaywright = argv.playwright,
needsVitest = argv.vitest || argv.tests,
needsEslint = argv.eslint || argv['eslint-with-prettier'],
needsPrettier = argv['eslint-with-prettier']
Expand Down Expand Up @@ -306,6 +324,9 @@ async function init() {
if (needsCypressCT) {
render('config/cypress-ct')
}
if (needsPlaywright) {
render('config/playwright')
}
if (needsTypeScript) {
render('config/typescript')

Expand Down Expand Up @@ -408,6 +429,7 @@ async function init() {
needsTypeScript,
needsVitest,
needsCypress,
needsPlaywright,
needsCypressCT,
needsEslint
})
Expand Down
Loading