From 006dbfd46a2843dec41db186dbc0c45e7b755d4a Mon Sep 17 00:00:00 2001 From: NandanAnantharamu <67676905+NandanAnantharamu@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:39:44 +0530 Subject: [PATCH] test:Fix canvas context prop01 (#36391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EE PR: https://github.com/appsmithorg/appsmith-ee/pull/5159 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: c996a38fba4d94cf80baf574d6ad3db75b2bb8cf > Cypress dashboard. > Tags: `@tag.IDE` > Spec: >
Wed, 18 Sep 2024 14:10:07 UTC ## Summary by CodeRabbit - **New Features** - Improved test logic for verifying the state of property pane sections, enhancing accessibility compliance. - Updated limited tests to include new test specifications for the property pane. - **Bug Fixes** - Enhanced robustness of tests by refining visibility state checks using ARIA attributes. - **Chores** - Expanded locator capabilities in the testing framework to support new UI components related to collapsible sections. --------- Co-authored-by: “NandanAnantharamu” <“nandan@thinkify.io”> --- .../IDE/Canvas_Context_Property_Pane_1_spec.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js index 9b4fca2e6bc..0913adcfa78 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js +++ b/app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_Context_Property_Pane_1_spec.js @@ -211,12 +211,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"; // Convert boolean to aria-hidden value + expect(isSectionOpen).to.equal(expectedValue); + }); } }