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? * Maybe there a good sanity check we can do each time?
*/ */
expectState = async (expectedState: HomePageState) => { expectState = async (expectedState: HomePageState) => {
await expect await expect.poll(this._serialiseSortBy).toEqual(expectedState.sortBy)
.poll(async () => {
const [projectCards, sortBy] = await Promise.all([ for (const projectCard of expectedState.projectCards) {
this._serialiseProjectCards(), await expect.poll(this._serialiseProjectCards).toContainEqual(projectCard)
this._serialiseSortBy(), }
])
return {
projectCards,
sortBy,
}
})
.toEqual(expectedState)
} }
createAndGoToProject = async (projectTitle = 'project-$nnn') => { createAndGoToProject = async (projectTitle = 'project-$nnn') => {

View File

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

View File

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