Skip to content

Commit

Permalink
fix: e2e test now scrolls to DOM content to safely check for parse er…
Browse files Browse the repository at this point in the history
…rors
  • Loading branch information
nadr0 committed Feb 21, 2025
1 parent 6b8274c commit 69a43f2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions e2e/playwright/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ test(
test(
'when code with error first loads you get errors in console',
{ tag: '@electron' },
async ({ context, page }, testInfo) => {
async ({ context, page, editor }, testInfo) => {
await context.folderSetupFn(async (dir) => {
await fsp.mkdir(path.join(dir, 'broken-code'), { recursive: true })
await fsp.copyFile(
Expand All @@ -434,16 +434,19 @@ test(
})

await page.setBodyDimensions({ width: 1200, height: 500 })

await expect(page.getByText('broken-code')).toBeVisible()

await page.getByText('broken-code').click()

// Gotcha: You can not use scene.waitForExecutionDone() since the KCL code is going to fail
await expect(page.getByTestId('loading')).toBeAttached()
await expect(page.getByTestId('loading')).not.toBeAttached({
timeout: 20_000,
})

// Gotcha: Scroll to the text content in code mirror because CodeMirror lazy loads DOM content
await editor.scrollToText(
"|> line(end = [0, wallMountL], tag = 'outerEdge')"
)
// error in guter
await expect(page.locator('.cm-lint-marker-error')).toBeVisible()

Expand Down

0 comments on commit 69a43f2

Please sign in to comment.