From a0a4a2fef3f0da117cb52c8ac7c2de7b15af134a Mon Sep 17 00:00:00 2001 From: Ilya Bogdanov Date: Wed, 11 Sep 2024 15:40:24 +0400 Subject: [PATCH] Add regression e2e test for empty graph (#11031) Closes #11026 --- app/gui2/e2e/emptyGraph.spec.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/gui2/e2e/emptyGraph.spec.ts diff --git a/app/gui2/e2e/emptyGraph.spec.ts b/app/gui2/e2e/emptyGraph.spec.ts new file mode 100644 index 0000000000..7a92a44b84 --- /dev/null +++ b/app/gui2/e2e/emptyGraph.spec.ts @@ -0,0 +1,23 @@ +import { test } from '@playwright/test' +import * as actions from './actions' +import { expect } from './customExpect' +import { CONTROL_KEY, DELETE_KEY } from './keyboard' +import * as locate from './locate' + +test('graph can be empty', async ({ page }) => { + await actions.goToGraph(page) + await expect(locate.graphEditor(page)).toExist() + await expect(locate.graphNode(page)).toExist() + + await locate.graphEditor(page).press(`${CONTROL_KEY}+A`) + await locate.graphEditor(page).press(`${DELETE_KEY}`) + + await expect(locate.graphNode(page)).toHaveCount(0) + + await locate.addNewNodeButton(page).click() + await expect(locate.componentBrowserInput(page)).toBeVisible() + await page.keyboard.insertText('foo') + await page.keyboard.press(`${CONTROL_KEY}+Enter`) + await expect(locate.graphNode(page)).toHaveCount(1) + await expect(locate.graphNode(page).locator('.WidgetToken')).toHaveText(['foo']) +})