Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe(
// rename entities
it("3. makes branch specific resource updates", function () {
gitSync.SwitchGitBranch(childBranchKey);
EditorNavigation.SelectEntityByName("ParentPage1", EntityType.Page);
EditorNavigation.NavigateToPage("ParentPage1", true);
entityExplorer.RenameEntityFromExplorer(
"ParentPage1",
"ParentPageRenamed",
Expand Down Expand Up @@ -181,8 +181,10 @@ describe(
"response.body.responseMeta.status",
200,
);
cy.get(".t--page-switch-tab").contains("ParentPage1").click();
cy.get(".t--widget-tablewidgetv2").should("exist");
cy.get(".t--page-switch-tab")
.contains("ParentPage1")
.click({ force: true });
agHelper.WaitUntilEleAppear(".t--widget-tablewidgetv2");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid force clicking and use data- attributes for selectors.*

The current implementation uses force click and CSS class selectors which could be brittle.

Apply this diff to improve the test reliability:

-cy.get(".t--page-switch-tab")
-  .contains("ParentPage1")
-  .click({ force: true });
-agHelper.WaitUntilEleAppear(".t--widget-tablewidgetv2");
+cy.get('[data-testid="t--page-switch-tab"]')
+  .contains("ParentPage1")
+  .should('be.visible')
+  .click();
+cy.get('[data-testid="t--widget-tablewidgetv2"]')
+  .should('be.visible');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cy.get(".t--page-switch-tab")
.contains("ParentPage1")
.click({ force: true });
agHelper.WaitUntilEleAppear(".t--widget-tablewidgetv2");
cy.get('[data-testid="t--page-switch-tab"]')
.contains("ParentPage1")
.should('be.visible')
.click();
cy.get('[data-testid="t--widget-tablewidgetv2"]')
.should('be.visible');

});
});
});
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# To run only limited tests - give the spec names in below format:
#cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
cypress/e2e/Regression/ClientSide/Git/GitSync/SwitchBranches_spec.js
# For running all specs - uncomment below:
#cypress/e2e/**/**/*
cypress/e2e/Regression/ClientSide/Anvil/Widgets/*
#cypress/e2e/Regression/ClientSide/Anvil/Widgets/*

#ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command.