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

chore: Automation test cases added for shared drive gsheet #38341

Open
wants to merge 3 commits into
base: release
Choose a base branch
from

Conversation

sneha122
Copy link
Contributor

@sneha122 sneha122 commented Dec 24, 2024

Description

This PR adds automation test cases for Google sheet shared drive support feature. Skipping the cases due to chrome crash.

Run success : https://github.com/appsmithorg/appsmith/actions/runs/12599681652/job/35117116909

Fixes #37916
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/12600683395
Commit: da06642
Cypress dashboard.
Tags: @tag.Datasource
Spec:


Fri, 03 Jan 2025 17:12:50 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • Tests
    • Skipped multiple Cypress test suites for Google Sheets functionality
    • Added a new test suite for Google Sheets widget binding with selected sheet access
    • Disabled existing test suites for GSheet functional tests and widget binding

@sneha122
Copy link
Contributor Author

/build-deploy-preview skip-tests=true

Copy link
Contributor

coderabbitai bot commented Dec 24, 2024

Walkthrough

The pull request involves modifications to Cypress end-to-end test suites for Google Sheets functionality. Multiple test files in the app/client/cypress/e2e/GSheet/ directory have been updated, primarily by using describe.skip() to disable test execution. One new test suite was added for widget binding with shared drive selected sheet access, focusing on testing Google Sheets integration features.

Changes

File Change Summary
cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts Skipped entire test suite using describe.skip()
cypress/e2e/GSheet/SharedDrive_SelectedSheet_Access_Spec.ts Added comprehensive test suite for Google Sheets operations
cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts Skipped entire test suite using describe.skip()
cypress/e2e/GSheet/WidgetBinding_SharedDrive_SelectedSheet_Access_Spec.ts Added new test suite for widget binding with shared drive access

Assessment against linked issues

Objective Addressed Explanation
Add Automation Test Cases for Google Sheet Shared Drive Support [#37916]

Possibly related PRs

Suggested labels

Integrations Pod General

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007

Poem

🌈 Sheets of data, skipped with care,
Cypress tests dance without a scare,
Shared drives whisper their secret song,
Automation marches boldly along!
🚀 Code review magic, tests take flight!


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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 Google Sheets Issues related to Google Sheets Integrations Product Issues related to a specific integration Query & JS Pod Issues related to the query & JS Pod Task A simple Todo labels Dec 24, 2024
Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/12478237255.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: ``.
PR: 38341.
recreate: .

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 24, 2024
Copy link

Deploy-Preview-URL: https://ce-38341.dp.appsmith.com

@sneha122
Copy link
Contributor Author

Moving it to blocked state as renderer is crashing when running gsheet test cases, run details here. Active discussion happening in the thread

Copy link

github-actions bot commented Jan 1, 2025

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions bot added the Stale label Jan 1, 2025
@sagar-qa007 sagar-qa007 force-pushed the chore/gs-shared-drive-test-cases branch from 983ba09 to 94922d2 Compare January 3, 2025 15:00
@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Jan 3, 2025
@sneha122 sneha122 marked this pull request as ready for review January 4, 2025 10:05
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: 2

🧹 Nitpick comments (2)
app/client/cypress/e2e/GSheet/SharedDrive_SelectedSheet_Access_Spec.ts (1)

363-367: Avoid using after hook in Cypress tests
The coding guidelines discourage the use of after or afterEach for cleanup in e2e tests. Consider using a dedicated cleanup step within each test or a shared utility instead.

-after("Delete app", function () {
+// Perform cleanup within the relevant tests or an alternative approach (e.g., a custom command) instead of after()
app/client/cypress/e2e/GSheet/WidgetBinding_SharedDrive_SelectedSheet_Access_Spec.ts (1)

86-110: Follow Cypress guidelines for cleanup
Avoid after hooks. Instead, consolidate cleanup logic within each test or use a dedicated pre-test setup that ensures a clean environment.

-after("Delete app", function () {
+// Move this cleanup logic into a custom command or inside test body if truly necessary
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2e4e11 and da06642.

📒 Files selected for processing (4)
  • app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts (1 hunks)
  • app/client/cypress/e2e/GSheet/SharedDrive_SelectedSheet_Access_Spec.ts (1 hunks)
  • app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts (1 hunks)
  • app/client/cypress/e2e/GSheet/WidgetBinding_SharedDrive_SelectedSheet_Access_Spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • app/client/cypress/e2e/GSheet/SelectedSheet_Access_Spec.ts
  • app/client/cypress/e2e/GSheet/WidgetBinding_SelectedAccess_Spec.ts
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/GSheet/SharedDrive_SelectedSheet_Access_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/e2e/GSheet/WidgetBinding_SharedDrive_SelectedSheet_Access_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 (2)
app/client/cypress/e2e/GSheet/SharedDrive_SelectedSheet_Access_Spec.ts (1)

19-24: Avoid skipping essential tests
Disabling the entire test suite using describe.skip might hide regressions. If these tests must be skipped, consider referencing a tracking ticket and reactivating them as soon as possible.

app/client/cypress/e2e/GSheet/WidgetBinding_SharedDrive_SelectedSheet_Access_Spec.ts (1)

24-28: Revisit describe.skip usage
Skipping the entire suite might obscure critical coverage. If necessary, leave a clear TODO or reference ticket to ensure re-enablement when stable.

"Deleted row successfully!",
);
});
agHelper.Sleep(500);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove agHelper.Sleep() calls
Using agHelper.Sleep(…) violates the Cypress best practice of avoiding arbitrary sleeps. Cypress provides hooks to wait for specific elements or requests using aliases (e.g., cy.wait("@alias")) or queries (cy.get(selector)).

-        agHelper.Sleep(500);
...
-        agHelper.Sleep();
+        // Replace these sleeps with an appropriate assertion or wait logic

Also applies to: 328-328

"Deleted row successfully!",
);
});
agHelper.Sleep(500);
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Eliminate reliance on agHelper.Sleep(500)
Using hard-coded sleeps may cause flaky tests. Prefer waiting on deterministic events or specific conditions.

-        agHelper.Sleep(500);
+        // Replace with an explicit wait on a DOM element, network call, or custom condition

Committable suggestion skipped: line range outside the PR's diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Google Sheets Issues related to Google Sheets 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 Stale Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Add Automation test cases for google sheet shared drive support
2 participants