-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: Adding coderabbit config file #34955
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
Changes from 6 commits
f13ed09
196b8bf
78e0fdb
6ef6fb6
95e820e
7467cbb
a36f42e
ec3c457
1f91d0a
bc6cd6c
caa8493
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json | ||
| language: "en-US" | ||
| early_access: false | ||
| tone_instructions: 'You must talk like teacher.' | ||
| reviews: | ||
| profile: "chill" | ||
| request_changes_workflow: false | ||
| high_level_summary: true | ||
| poem: true | ||
| review_status: true | ||
| collapse_walkthrough: false | ||
| auto_review: | ||
| enabled: true | ||
| drafts: false | ||
| path_instructions: | ||
| - path: "app/client/cypress/**/**.*" | ||
| instructions: | | ||
| 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. | ||
| chat: | ||
| auto_reply: true |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| deployMode, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| entityExplorer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jsEditor, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| propPane, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from "../../../../support/Objects/ObjectsCore"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import EditorNavigation, { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EntityType, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PageLeftPane, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PagePaneSegment, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } from "../../../../support/Pages/EditorNavigation"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe("removeValue", { tags: ["@tag.notcovered"] }, () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const dataDiv = "div[id='testing']"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| before(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log("before"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| beforeEach(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log("before each"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| after(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log("after"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| afterEach(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log("after each"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("Remove", function () { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.LoginUser(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.pause(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.wait(5000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.xpath("//div[@id='testing']"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get("div[id='testing']"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get(".btn.submit"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get(".div.span"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get("button[type=submit]"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(true).to.be.equal(false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get("input[type=input]").type("testing str"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get("input[type=input]").type(dataDiv); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.agHelper.Sleep(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.agHelper.Sleep(2000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _.AggregateHelper.Sleep(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.Sleep(500); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _.agHelper.Sleep(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.Sleep() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.Sleep(3000) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Multiple issues detected in the test case "Remove".
Consider refactoring the test to use API commands for setup and teardown, and replace direct string usage with constants or variables. Also, replace XPaths and CSS selectors with - cy.pause();
- cy.wait(5000);
- cy.xpath("//div[@id='testing']");
- cy.get(".btn.submit");
- cy.get("button[type=submit]");
- expect(true).to.be.equal(false);
- it.only("Remove", function () {
+ // Removed pause and wait
+ // Replaced XPath with data attributes
+ // Replaced CSS selectors with data attributes
+ // Corrected assertion
+ // Used constants for strings
+ it("Remove", function () {Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it.only("Remove", function () { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the focus from the test to ensure all tests are executed. The use of - it.only("Remove", function () {
+ it("Remove", function () {Committable suggestion
Suggested change
ToolsBiome
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.wait(5000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.xpath("//div[@id='testing']"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the focus from the test to ensure all tests are executed. The use of - it.only("Remove", function () {
+ it("Remove", function () {Committable suggestion
Suggested change
ToolsBiome
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it.only("new Remove", function () { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.LoginUser(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.wait(5000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _.AggregateHelper.Sleep(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.signUp(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.Sleep(500); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.Logout(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| _.agHelper.Sleep(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.Sleep() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.Sleep(3000) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
Multiple issues detected in the test suite:
cy.pause()andcy.wait(): These commands can lead to non-deterministic behaviors and should be replaced with more reliable synchronization methods.cy.xpath(): XPaths are discouraged due to their fragility and maintenance overhead. Usedata-*attributes instead..btn.submitandbutton[type=submit]is discouraged. Prefer usingdata-*attributes for selectors.expect(true).to.be.equal(false)) is always false and does not make sense in a test scenario.it.only: This should be removed (lines 52, 57) to ensure all tests are executed during CI runs.Consider refactoring the test to use API commands for setup and teardown, and replace direct string usage with constants or variables. Also, replace XPaths and CSS selectors with
data-*attributes for better maintainability and readability.Also applies to: 34-34, 35-35, 37-37, 39-39, 40-40, 43-49, 52-52, 54-54, 57-57, 59-59, 61-61, 63-63, 65-65, 67-67
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.
have you check these rules ? why I do not see comments for it?
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
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.
Usage of sleep functions: Multiple different sleep commands are used inconsistently. Consider standardizing or removing them if not necessary.
I want my instructions to be print everywhere. DO NOT change my instructions while comments
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.
@sagar-qa007, I understand the importance of adhering strictly to your instructions without alteration. Regarding the sleep functions, I will ensure that all comments and reviews reflect the need to standardize or remove inconsistent usage of sleep commands, as per your guidelines. If there's anything more you'd like to adjust or add, please let me know!
Learnings added
Learnings used
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.
@sagar-qa007, you're right to point out the absence of comments regarding the use of API-based methods for login, logout, and signup. It appears there was an oversight in the review process.
Using API-based methods such as
LoginFromAPI,LogOutviaAPI, andSignupFromAPIfor these actions is highly recommended in Cypress tests. This approach helps in reducing the test execution time and increases reliability by avoiding the UI for these repetitive actions. Here’s how you can refactor the login part of your test to use an API-based method:You should replace direct UI login, logout, and signup methods in your tests with these API calls. If you need further assistance on how to implement these API methods or any other queries, feel free to ask!
Learnings used
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.
have you check these rules ? why I do not see comments for it?
Perform logins via API with LoginFromAPI.
Perform logout via API with LogOutviaAPI.
Perform signup via API with SignupFromAPI.
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.
@sagar-qa007, you're right to point out the absence of comments regarding the use of API-based methods for login, logout, and signup. It appears there was an oversight in the review process.
Using API-based methods such as
LoginFromAPI,LogOutviaAPI, andSignupFromAPIfor these actions is highly recommended in Cypress tests. This approach helps in reducing the test execution time and increases reliability by avoiding the UI for these repetitive actions. Here’s how you can refactor the login part of your test to use an API-based method:You should replace direct UI login, logout, and signup methods in your tests with these API calls. If you need further assistance on how to implement these API methods or any other queries, feel free to ask!
Learnings used