From 154878488285756e989bb5820cea9145d2c909fd Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Tue, 17 Dec 2024 11:14:34 +0100 Subject: [PATCH] [4312] Add Cypress test on Details view when its input is deselected Bug: https://github.com/eclipse-sirius/sirius-web/issues/4312 Signed-off-by: Pierre-Charles David --- .../cypress/e2e/project/details/details.cy.ts | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 integration-tests/cypress/e2e/project/details/details.cy.ts diff --git a/integration-tests/cypress/e2e/project/details/details.cy.ts b/integration-tests/cypress/e2e/project/details/details.cy.ts new file mode 100644 index 00000000000..0ebe6d0a34a --- /dev/null +++ b/integration-tests/cypress/e2e/project/details/details.cy.ts @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2024 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ + +import { Project } from '../../../pages/Project'; +import { Flow } from '../../../usecases/Flow'; +import { Details } from '../../../workbench/Details'; +import { Explorer } from '../../../workbench/Explorer'; + +describe('Details', () => { + context('Given a flow project', () => { + let flowProjectId: string = ''; + + before(() => + new Flow().createFlowProject().then((createdProjectData) => { + flowProjectId = createdProjectData.projectId; + new Project().visit(flowProjectId); + }) + ); + after(() => cy.deleteProject(flowProjectId)); + + it('no details are shown when everything is deselected', () => { + const explorer = new Explorer(); + explorer.expandWithDoubleClick('Flow'); + explorer.expandWithDoubleClick('NewSystem'); + explorer.expandWithDoubleClick('CompositeProcessor1'); + explorer.select('CompositeProcessor1'); + const details = new Details(); + details.getTextField('Name').should('exist'); + // Deselect + explorer.select('CompositeProcessor1', true); + details.getTextField('Name').should('not.exist'); + details.getDetailsView().find('h6').should('have.text', 'No object selected'); + }); + }); +});