test: flay table header validation (#34080)

Xpath used to read the header text is flaky.

Solution:
Replacing xpath with css locator to make it stable

EE PR: https://github.com/appsmithorg/appsmith-ee/pull/4382
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Tests**
- Updated spec names and file paths for tests related to Community
Issues and TableV2 widget.

- **Refactor**
- Simplified the selector for table headers to improve readability and
maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
NandanAnantharamu 2024-06-07 18:56:02 +05:30 committed by GitHub
parent cf18829c7d
commit bf34395a57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,9 +37,7 @@ export class Table {
private assertHelper = ObjectsRegistry.AssertHelper;
private _tableWrap = "//div[contains(@class,'tableWrap')]";
private _tableHeader =
this._tableWrap +
"//div[contains(@class,'thead')]//div[contains(@class,'tr')][1]";
private _tableHeader = ".thead div[role=columnheader]";
private _columnHeader = (columnName: string) =>
this._tableWrap +
"//div[contains(@class,'thead')]//div[contains(@class,'tr')][1]//div[@role='columnheader']//div[contains(text(),'" +
@ -258,7 +256,7 @@ export class Table {
}
public AssertTableHeaderOrder(expectedOrder: string) {
cy.xpath(this._tableHeader)
cy.get(this._tableHeader)
.invoke("text")
.then((x) => {
expect(x).to.eq(expectedOrder);