Create projects separately in home page tests

I think creating them in Promise.all was introducing nondeterminism and
making tests flaky.
This commit is contained in:
Adam Chalmers
2025-02-02 10:25:28 -06:00
parent 8612d82375
commit ad568b6333

View File

@ -1527,34 +1527,32 @@ test(
{ tag: '@electron' },
async ({ context, page, cmdBar, homePage }, testInfo) => {
await context.folderSetupFn(async (dir) => {
await Promise.all([
fsp.mkdir(path.join(dir, 'router-template-slate'), { recursive: true }),
fsp.mkdir(path.join(dir, 'bracket'), { recursive: true }),
])
await Promise.all([
fsp.copyFile(
path.join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs',
'router-template-slate.kcl'
),
path.join(dir, 'router-template-slate', 'main.kcl')
await fsp.mkdir(path.join(dir, 'router-template-slate'), {
recursive: true,
})
await fsp.copyFile(
path.join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs',
'router-template-slate.kcl'
),
fsp.copyFile(
path.join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs',
'focusrite_scarlett_mounting_braket.kcl'
),
path.join(dir, 'bracket', 'main.kcl')
path.join(dir, 'router-template-slate', 'main.kcl')
)
await fsp.mkdir(path.join(dir, 'bracket'), { recursive: true })
await fsp.copyFile(
path.join(
'src',
'wasm-lib',
'tests',
'executor',
'inputs',
'focusrite_scarlett_mounting_braket.kcl'
),
])
path.join(dir, 'bracket', 'main.kcl')
)
})
const u = await getUtils(page)
await page.setBodyDimensions({ width: 1200, height: 500 })