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: Add pending tests for side by side #38881

Merged
merged 4 commits into from
Jan 29, 2025
Merged

Conversation

hetunandu
Copy link
Member

@hetunandu hetunandu commented Jan 28, 2025

Description

Automate pending manual tests for side by side mode

Automation

/ok-to-test tags="@tag.IDE, @tag.JS"

🔍 Cypress test results

Tip

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


Wed, 29 Jan 2025 07:49:49 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Added a new method to delete JavaScript objects via context menu
    • Enhanced Cypress testing capabilities for canvas view mode and debugger interactions
    • Improved test coverage for UI element rendering in editor tabs and screen modes
  • Tests

    • Added new test cases for:
      • Debugger functionality in split screen mode
      • Canvas view mode interactions
      • Verifying presence of bottom tabs in different view modes
      • API and Postgres route rendering tests
  • Chores

    • Updated import statements and test methodologies
    • Improved element selection methods in tests
    • Added new utility methods for code input and screen mode navigation

Copy link
Contributor

coderabbitai bot commented Jan 28, 2025

Warning

Rate limit exceeded

@hetunandu has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 8e6bc0f and ede2815.

📒 Files selected for processing (4)
  • app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts (2 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts (2 hunks)
  • app/client/cypress/support/Objects/CommonLocators.ts (1 hunks)
  • app/client/cypress/support/Pages/JSEditor.ts (2 hunks)

Walkthrough

This pull request introduces enhancements to the Cypress test suite, focusing on improving test coverage for JavaScript objects, debugger functionality, and canvas view modes. The changes include adding new test cases, implementing methods for deleting JS objects, and expanding assertions for UI element rendering across different screen modes.

Changes

File Change Summary
cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts Added new test case for debugger in split screen mode
cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts Added new test case for canvas view mode interactions
cypress/support/Pages/JSEditor.ts Added DeleteJSObjectFromContextMenu() method
cypress/support/index.d.ts Added updateCodeInput() method to Cypress interface
src/pages/Editor/IDE/EditorPane/JS/JSRender.test.tsx Added assertions for bottom tabs in full and split screen modes
src/pages/Editor/IDE/EditorPane/Query/QueryRender.test.tsx Added UI element rendering assertions
src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx Enhanced API entity testing and search functionality

Possibly related PRs

Suggested Labels

Test, IDE Product, User Testing, Task

Suggested Reviewers

  • ApekshaBhosale
  • sagar-qa007
  • NandanAnantharamu

Poem

🧪 Code tests dancing light,
Debuggers splitting screens so bright,
JavaScript objects take their flight,
Assertions checking left and right,
Quality code shines with might! 🚀


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.

@hetunandu hetunandu added the ok-to-test Required label for CI label Jan 28, 2025
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Jan 28, 2025
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: 1

🔭 Outside diff range comments (1)
app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts (1)

Line range hint 32-69: Replace implicit cy.wait with better alternatives

The assertTooltipPresence likely uses cy.wait internally. Per coding guidelines, avoid using cy.wait.

Consider using cy.intercept() with cy.should() for assertions instead.

🧹 Nitpick comments (6)
app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts (1)

47-76: Extract JS_OBJECT_BODY to avoid duplication

The JS_OBJECT_BODY is duplicated from the previous test case. Consider extracting it to a shared constant.

+const COMMON_JS_OBJECT_BODY = `export default {
+    myVar1: [],
+    myVar2: {},
+    myFun1 () {
+        //	write code here
+        //	this.myVar1 = [1,2,3]
+        let testing  = test + "test";
+    },
+    async myFun2 () {
+        return []
+        //	use async-await or promises
+        //	await storeValue('varName', 'hello world')
+    }
+}`;
app/client/src/pages/Editor/IDE/EditorPane/JS/JSRender.test.tsx (1)

214-217: Consider adding linter tab assertion for consistency.

The split screen mode is missing the linter tab assertion that exists in the full screen test.

  getByRole("tab", { name: /response/i });
  getByRole("tab", { name: /logs/i });
+ getByRole("tab", { name: /linter/i });
app/client/cypress/support/Pages/JSEditor.ts (1)

244-249: Add error handling for deletion failures.

The method should handle cases where the delete operation might fail.

 public DeleteJSObjectFromContextMenu() {
-  cy.get(this.contextMenuTriggerLocator).click();
-  cy.contains("Delete").should("be.visible").click();
-  cy.contains("Are you sure?").should("be.visible").click();
+  cy.get(this.contextMenuTriggerLocator)
+    .should("exist")
+    .click()
+    .then(() => {
+      cy.contains("Delete")
+        .should("be.visible")
+        .click()
+        .then(() => {
+          cy.contains("Are you sure?")
+            .should("be.visible")
+            .click();
+          cy.get("body").should("not.contain", "Error deleting object");
+        });
+    });
 }
app/client/src/pages/Editor/IDE/EditorPane/Query/QueryRender.test.tsx (3)

226-234: Consider adding logs and linter tab assertions for consistency.

The split screen mode is missing some tab assertions that exist in the full screen test.

  expect(getAllByRole("tab", { name: /headers/i })).toHaveLength(2);
+ getByRole("tab", { name: /logs/i });
+ getByRole("tab", { name: /linter/i });

437-442: Consider adding logs and linter tab assertions for consistency.

The split screen mode is missing some tab assertions that exist in the full screen test.

  getByRole("tab", { name: /datasource/i, selected: true });
  getByRole("tab", { name: /response/i });
+ getByRole("tab", { name: /logs/i });
+ getByRole("tab", { name: /linter/i });

643-648: Consider adding logs and linter tab assertions for consistency.

The split screen mode is missing some tab assertions that exist in the full screen test.

  getByRole("tab", { name: /datasource/i, selected: true });
  getByRole("tab", { name: /response/i });
+ getByRole("tab", { name: /logs/i });
+ getByRole("tab", { name: /linter/i });
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9d1f515 and 8e6bc0f.

📒 Files selected for processing (7)
  • app/client/cypress/e2e/Regression/ClientSide/Debugger/JSObjects_navigation_spec.ts (2 hunks)
  • app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts (2 hunks)
  • app/client/cypress/support/Pages/JSEditor.ts (1 hunks)
  • app/client/cypress/support/index.d.ts (1 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/JS/JSRender.test.tsx (2 hunks)
  • app/client/src/pages/Editor/IDE/EditorPane/Query/QueryRender.test.tsx (9 hunks)
  • app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
app/client/cypress/support/index.d.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/JSEditor.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/Regression/ClientSide/Debugger/JSObjects_navigation_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/Regression/ClientSide/IDE/Canvas_View_mode.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.
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
  • GitHub Check: client-unit-tests / client-unit-tests
  • GitHub Check: client-prettier / prettier-check
  • GitHub Check: client-lint / client-lint
  • GitHub Check: client-build / client-build
🔇 Additional comments (7)
app/client/cypress/e2e/Regression/ClientSide/IDE/Canvas_View_mode.ts (1)

17-28: Verify type handling for inputValue changes

The change from numeric (0) to string ("Hello") type in inputValue could cause type-related issues in dependent code.

app/client/cypress/support/index.d.ts (1)

310-311: LGTM!

The new updateCodeInput method signature is well-defined and follows TypeScript best practices.

app/client/src/pages/Editor/IDE/EditorTabs/Editortabs.test.tsx (1)

Line range hint 165-206: LGTM! Well-structured test improvements

Good use of React Testing Library best practices:

  • Proper use of act() for state updates
  • Using getByRole for better accessibility testing
  • Clear test assertions
app/client/src/pages/Editor/IDE/EditorPane/JS/JSRender.test.tsx (1)

162-166: LGTM! Good test coverage for bottom tabs.

The added assertions verify the presence of essential UI elements in full screen mode.

app/client/src/pages/Editor/IDE/EditorPane/Query/QueryRender.test.tsx (3)

173-180: LGTM! Comprehensive test coverage for API route bottom tabs.

The assertions properly verify all required tabs in full screen mode.


382-389: LGTM! Good test coverage for Postgres route bottom tabs.

The assertions properly verify all required tabs in full screen mode.


587-594: LGTM! Good test coverage for Google Sheets route bottom tabs.

The assertions properly verify all required tabs in full screen mode.

@hetunandu hetunandu enabled auto-merge (squash) January 29, 2025 06:16
@hetunandu hetunandu merged commit 1b352bb into release Jan 29, 2025
85 of 87 checks passed
@hetunandu hetunandu deleted the chore/side-by-side-tests branch January 29, 2025 07:49
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants