fix: finally found the right helper function, don't know why this is a toolbar, it is not a toolbar

This commit is contained in:
Kevin
2025-06-25 12:44:37 -05:00
parent 327bcfaad8
commit ee44a4f0f6
3 changed files with 8 additions and 26 deletions

View File

@ -246,7 +246,7 @@ test(
test(
'open a file in a project works and renders, open empty file, it should clear the scene',
{ tag: '@desktop' },
async ({ context, page, scene }, testInfo) => {
async ({ context, page, scene, toolbar }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
@ -290,10 +290,7 @@ test(
await page.getByTestId('files-pane-button').click()
// Open the other file.
const file = scene.getFileRowFromExplorer('empty.kcl')
await expect(file).toBeVisible()
await file.click()
await toolbar.openFile('empty.kcl')
// planes colors means the scene has been cleared.
await expect
@ -312,7 +309,7 @@ test(
test(
'open a file in a project works and renders, open another file in the same project with errors, it should clear the scene',
{ tag: '@desktop' },
async ({ scene, cmdBar, context, page }, testInfo) => {
async ({ scene, cmdBar, context, page, toolbar }, testInfo) => {
await context.folderSetupFn(async (dir) => {
const bracketDir = path.join(dir, 'bracket')
await fsp.mkdir(bracketDir, { recursive: true })
@ -358,10 +355,7 @@ test(
await page.getByTestId('files-pane-button').click()
// Open the other file.
const file = scene.getFileRowFromExplorer('broken-code-test.kcl')
await expect(file).toBeVisible()
await file.click()
await toolbar.openFile('broken-code-test.kcl')
// error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()
@ -1092,7 +1086,7 @@ test(`Create a few projects using the default project name`, async ({
test(
'File in the file pane should open with a single click',
{ tag: '@desktop' },
async ({ context, homePage, page, scene }, testInfo) => {
async ({ context, homePage, page, scene, toolbar }, testInfo) => {
const projectName = 'router-template-slate'
await context.folderSetupFn(async (dir) => {
await fsp.mkdir(`${dir}/${projectName}`, { recursive: true })
@ -1119,11 +1113,7 @@ test(
await expect(u.codeLocator).toContainText('minClampingDistance')
await page.getByRole('button', { name: 'Project Files' }).click()
const file = scene.getFileRowFromExplorer('otherThingToClickOn.kcl')
await expect(file).toBeVisible()
await file.click()
await toolbar.openFile('otherThingToClickOn.kcl')
await expect(u.codeLocator).toContainText(
'A mounting bracket for the Focusrite Scarlett Solo audio interface'