-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore: Update selectors for Table Response #38302
Conversation
WalkthroughThis pull request focuses on updating XPath selectors in Cypress testing files. Specifically, the changes modify locators in Changes
Possibly related PRs
Suggested Labels
Suggested Reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
app/client/cypress/locators/QueryEditor.json (1)
12-12
: Transition to a data- based locator.*
Replacing the direct XPath with a data-* attribute will enhance stability and align with best practices for Cypress tests.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/cypress/locators/QueryEditor.json
(1 hunks)app/client/cypress/support/commands.js
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/locators/QueryEditor.json (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/commands.js (1)
Pattern app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
@@ -814,7 +814,7 @@ Cypress.Commands.add("ValidatePaginateResponseUrlData", (runTestCss) => { | |||
cy.wait(2000); | |||
cy.get(runTestCss).click(); | |||
cy.wait(2000); | |||
cy.xpath("//div[@class='tr'][1]//div[@class='td'][6]//span") | |||
cy.xpath("//div[@class='tr'][1]//div[@class='td mp-mask'][6]//span") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider using data- attributes instead of direct XPath.*
The updated selector relies on XPath with a class-based path. Please switch to data-* attributes or other recommended locators for improved robustness and maintainability.
@@ -839,7 +839,7 @@ | |||
cy.wait(2000); | |||
cy.get(runTestCss).click(); | |||
cy.wait(2000); | |||
cy.xpath("//div[@class='tr'][1]//div[@class='td'][6]//span") | |||
cy.xpath("//div[@class='tr'][1]//div[@class='td mp-mask'][6]//span") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Refactor to avoid XPath usage.
Again, the locator references an element by class name using XPath. Adopting data-* attributes or referencing an existing locator would align better with recommended Cypress practices.
Description
Updates the xpath selectors with the correct class names. This is only updating missed cypress selectors
Automation
/ok-to-test tags="@tag.Binding,@tag.Datasource"
🔍 Cypress test results
Caution
🔴 🔴 🔴 Some tests have failed.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12461769764
Commit: 14e0a90
Cypress dashboard.
Tags: @tag.Binding,@tag.Datasource
Spec:
The following are new failures, please fix them before merging the PR:
Mon, 23 Dec 2024 07:19:29 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
These changes enhance the application's ability to accurately locate and interact with specific UI elements.