Skip to content

Commit

Permalink
test: fix canvas context property pane (#36356)
Browse files Browse the repository at this point in the history
EE PR: appsmithorg/appsmith-ee#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"



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10919160204>
> Commit: 3d5c864
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10919160204&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.IDE`
> Spec:
> <hr>Wed, 18 Sep 2024 09:42:19 UTC
<!-- end of auto-generated comment: Cypress test results  -->

---------

Co-authored-by: “NandanAnantharamu” <“[email protected]”>
  • Loading branch information
NandanAnantharamu and “NandanAnantharamu” committed Sep 18, 2024
1 parent e592ece commit 9f7e624
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

0 comments on commit 9f7e624

Please sign in to comment.