enso/app/gui2/e2e/selectingNodes.spec.ts
Paweł Grabarz b7a8909818
Vue dependency update, better selection performance, visible quotes in text inputs (#9204)
- Improved performance by batching simulatenous node edits, including metadata updates when dragging many selected nodes together.
- Updated Vue to new version, allowing us to use `defineModel`.
- Fixed #9161
- Unified all handling of auto-blur by making `useAutoBlur` cheap to register - all logic goes through a single window event handler.
- Combined all `ResizeObserver`s into one.
- Fixed the behaviour of repeated toast messages. Now only the latest compilation status is visible at any given time, and the errors disappear once compilation passes.
- Actually fixed broken interaction of node and visualization widths. There no longer is a style feedback loop and the visible node backdrop width no longer jumps or randomly fails to update.
2024-03-06 15:34:07 +00:00

58 lines
2.0 KiB
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('Selecting nodes by click', async ({ page }) => {
await actions.goToGraph(page)
const node1 = locate.graphNodeByBinding(page, 'five')
const node2 = locate.graphNodeByBinding(page, 'ten')
await expect(node1).not.toBeSelected()
await expect(node2).not.toBeSelected()
await locate.graphNodeIcon(node1).click()
await expect(node1).toBeSelected()
await expect(node2).not.toBeSelected()
await locate.graphNodeIcon(node2).click()
await expect(node1).not.toBeSelected()
await expect(node2).toBeSelected()
await page.waitForTimeout(300) // Avoid double clicks
await locate.graphNodeIcon(node1).click({ modifiers: ['Shift'] })
await expect(node1).toBeSelected()
await expect(node2).toBeSelected()
await locate.graphNodeIcon(node2).click()
await expect(node1).not.toBeSelected()
await expect(node2).toBeSelected()
await page.mouse.click(600, 200)
await expect(node1).not.toBeSelected()
await expect(node2).not.toBeSelected()
})
test('Selecting nodes by area drag', async ({ page }) => {
await actions.goToGraph(page)
const node1 = locate.graphNodeByBinding(page, 'five')
const node2 = locate.graphNodeByBinding(page, 'ten')
await expect(node1).not.toBeSelected()
await expect(node2).not.toBeSelected()
const node1BBox = await node1.locator('.selection').boundingBox()
const node2BBox = await node2.boundingBox()
assert(node1BBox)
assert(node2BBox)
await page.mouse.move(node1BBox.x - 50, node1BBox.y - 50)
await page.mouse.down()
await page.mouse.move(node1BBox.x - 49, node1BBox.y - 49)
await expect(page.locator('.SelectionBrush')).toBeVisible()
await page.mouse.move(node2BBox.x + node2BBox.width, node2BBox.y + node2BBox.height)
await expect(node1).toBeSelected()
await expect(node2).toBeSelected()
await page.mouse.up()
await expect(node1).toBeSelected()
await expect(node2).toBeSelected()
})