mirror of
https://github.com/enso-org/enso.git
synced 2024-11-25 21:25:20 +03:00
Make background clicks less flaky (#10069)
We had some false test failures: https://github.com/enso-org/enso/actions/runs/9178969067/job/25240028635 The problem was the connection, which, while not being completely broken, still wasn't updated to proper position, thus taking clicks meant for the background. Now, I use proper locator click, so the test should wait for click spot being clear. Also added locator-based clicks where I felt it's proper.
This commit is contained in:
parent
084be279c5
commit
0f6b29c88f
@ -33,7 +33,7 @@ export async function expectNodePositionsInitialized(page: Page, yPos: number) {
|
||||
}
|
||||
|
||||
export async function exitFunction(page: Page, x = 300, y = 300) {
|
||||
await page.mouse.dblclick(x, y, { delay: 10 })
|
||||
await locate.graphEditor(page).dblclick({ position: { x, y } })
|
||||
}
|
||||
|
||||
// =================
|
||||
|
@ -56,7 +56,7 @@ test('Different ways of opening Component Browser', async ({ page }) => {
|
||||
// Dragging out an edge
|
||||
const outputPort = await locate.outputPortCoordinates(locate.graphNodeByBinding(page, 'final'))
|
||||
await page.mouse.click(outputPort.x, outputPort.y)
|
||||
await page.mouse.click(100, 500)
|
||||
await locate.graphEditor(page).click({ position: { x: 100, y: 500 } })
|
||||
await expectAndCancelBrowser(page, '', 'final')
|
||||
// Double-clicking port
|
||||
// TODO[ao] Without timeout, even the first click would be treated as double due to previous
|
||||
@ -111,7 +111,7 @@ test('Graph Editor pans to Component Browser', async ({ page }) => {
|
||||
await expect(locate.graphNodeByBinding(page, 'five')).toBeInViewport()
|
||||
const outputPort = await locate.outputPortCoordinates(locate.graphNodeByBinding(page, 'final'))
|
||||
await page.mouse.click(outputPort.x, outputPort.y)
|
||||
await page.mouse.click(100, 1700)
|
||||
await locate.graphEditor(page).click({ position: { x: 100, y: 1700 } })
|
||||
await expect(locate.graphNodeByBinding(page, 'five')).not.toBeInViewport()
|
||||
await expectAndCancelBrowser(page, '', 'final')
|
||||
})
|
||||
|
@ -37,7 +37,7 @@ test('Selecting nodes by click', async ({ page }) => {
|
||||
await expect(selectionMenu).not.toBeVisible()
|
||||
|
||||
// Check that clicking the background deselects all nodes.
|
||||
await page.mouse.click(600, 200)
|
||||
await locate.graphEditor(page).click({ position: { x: 600, y: 200 } })
|
||||
await expect(node1).not.toBeSelected()
|
||||
await expect(node2).not.toBeSelected()
|
||||
await expect(selectionMenu).not.toBeVisible()
|
||||
|
Loading…
Reference in New Issue
Block a user