From 9f7e624b7052720401bfecc21ed8aac793d607dc Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:31:40 +0530 Subject: [PATCH] test: fix canvas context property pane (#36356) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5161 RCA: The property section related validations were not working Solution: - Enhanced verification of property pane section visibility using accessibility attributes. - Introduced new UI interaction properties for managing collapsible sections. /ok-to-test tags="@tag.IDE" > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 3d5c864891f027d03e5d50ddb15a185f980d83aa > Cypress dashboard. > Tags: `@tag.IDE` > Spec: >
Wed, 18 Sep 2024 09:42:19 UTC --------- Co-authored-by: “NandanAnantharamu” <“nandan@thinkify.io”> --- .../IDE/Canvas_Context_Property_Pane_2_spec.js | 14 ++++++++------ .../cypress/support/Objects/CommonLocators.ts | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js index de6f555307..1d317d7589 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_2_spec.js @@ -195,12 +195,14 @@ function verifyPropertyPaneSectionState(propertySectionState) { for (const [sectionName, shouldSectionOpen] of Object.entries( propertySectionState, )) { - cy.get("body").then(($body) => { - const isSectionOpen = - $body.find(`${propertySectionClass(sectionName)} .t--chevron-icon`) - .length > 0; - expect(isSectionOpen).to.equal(shouldSectionOpen); - }); + cy.get(`${propertySectionClass(sectionName)}`) + .siblings(_.locators._propertyCollapse) + .find(_.locators._propertyCollapseBody) + .invoke("attr", "aria-hidden") + .then((isSectionOpen) => { + const expectedValue = shouldSectionOpen ? "false" : "true"; + expect(isSectionOpen).to.equal(expectedValue); + }); } } diff --git a/app/client/cypress/support/Objects/CommonLocators.ts b/app/client/cypress/support/Objects/CommonLocators.ts index 3db2224e7c..9bcf7c1cfe 100644 --- a/app/client/cypress/support/Objects/CommonLocators.ts +++ b/app/client/cypress/support/Objects/CommonLocators.ts @@ -339,4 +339,6 @@ export class CommonLocators { _selectClearButton_testId = "selectbutton.btn.cancel"; _selectClearButton_dataTestId = `[data-testid="${this._selectClearButton_testId}"]`; _saveDatasource = `[data-testid='t--store-as-datasource']`; + _propertyCollapseBody = ".bp3-collapse-body"; + _propertyCollapse = ".bp3-collapse"; }