Skip to content
Merged
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
16 changes: 8 additions & 8 deletions test/runE2E.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ if (!suiteName) {

console.log(`${allSuitesInFolder.join('\n')}\n`)

for (const file of allSuitesInFolder) {
clearWebpackCache()
executePlaywright(file, baseTestFolder, false, suiteConfigPath)
}
// Run all spec files in the folder with a single dev server and playwright invocation
// This avoids port conflicts when multiple spec files exist in the same folder
executePlaywright(allSuitesInFolder, baseTestFolder, false, suiteConfigPath)
}

console.log('\nRESULTS:')
Expand All @@ -114,12 +113,13 @@ console.log('\n')
// We need this because pnpm dev for a given test suite will always be run from the top level test folder,
// not from a nested suite folder.
function executePlaywright(
suitePath: string,
suitePaths: string | string[],
baseTestFolder: string,
bail = false,
suiteConfigPath?: string,
) {
console.log(`Executing ${suitePath}...`)
const paths = Array.isArray(suitePaths) ? suitePaths : [suitePaths]
console.log(`Executing ${paths.join(', ')}...`)
const playwrightCfg = path.resolve(
dirname,
`${bail ? 'playwright.bail.config.ts' : 'playwright.config.ts'}`,
Expand Down Expand Up @@ -148,12 +148,12 @@ function executePlaywright(
},
})

const cmd = slash(`${playwrightBin} test ${suitePath} -c ${playwrightCfg}`)
const cmd = slash(`${playwrightBin} test ${paths.join(' ')} -c ${playwrightCfg}`)
console.log('\n', cmd)
const { code, stdout } = shelljs.exec(cmd, {
cwd: path.resolve(dirname, '..'),
})
const suite = path.basename(path.dirname(suitePath))
const suite = path.basename(path.dirname(paths[0]!))
const results = { code, suiteName: suite }

if (code) {
Expand Down
Loading