From 0166ed6f306c443f27363910e1dea5d01688236b Mon Sep 17 00:00:00 2001 From: Axel RICHARD Date: Thu, 13 Aug 2026 15:29:14 +0200 Subject: [PATCH] [test] Fix flaky playwright test Signed-off-by: Axel RICHARD --- .../playwright/helpers/PlaywrightExplorer.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/integration-tests-playwright/playwright/helpers/PlaywrightExplorer.ts b/integration-tests-playwright/playwright/helpers/PlaywrightExplorer.ts index 7d7d26d736..91b9e9bb80 100644 --- a/integration-tests-playwright/playwright/helpers/PlaywrightExplorer.ts +++ b/integration-tests-playwright/playwright/helpers/PlaywrightExplorer.ts @@ -45,12 +45,19 @@ export class PlaywrightExplorer { representationLabel: string ) { await this.explorerLocator.getByTestId(`${treeItemLabel}-more`).click(); - await this.page.getByTestId('new-representation').click({ force: true }); - await this.page.getByTestId('name').clear(); - await this.page.getByTestId('name').fill(representationLabel); - await this.page.getByTestId('representationDescription').click(); - await this.page.getByTestId(representationDescriptionName).click(); - await this.page.getByTestId('create-representation').click(); + const contextMenu = this.page.getByTestId('treeitem-contextmenu'); + await expect(contextMenu).toBeVisible(); + await contextMenu.getByTestId('new-representation').click(); + + const dialog = this.page.locator('[aria-labelledby="dialog-title"]'); + await expect(dialog).toBeVisible(); + await dialog.getByTestId('name').clear(); + await dialog.getByTestId('name').fill(representationLabel); + await dialog.getByTestId('representationDescription').click(); + await this.page.locator('.MuiPopover-root').getByTestId(representationDescriptionName).click(); + await dialog.getByTestId('create-representation').click(); + await expect(dialog).toBeHidden(); + await expect(this.page.getByTestId(`representation-tab-${representationLabel}`)).toBeVisible(); } async select(treeItemLabel: string) {