Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix MaintainContext spec #36409

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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 @@ -56,7 +56,7 @@ describe("MaintainContext&Focus", { tags: ["@tag.IDE"] }, function () {
EditorNavigation.SelectEntityByName("Rest_Api_2", EntityType.Api);

cy.wait(1000);
cy.xpath("//span[contains(text(), 'Headers')]").click();
cy.xpath("//span[contains(text(), 'Headers')]").first().click();
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid using XPaths for selectors, class. Use data- attributes instead.*

XPaths are brittle and can break easily if the structure of the DOM changes. It's best to use data-* attributes for more reliable and maintainable selectors.

cy.updateCodeInput(apiwidget.headerValue, "test");
cy.wait("@saveAction");

Expand Down
2 changes: 1 addition & 1 deletion app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To run only limited tests - give the spec names in below format:
cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js
cypress/e2e/Regression/ClientSide/IDE/MaintainContext&Focus_spec.js

# For running all specs - uncomment below:
#cypress/e2e/**/**/*
Expand Down
Loading