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 DataSourceScheme #36339

Merged
merged 3 commits into from
Sep 16, 2024
Merged

test: fix DataSourceScheme #36339

merged 3 commits into from
Sep 16, 2024

Conversation

NandanAnantharamu
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu commented Sep 16, 2024

test:
Fixing DataSourceScheme test

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

Improved reliability of data source schema tests by ensuring correct UI interactions and logical flow.
Enhanced verification process by checking for the absence of loading spinners before data verification.

Bugs Raised as part of fixing the spec:

#36349
Test Skipped: #36348

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

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10885399399
Commit: 12ca3b6
Cypress dashboard.
Tags: @tag.All
Spec:


Mon, 16 Sep 2024 15:08:37 UTC

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes

    • Skipped a test case for schema fetching due to a known bug, improving test reliability.
  • New Features

    • Enhanced search functionality within the datasource structure, ensuring previous inputs do not interfere with new searches.
    • Improved interaction with the schema tab in the user interface for better testing.
  • Documentation

    • Updated the path for limited tests to focus on the "Datasource Schema" functionality.

Copy link
Contributor

coderabbitai bot commented Sep 16, 2024

Walkthrough

The pull request introduces several modifications to the Cypress testing framework, particularly focusing on the DatasourceSchema_spec.ts test file. A specific test case has been marked as skipped due to a known issue, while other tests have been restructured for improved reliability. Additionally, the path for limited tests has been updated, and enhancements have been made to the DataSources class, including a new member variable and a refined search method.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts Test case marked as skipped due to bug; adjustments made to test logic for improved reliability.
app/client/cypress/limited-tests.txt Updated path for limited tests from "Fork Template" to "Datasource Schema".
app/client/cypress/support/Pages/DataSources.ts Added private member variable _dsTabSchema; modified search method to use ClearNType.

Possibly related PRs

Suggested labels

Bug, Query & JS Pod, Integrations Product, Integrations Pod General

In the realm of code, changes take flight,
Tests are adjusted, making things right.
With schemas and searches, we tidy the way,
Ensuring our scripts work, come what may.
So here's to the fixes, both big and small,
In the world of testing, we strive for it all! 🎉


Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d8afece and 12ca3b6.

Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts

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>, please review it.
    -- 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 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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@github-actions github-actions bot added skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels Sep 16, 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 and nitpick comments (1)
app/client/cypress/support/Pages/DataSources.ts (1)

Line range hint 1376-1381: Consider using a more reliable waiting mechanism.

Instead of using fixed sleep durations like this.agHelper.Sleep(2500) and this.agHelper.Sleep(1000), it would be better to wait for specific elements to appear or network requests to complete. This would make the test more resilient to timing variations.

For example, you could wait for the query editor to be visible using this.agHelper.AssertElementVisibility and wait for the search results to load by intercepting the relevant network request.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 996e26b and 21e6f90.

Files selected for processing (3)
  • app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts (4 hunks)
  • app/client/cypress/limited-tests.txt (1 hunks)
  • app/client/cypress/support/Pages/DataSources.ts (2 hunks)
Additional context used
Path-based instructions (3)
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.
app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_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.
app/client/cypress/support/Pages/DataSources.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 (7)
app/client/cypress/limited-tests.txt (1)

2-2: Good work on updating the limited tests path!

The change in the limited tests path from cypress/e2e/Regression/ClientSide/Templates/Fork_Template_spec.js to cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts is appropriate. It correctly shifts the focus to testing the "Datasource Schema" functionality within the BugTests category.

Keep up the great work in maintaining the Cypress tests!

app/client/cypress/e2e/Regression/ClientSide/BugTests/DatasourceSchema_spec.ts (5)

6-6: Excellent work!

The import statement for locators is correctly added and follows the established pattern. Keep up the good work!


50-51: Good job skipping the test case!

Skipping the test case due to the known bug is the right approach. The comment clearly explains the reason and references the bug number. Well done!


75-81: Great job with the schema verification!

The code segment follows the best practices by using locator variables and data-* attributes for selectors. The assertion for the absence of the loading spinner is a smart move to ensure the UI is ready. The filtering and verification of the datasource schema is implemented correctly. Keep up the excellent work!


93-94: Nice work with the schema tab interaction!

Clicking on the schema tab before filtering and verifying the datasource schema is a good practice. It ensures that the schema is visible and ready for verification. The code segment follows the guidelines by using locator variables and data-* attributes for selectors. Well done!


99-99: Excellent work with the schema refresh verification!

Filtering and verifying the datasource schema after refreshing is a great way to ensure that the schema is still shown correctly. The code segment adheres to the guidelines by using locator variables and data-* attributes for selectors. Keep up the fantastic work!

app/client/cypress/support/Pages/DataSources.ts (1)

204-204: Great work declaring the _dsTabSchema property!

Assigning the CSS selector for the schema tab element to a private property is a good practice. It encapsulates the selector within the DataSources class, preventing unintended modifications from outside the class.

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit-count run_count=25

Copy link

@NandanAnantharamu NandanAnantharamu added the ok-to-test Required label for CI label Sep 16, 2024
Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/10880719238.
Cypress dashboard: Click here!
The following are new failures, please fix them before merging the PR:
To know the list of identified flaky tests - Refer here

***** Repeat Run Summary ***** Total Tests with repeat: 150 Total Passed: 125 Total Failed: 0 Total Skipped: 0 *****************************

Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
test:
Fixing DataSourceScheme test

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

Improved reliability of data source schema tests by ensuring correct UI
interactions and logical flow.
Enhanced verification process by checking for the absence of loading
spinners before data verification.

**Bugs Raised as part of fixing the spec:**

appsmithorg#36349
Test Skipped: appsmithorg#36348

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



<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10885399399>
> Commit: 12ca3b6
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10885399399&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 16 Sep 2024 15:08:37 UTC
<!-- end of auto-generated comment: Cypress test results  -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **Bug Fixes**
- Skipped a test case for schema fetching due to a known bug, improving
test reliability.
  
- **New Features**
- Enhanced search functionality within the datasource structure,
ensuring previous inputs do not interfere with new searches.
- Improved interaction with the schema tab in the user interface for
better testing.

- **Documentation**
- Updated the path for limited tests to focus on the "Datasource Schema"
functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “NandanAnantharamu” <“[email protected]”>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants