Compare commits

...

3 Commits

Author SHA1 Message Date
ebf8c0ae5b Query the homepage projects in an order-insensitive way 2025-02-02 14:00:42 -06:00
ad568b6333 Create projects separately in home page tests
I think creating them in Promise.all was introducing nondeterminism and
making tests flaky.
2025-02-02 13:21:54 -06:00
8612d82375 Test main e2e 2025-02-02 10:24:12 -06:00
3 changed files with 31 additions and 39 deletions

View File

@ -89,18 +89,11 @@ export class HomePageFixture {
* Maybe there a good sanity check we can do each time?
*/
expectState = async (expectedState: HomePageState) => {
await expect
.poll(async () => {
const [projectCards, sortBy] = await Promise.all([
this._serialiseProjectCards(),
this._serialiseSortBy(),
])
return {
projectCards,
sortBy,
}
})
.toEqual(expectedState)
await expect.poll(this._serialiseSortBy).toEqual(expectedState.sortBy)
for (const projectCard of expectedState.projectCards) {
await expect.poll(this._serialiseProjectCards).toContainEqual(projectCard)
}
}
createAndGoToProject = async (projectTitle = 'project-$nnn') => {

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 })

View File

@ -209,5 +209,6 @@
"wasm-pack": "^0.13.1",
"ws": "^8.17.0",
"yarn": "^1.22.22"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}