2024-03-06 18:34:07 +03:00
|
|
|
import { test, type Page } from '@playwright/test'
|
2023-11-27 18:48:37 +03:00
|
|
|
import * as actions from './actions'
|
2024-03-06 18:34:07 +03:00
|
|
|
import { expect } from './customExpect'
|
2024-04-19 19:33:51 +03:00
|
|
|
import { CONTROL_KEY } from './keyboard'
|
2023-11-27 18:48:37 +03:00
|
|
|
import * as locate from './locate'
|
|
|
|
|
2024-02-26 18:34:43 +03:00
|
|
|
const ACCEPT_SUGGESTION_SHORTCUT = `${CONTROL_KEY}+Enter`
|
2024-01-18 16:45:18 +03:00
|
|
|
|
2024-02-02 20:11:28 +03:00
|
|
|
async function deselectAllNodes(page: Page) {
|
|
|
|
await page.keyboard.press('Escape')
|
2024-04-25 16:18:38 +03:00
|
|
|
await expect(locate.selectedNodes(page)).toHaveCount(0)
|
2024-02-02 20:11:28 +03:00
|
|
|
}
|
|
|
|
|
2024-05-21 21:34:30 +03:00
|
|
|
async function expectAndCancelBrowser(
|
|
|
|
page: Page,
|
|
|
|
expectedText: string,
|
|
|
|
expectedSelfArgument?: string,
|
|
|
|
) {
|
2024-01-03 12:12:38 +03:00
|
|
|
const nodeCount = await locate.graphNode(page).count()
|
2024-03-06 23:09:56 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toExist()
|
|
|
|
await expect(locate.componentBrowserEntry(page)).toExist()
|
2024-05-21 21:34:30 +03:00
|
|
|
if (expectedSelfArgument != null)
|
|
|
|
await expect(locate.componentBrowser(page)).toHaveAttribute(
|
|
|
|
'data-self-argument',
|
|
|
|
expectedSelfArgument,
|
|
|
|
)
|
|
|
|
await expect(locate.componentBrowserInput(page).locator('input')).toHaveValue(expectedText)
|
2024-03-06 23:09:56 +03:00
|
|
|
await expect(locate.componentBrowserInput(page).locator('input')).toBeInViewport()
|
|
|
|
await page.keyboard.press('Escape')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-03-06 23:09:56 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount)
|
|
|
|
}
|
2024-01-03 12:12:38 +03:00
|
|
|
|
2024-03-06 23:09:56 +03:00
|
|
|
test('Different ways of opening Component Browser', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
2024-01-03 12:12:38 +03:00
|
|
|
|
|
|
|
// Without source node
|
|
|
|
|
|
|
|
// (+) button
|
|
|
|
await locate.addNewNodeButton(page).click()
|
2024-03-06 23:09:56 +03:00
|
|
|
await expectAndCancelBrowser(page, '')
|
2024-07-02 15:59:06 +03:00
|
|
|
// (+) button with selection (ignored)
|
|
|
|
await locate.graphNodeByBinding(page, 'final').click()
|
|
|
|
await locate.addNewNodeButton(page).click()
|
|
|
|
await expectAndCancelBrowser(page, '')
|
2024-01-03 12:12:38 +03:00
|
|
|
// Enter key
|
2023-11-27 18:48:37 +03:00
|
|
|
await locate.graphEditor(page).press('Enter')
|
2024-03-06 23:09:56 +03:00
|
|
|
await expectAndCancelBrowser(page, '')
|
2024-01-03 12:12:38 +03:00
|
|
|
|
|
|
|
// With source node
|
|
|
|
|
|
|
|
// Enter key
|
2024-01-18 16:45:18 +03:00
|
|
|
await locate.graphNodeByBinding(page, 'final').click()
|
2024-01-03 12:12:38 +03:00
|
|
|
await locate.graphEditor(page).press('Enter')
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'final')
|
2024-01-03 12:12:38 +03:00
|
|
|
// Dragging out an edge
|
2024-03-18 06:24:22 +03:00
|
|
|
const outputPort = await locate.outputPortCoordinates(locate.graphNodeByBinding(page, 'final'))
|
|
|
|
await page.mouse.click(outputPort.x, outputPort.y)
|
2024-05-24 16:28:51 +03:00
|
|
|
await locate.graphEditor(page).click({ position: { x: 100, y: 500 } })
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'final')
|
2024-01-03 12:12:38 +03:00
|
|
|
// Double-clicking port
|
2024-02-01 20:37:00 +03:00
|
|
|
// TODO[ao] Without timeout, even the first click would be treated as double due to previous
|
|
|
|
// event. Probably we need a better way to simulate double clicks.
|
|
|
|
await page.waitForTimeout(600)
|
2024-03-18 06:24:22 +03:00
|
|
|
await page.mouse.click(outputPort.x, outputPort.y)
|
|
|
|
await page.mouse.click(outputPort.x, outputPort.y)
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'final')
|
2024-03-06 23:09:56 +03:00
|
|
|
})
|
|
|
|
|
2024-03-12 18:00:21 +03:00
|
|
|
test('Opening Component Browser with small plus buttons', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
|
|
|
|
// Small (+) button shown when node is hovered
|
|
|
|
await page.keyboard.press('Escape')
|
|
|
|
await page.mouse.move(100, 80)
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.smallPlusButton(page)).toBeHidden()
|
2024-03-25 19:05:20 +03:00
|
|
|
await locate.graphNodeIcon(locate.graphNodeByBinding(page, 'selected')).hover()
|
2024-03-12 18:00:21 +03:00
|
|
|
await expect(locate.smallPlusButton(page)).toBeVisible()
|
|
|
|
await locate.smallPlusButton(page).click()
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'selected')
|
2024-03-12 18:00:21 +03:00
|
|
|
|
|
|
|
// Small (+) button shown when node is sole selection
|
|
|
|
await page.keyboard.press('Escape')
|
2024-05-20 14:10:05 +03:00
|
|
|
await page.mouse.move(300, 300)
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.smallPlusButton(page)).toBeHidden()
|
2024-03-25 19:05:20 +03:00
|
|
|
await locate.graphNodeByBinding(page, 'selected').click()
|
2024-03-12 18:00:21 +03:00
|
|
|
await expect(locate.smallPlusButton(page)).toBeVisible()
|
|
|
|
await locate.smallPlusButton(page).click()
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'selected')
|
2024-03-12 18:00:21 +03:00
|
|
|
})
|
|
|
|
|
2024-03-06 23:09:56 +03:00
|
|
|
test('Graph Editor pans to Component Browser', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
|
|
|
|
// Select node, pan out of view of it, press Enter; should pan to show node and CB
|
|
|
|
await locate.graphNodeByBinding(page, 'final').click()
|
|
|
|
await page.mouse.move(100, 80)
|
|
|
|
await page.mouse.down({ button: 'middle' })
|
2024-05-17 16:32:09 +03:00
|
|
|
await page.mouse.move(100, 1200)
|
2024-03-06 23:09:56 +03:00
|
|
|
await page.mouse.up({ button: 'middle' })
|
|
|
|
await expect(locate.graphNodeByBinding(page, 'final')).not.toBeInViewport()
|
|
|
|
await locate.graphEditor(page).press('Enter')
|
|
|
|
await expect(locate.graphNodeByBinding(page, 'final')).toBeInViewport()
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'final')
|
2024-03-06 23:09:56 +03:00
|
|
|
|
|
|
|
// Dragging out an edge to the bottom of the viewport; when the CB pans into view, some nodes are out of view.
|
|
|
|
await page.mouse.move(100, 1100)
|
|
|
|
await page.mouse.down({ button: 'middle' })
|
|
|
|
await page.mouse.move(100, 80)
|
|
|
|
await page.mouse.up({ button: 'middle' })
|
|
|
|
await expect(locate.graphNodeByBinding(page, 'five')).toBeInViewport()
|
2024-03-18 06:24:22 +03:00
|
|
|
const outputPort = await locate.outputPortCoordinates(locate.graphNodeByBinding(page, 'final'))
|
|
|
|
await page.mouse.click(outputPort.x, outputPort.y)
|
2024-05-24 16:28:51 +03:00
|
|
|
await locate.graphEditor(page).click({ position: { x: 100, y: 1700 } })
|
2024-03-06 23:09:56 +03:00
|
|
|
await expect(locate.graphNodeByBinding(page, 'five')).not.toBeInViewport()
|
2024-05-21 21:34:30 +03:00
|
|
|
await expectAndCancelBrowser(page, '', 'final')
|
2024-01-03 12:12:38 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
test('Accepting suggestion', async ({ page }) => {
|
2024-07-02 15:59:06 +03:00
|
|
|
// Clicking entry
|
2024-01-03 12:12:38 +03:00
|
|
|
await actions.goToGraph(page)
|
|
|
|
await locate.addNewNodeButton(page).click()
|
2023-12-12 17:27:40 +03:00
|
|
|
let nodeCount = await locate.graphNode(page).count()
|
2023-12-20 17:54:55 +03:00
|
|
|
await locate.componentBrowserEntry(page).nth(1).click()
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2023-12-12 17:27:40 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.graphNode(page).last().locator('.WidgetToken')).toHaveText([
|
|
|
|
'Data',
|
|
|
|
'.',
|
|
|
|
'read_text',
|
|
|
|
])
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.graphNode(page).last()).toBeSelected()
|
2023-12-12 17:27:40 +03:00
|
|
|
|
2024-01-03 12:12:38 +03:00
|
|
|
// Clicking at highlighted entry
|
2023-12-12 17:27:40 +03:00
|
|
|
nodeCount = await locate.graphNode(page).count()
|
2024-02-02 20:11:28 +03:00
|
|
|
await deselectAllNodes(page)
|
2024-01-03 12:12:38 +03:00
|
|
|
await locate.addNewNodeButton(page).click()
|
2023-12-12 17:27:40 +03:00
|
|
|
await locate.componentBrowserSelectedEntry(page).first().click()
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2023-11-27 18:48:37 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.graphNode(page).last().locator('.WidgetToken')).toHaveText([
|
|
|
|
'Data',
|
|
|
|
'.',
|
|
|
|
'read',
|
|
|
|
])
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.graphNode(page).last()).toBeSelected()
|
2024-01-03 12:12:38 +03:00
|
|
|
|
|
|
|
// Accepting with Enter
|
|
|
|
nodeCount = await locate.graphNode(page).count()
|
2024-02-02 20:11:28 +03:00
|
|
|
await deselectAllNodes(page)
|
2024-01-03 12:12:38 +03:00
|
|
|
await locate.addNewNodeButton(page).click()
|
|
|
|
await page.keyboard.press('Enter')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
|
|
|
await expect(locate.graphNode(page).last().locator('.WidgetToken')).toHaveText([
|
|
|
|
'Data',
|
|
|
|
'.',
|
|
|
|
'read',
|
|
|
|
])
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.graphNode(page).last()).toBeSelected()
|
2024-01-03 12:12:38 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
test('Accepting any written input', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
await locate.addNewNodeButton(page).click()
|
|
|
|
const nodeCount = await locate.graphNode(page).count()
|
|
|
|
await locate.componentBrowserInput(page).locator('input').fill('re')
|
2024-01-18 16:45:18 +03:00
|
|
|
await page.keyboard.press(ACCEPT_SUGGESTION_SHORTCUT)
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount + 1)
|
|
|
|
await expect(locate.graphNode(page).last().locator('.WidgetToken')).toHaveText('re')
|
|
|
|
})
|
|
|
|
|
|
|
|
test('Filling input with suggestions', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
await locate.addNewNodeButton(page).click()
|
|
|
|
|
|
|
|
// Entering module
|
|
|
|
await locate.componentBrowserEntryByLabel(page, 'Standard.Base.Data').click()
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toExist()
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.componentBrowserInput(page).locator('input')).toHaveValue(
|
|
|
|
'Standard.Base.Data.',
|
|
|
|
)
|
|
|
|
|
|
|
|
// Applying suggestion
|
2024-03-05 10:06:11 +03:00
|
|
|
await page.keyboard.press('Tab')
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toExist()
|
2024-01-03 12:12:38 +03:00
|
|
|
await expect(locate.componentBrowserInput(page).locator('input')).toHaveValue(
|
|
|
|
'Standard.Base.Data.read ',
|
|
|
|
)
|
|
|
|
})
|
|
|
|
|
|
|
|
test('Filtering list', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
await locate.addNewNodeButton(page).click()
|
|
|
|
await locate.componentBrowserInput(page).locator('input').fill('re_te')
|
|
|
|
const segments = locate.componentBrowserEntry(page).locator('.component-label-segment')
|
|
|
|
await expect(segments).toHaveText(['Data.', 're', 'ad', '_te', 'xt'])
|
|
|
|
const highlighted = locate.componentBrowserEntry(page).locator('.component-label-segment.match')
|
|
|
|
await expect(highlighted).toHaveText(['re', '_te'])
|
2023-11-27 18:48:37 +03:00
|
|
|
})
|
2024-02-23 17:54:34 +03:00
|
|
|
|
|
|
|
test('Editing existing nodes', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
const node = locate.graphNodeByBinding(page, 'data')
|
|
|
|
const ADDED_PATH = '"/home/enso/Input.txt"'
|
|
|
|
|
|
|
|
// Start node editing
|
2024-02-26 18:34:43 +03:00
|
|
|
await locate.graphNodeIcon(node).click({ modifiers: [CONTROL_KEY] })
|
2024-02-23 17:54:34 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeVisible()
|
|
|
|
const input = locate.componentBrowserInput(page).locator('input')
|
|
|
|
await expect(input).toHaveValue('Data.read')
|
|
|
|
|
|
|
|
// Add argument and accept
|
|
|
|
await page.keyboard.press('End')
|
|
|
|
await input.pressSequentially(` ${ADDED_PATH}`)
|
|
|
|
await expect(input).toHaveValue(`Data.read ${ADDED_PATH}`)
|
|
|
|
await page.keyboard.press('Enter')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(node.locator('.WidgetToken')).toHaveText(['Data', '.', 'read', '"', '"'])
|
|
|
|
await expect(node.locator('.WidgetText input')).toHaveValue(ADDED_PATH.replaceAll('"', ''))
|
2024-02-23 17:54:34 +03:00
|
|
|
|
|
|
|
// Edit again, using "edit" button
|
|
|
|
await locate.graphNodeIcon(node).click()
|
|
|
|
await node.getByTestId('edit-button').click()
|
|
|
|
await expect(locate.componentBrowser(page)).toBeVisible()
|
|
|
|
await expect(input).toHaveValue(`Data.read ${ADDED_PATH}`)
|
|
|
|
for (let i = 0; i < ADDED_PATH.length; ++i) await page.keyboard.press('Backspace')
|
|
|
|
await expect(input).toHaveValue('Data.read ')
|
|
|
|
await page.keyboard.press('Enter')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-02-23 17:54:34 +03:00
|
|
|
await expect(node.locator('.WidgetToken')).toHaveText(['Data', '.', 'read'])
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(node.locator('.WidgetText')).toBeHidden()
|
2024-02-23 17:54:34 +03:00
|
|
|
})
|
2024-02-27 18:49:56 +03:00
|
|
|
|
|
|
|
test('Visualization preview: type-based visualization selection', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
const nodeCount = await locate.graphNode(page).count()
|
|
|
|
await locate.addNewNodeButton(page).click()
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toExist()
|
|
|
|
await expect(locate.componentBrowserEntry(page)).toExist()
|
2024-02-27 18:49:56 +03:00
|
|
|
const input = locate.componentBrowserInput(page).locator('input')
|
|
|
|
await input.fill('4')
|
|
|
|
await expect(input).toHaveValue('4')
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.jsonVisualization(page)).toExist()
|
2024-02-27 18:49:56 +03:00
|
|
|
await input.fill('Table.ne')
|
|
|
|
await expect(input).toHaveValue('Table.ne')
|
|
|
|
// The table visualization is not currently working with `executeExpression` (#9194), but we can test that the JSON
|
|
|
|
// visualization is no longer selected.
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.jsonVisualization(page)).toBeHidden()
|
2024-02-27 18:49:56 +03:00
|
|
|
await page.keyboard.press('Escape')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-02-27 18:49:56 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount)
|
|
|
|
})
|
|
|
|
|
|
|
|
test('Visualization preview: user visualization selection', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
const nodeCount = await locate.graphNode(page).count()
|
|
|
|
await locate.addNewNodeButton(page).click()
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toExist()
|
|
|
|
await expect(locate.componentBrowserEntry(page)).toExist()
|
2024-02-27 18:49:56 +03:00
|
|
|
const input = locate.componentBrowserInput(page).locator('input')
|
|
|
|
await input.fill('4')
|
|
|
|
await expect(input).toHaveValue('4')
|
2024-03-06 18:34:07 +03:00
|
|
|
await expect(locate.jsonVisualization(page)).toExist()
|
2024-04-19 16:39:45 +03:00
|
|
|
await expect(locate.jsonVisualization(page)).toContainText('"visualizedExpr": "4"')
|
2024-05-23 10:52:39 +03:00
|
|
|
await locate.toggleVisualizationSelectorButton(page).click()
|
2024-02-27 18:49:56 +03:00
|
|
|
await page.getByRole('button', { name: 'Table' }).click()
|
|
|
|
// The table visualization is not currently working with `executeExpression` (#9194), but we can test that the JSON
|
|
|
|
// visualization is no longer selected.
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.jsonVisualization(page)).toBeHidden()
|
2024-02-27 18:49:56 +03:00
|
|
|
await page.keyboard.press('Escape')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-02-27 18:49:56 +03:00
|
|
|
await expect(locate.graphNode(page)).toHaveCount(nodeCount)
|
|
|
|
})
|
2024-03-17 20:44:39 +03:00
|
|
|
|
|
|
|
test('Component browser handling of overridden record-mode', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
const node = locate.graphNodeByBinding(page, 'data')
|
|
|
|
const ADDED_PATH = '"/home/enso/Input.txt"'
|
2024-07-12 13:45:57 +03:00
|
|
|
const recordModeToggle = node.getByTestId('toggleRecord')
|
2024-03-17 20:44:39 +03:00
|
|
|
const recordModeIndicator = node.getByTestId('recordingOverriddenButton')
|
|
|
|
|
|
|
|
// Enable record mode for the node.
|
|
|
|
await locate.graphNodeIcon(node).hover()
|
2024-05-20 15:59:03 +03:00
|
|
|
await expect(recordModeToggle).toHaveClass(/toggledOff/)
|
2024-03-17 20:44:39 +03:00
|
|
|
await recordModeToggle.click()
|
2024-03-20 16:36:33 +03:00
|
|
|
// TODO[ao]: The simple move near top-left corner not always works i.e. not always
|
|
|
|
// `pointerleave` event is emitted. Investigated in https://github.com/enso-org/enso/issues/9478
|
|
|
|
// once fixed, remember to change the second `await page.mouse.move(700, 1200, { steps: 20 })`
|
|
|
|
// line below.
|
|
|
|
await page.mouse.move(700, 1200, { steps: 20 })
|
2024-03-17 20:44:39 +03:00
|
|
|
await expect(recordModeIndicator).toBeVisible()
|
|
|
|
await locate.graphNodeIcon(node).hover()
|
2024-05-20 15:59:03 +03:00
|
|
|
await expect(recordModeToggle).toHaveClass(/toggledOn/)
|
2024-03-17 20:44:39 +03:00
|
|
|
// Ensure editing in the component browser doesn't display the override expression.
|
|
|
|
await locate.graphNodeIcon(node).click({ modifiers: [CONTROL_KEY] })
|
|
|
|
await expect(locate.componentBrowser(page)).toBeVisible()
|
|
|
|
const input = locate.componentBrowserInput(page).locator('input')
|
|
|
|
await expect(input).toHaveValue('Data.read')
|
|
|
|
// Ensure committing an edit doesn't change the override state.
|
|
|
|
await page.keyboard.press('End')
|
|
|
|
await input.pressSequentially(` ${ADDED_PATH}`)
|
|
|
|
await page.keyboard.press('Enter')
|
2024-07-12 13:45:57 +03:00
|
|
|
await expect(locate.componentBrowser(page)).toBeHidden()
|
2024-03-20 16:36:33 +03:00
|
|
|
// See TODO above.
|
|
|
|
await page.mouse.move(700, 1200, { steps: 20 })
|
2024-03-17 20:44:39 +03:00
|
|
|
await expect(recordModeIndicator).toBeVisible()
|
|
|
|
// Ensure after editing the node, editing still doesn't display the override expression.
|
|
|
|
await locate.graphNodeIcon(node).click({ modifiers: [CONTROL_KEY] })
|
|
|
|
await expect(locate.componentBrowser(page)).toBeVisible()
|
|
|
|
await expect(input).toHaveValue(`Data.read ${ADDED_PATH}`)
|
|
|
|
})
|
2024-03-25 12:14:41 +03:00
|
|
|
|
|
|
|
test('AI prompt', async ({ page }) => {
|
|
|
|
await actions.goToGraph(page)
|
|
|
|
|
|
|
|
const node = locate.graphNodeByBinding(page, 'data')
|
|
|
|
await node.click()
|
|
|
|
await expect(node).toBeSelected()
|
|
|
|
await locate.graphEditor(page).press('Enter')
|
|
|
|
await expect(locate.componentBrowser(page)).toBeVisible()
|
|
|
|
|
|
|
|
await page.keyboard.insertText('AI:convert to table')
|
|
|
|
await page.keyboard.press('Enter')
|
2024-05-21 21:34:30 +03:00
|
|
|
await expect(locate.componentBrowserInput(page).locator('input')).toHaveValue('to_table')
|
|
|
|
await expect(locate.componentBrowser(page)).toHaveAttribute('data-self-argument', 'data')
|
2024-03-25 12:14:41 +03:00
|
|
|
})
|