enso/app/gui/integration-test/project-view/graphNavigator.spec.ts
Adam Obuchowicz 736134e491
Add traces to integration tests + suppress one flaky assertion. (#11595)
Fixes #11604

Most issues were caused by a problem with Project List flooding the network with its requests - this was fixed on develop.
But one assertion was flaky - it assumed we will see the "real" run result on `write` node, but sometimes it is immediately overwritten by dry run.

But the most important part of this PR is adding traces to Electron packages - it's should be much easier now to debug E2E test failures.

Also renamed the previously misnamed "E2E tests" to "[GUI] integration tests".
2024-11-27 14:09:59 +00:00

33 lines
995 B
TypeScript

import { test } from '@playwright/test'
import assert from 'assert'
import * as actions from './actions'
import { expect } from './customExpect'
import * as locate from './locate'
test('Navigating with arrows', async ({ page }) => {
await actions.goToGraph(page)
// Make sure nothing else is focused right now.
await locate.graphEditor(page).click({ position: { x: 400, y: 400 } })
const allNodes = await locate.graphNode(page).all()
const receiveBBoxes = () =>
Promise.all(
Array.from(allNodes, (node) =>
node.boundingBox().then((bbox) => {
assert(bbox != null)
return bbox
}),
),
)
const initialBBoxes = await receiveBBoxes()
await page.keyboard.press('ArrowLeft', { delay: 500 })
const newBBoxes = await receiveBBoxes()
expect(newBBoxes).toEqual(
Array.from(initialBBoxes, (bbox) =>
expect.objectContaining({
x: expect.not.closeTo(bbox.x),
y: expect.closeTo(bbox.y),
}),
),
)
})