test: fix canvas context property pane (#36356)

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"



<!-- 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: 3d5c864891f027d03e5d50ddb15a185f980d83aa
> <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” <“nandan@thinkify.io”>
This commit is contained in:
NandanAnantharamu 2024-09-18 17:31:40 +05:30 committed by GitHub
parent e592eceaa8
commit 9f7e624b70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -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);
});
}
}

View File

@ -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";
}