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: fixed skipped graphQL test #35571

Merged
merged 5 commits into from
Aug 14, 2024
Merged

test: fixed skipped graphQL test #35571

merged 5 commits into from
Aug 14, 2024

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Aug 9, 2024

Description

Context:
This cypress test is asserting the fixes made for bug
Bug recording: https://www.loom.com/share/ccf9fccc89064ee7b4230aaf5bf3cc52

Basically bug was that when using bindings inside query of graphQL API, autocomplete menu shows up for first binding, but not for second binding. This test case asserts that autocomplete menu shows up every time inside binding for query

EE PR: https://github.com/appsmithorg/appsmith-ee/pull/4856

This PR fixes the skipped test of spec file: cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts

Fixes #35147
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Datasource"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10383572807
Commit: 0a655d7
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Wed, 14 Aug 2024 09:15:08 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Updated the test for a GraphQL binding issue, now actively validating the resolution of a formatting bug that affected autocomplete functionality.
    • Enhanced test clarity by removing redundant code and optimizing the test flow for improved execution efficiency.
  • Chores
    • Changed the focus of the limited test scenario to prioritize addressing the GraphQL binding bug over template-related functionalities.

Copy link
Contributor

coderabbitai bot commented Aug 9, 2024

Sure! Let’s go through this in a structured manner.

Walkthrough

The recent changes reactivated a previously skipped test case in the Cypress test suite, focusing on a GraphQL binding issue. This update improves the clarity and functionality of the test by optimizing the logic and removing unnecessary elements. Overall, these changes ensure that the test actively validates the resolution of the identified bug, thereby enhancing the robustness of the testing framework.

Changes

Files Change Summary
app/client/cypress/e2e/Regression/ClientSide/BugTests/...GraphQL_Binding_Bug16702_Spec.ts Reactivated a test case for a GraphQL bug, removed commented code, and optimized the test flow.
app/client/cypress/limited-tests.txt Updated the test path from template tests to the GraphQL bug test, indicating a priority shift.

Assessment against linked issues

Objective Addressed Explanation
Fix flakiness of the test (#[35147])

In the code's dance, the test takes its chance,
No longer skipped, it joins the advance.
With clarity bright and flow so smooth,
It checks the bug, in a testy groove!
So let us rejoice, for progress is grand,
In the realm of code, we take a stand! 🎉

This format presents the changes effectively while celebrating the effort involved. If you have any further questions or need more information, feel free to ask!


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sneha122 sneha122 removed their assignment Aug 9, 2024
@github-actions github-actions bot added cypress-flaky-fix This label is auto-added when a PR which only has Cypress fixes are merged to release Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod Stability Pod For all issues/tasks to be prioritized under Stability pod Task A simple Todo skip-changelog Adding this label to a PR prevents it from being listed in the changelog labels Aug 9, 2024
@sneha122
Copy link
Contributor Author

sneha122 commented Aug 9, 2024

/ci-test-limit

Copy link

github-actions bot commented Aug 9, 2024

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (2)
app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts (2)

44-48: Use locator variables instead of plain strings.

The selector .t--graphql-query-editor pre.CodeMirror-line span is used directly. It's a good practice to use locator variables for maintainability and readability.

- cy.get(".t--graphql-query-editor pre.CodeMirror-line span")
+ cy.get(_.locators._graphqlQueryEditorSpan)

Make sure to define _.locators._graphqlQueryEditorSpan in your locators file.


58-62: Ensure multiple assertions for robustness.

The test checks for the autocomplete menu. Consider adding more assertions to verify other aspects of the UI or data state to ensure comprehensive validation.

// Example: Add assertions to check the presence of the autocomplete menu
cy.get(_.locators._hints).should('be.visible');

This will help ensure the test is robust and covers more scenarios.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 92b8f81 and dc9fda9.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts (3 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts (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.
Additional comments not posted (1)
app/client/cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts (1)

23-23: Great job reactivating the test!

The test is now active and ready to validate the bug resolution. Make sure to keep the test focused and efficient.

Copy link

github-actions bot commented Aug 9, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10316852912.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

sneha122 commented Aug 9, 2024

/ci-test-limit

Copy link

github-actions bot commented Aug 9, 2024

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dc9fda9 and 047433c.

Files selected for processing (1)
  • app/client/cypress/limited-tests.txt (1 hunks)
Additional context used
Path-based instructions (1)
app/client/cypress/limited-tests.txt (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.
Additional comments not posted (1)
app/client/cypress/limited-tests.txt (1)

2-2: Good Job! The test focus is well-adjusted.

The change to include GraphQL_Binding_Bug16702_Spec.ts in the limited tests aligns with the PR's goal to address specific issues. This helps ensure that the test suite focuses on resolving critical bugs.

Copy link

github-actions bot commented Aug 9, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10317230880.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

sneha122 commented Aug 9, 2024

/ci-test-limit runId=10317230880

Copy link

github-actions bot commented Aug 9, 2024

Copy link

github-actions bot commented Aug 9, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10318304444.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

sneha122 commented Aug 9, 2024

/ci-test-limit runId=10317230880

Copy link

github-actions bot commented Aug 9, 2024

Copy link

github-actions bot commented Aug 9, 2024

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10319765095.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

/ci-test-limit runId=10317230880

Copy link

Copy link

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10365574087.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

/ci-test-limit

Copy link

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10367754008.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122
Copy link
Contributor Author

/ci-test-limit

Copy link

@sneha122
Copy link
Contributor Author

/ci-test-limit

1 similar comment
@sneha122
Copy link
Contributor Author

/ci-test-limit

Copy link

Copy link

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10370254371.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10370269798.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10370270847.
Cypress dashboard url: Click here!
All cypress tests have passed 🎉🎉🎉

@sneha122 sneha122 added the ok-to-test Required label for CI label Aug 14, 2024
@sneha122 sneha122 changed the title chore: fixed skipped graphQL test test: fixed skipped graphQL test Aug 14, 2024
@github-actions github-actions bot added the Test label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cypress-flaky-fix This label is auto-added when a PR which only has Cypress fixes are merged to release Integrations Pod General Issues related to the Integrations Pod that don't fit into other tags. Integrations Product Issues related to a specific integration ok-to-test Required label for CI Query & JS Pod Issues related to the query & JS Pod skip-changelog Adding this label to a PR prevents it from being listed in the changelog Stability Pod For all issues/tasks to be prioritized under Stability pod Task A simple Todo Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Fix flakiness of cypress/e2e/Regression/ClientSide/BugTests/GraphQL_Binding_Bug16702_Spec.ts
3 participants