Skip to content

test: added new case#38308

Merged
sagar-qa007 merged 1 commit intoreleasefrom
test/templatenewcasesfork
Dec 23, 2024
Merged

test: added new case#38308
sagar-qa007 merged 1 commit intoreleasefrom
test/templatenewcasesfork

Conversation

@sagar-qa007
Copy link
Contributor

@sagar-qa007 sagar-qa007 commented Dec 23, 2024

Description

Added new test case for the template module.

Fixes Issue URL

Automation

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

🔍 Cypress test results

Tip

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


Mon, 23 Dec 2024 08:19:52 UTC

Communication

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

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Introduced a new test suite for validating template functionality in the client-side application.
    • Added comprehensive test cases to verify data bindings and button actions within templates.
  • Tests

    • Enhanced the testing framework with checks for data source connections and user interactions.

@sagar-qa007 sagar-qa007 added the ok-to-test Required label for CI label Dec 23, 2024
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2024

Walkthrough

This pull request introduces a new Cypress test suite for template functionality in a client-side application. The test suite focuses on validating data bindings and button actions within a template, specifically for a Vehicle Maintenance App. The tests verify template forking, widget interactions, page navigation, and ensure no error messages are present during these operations.

Changes

File Change Summary
app/client/cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts Added two new test cases:
1. Verifying data bindings and template forking
2. Checking button actions, page navigation, and API interactions

Suggested labels

skip-changelog, Templates Product, Test

Suggested reviewers

  • ApekshaBhosale
  • NandanAnantharamu

Possibly related PRs

Poem

🚗 Engines of code, templates in flight,
Cypress tests dancing with byte-powered might!
Widgets click, pages turn with grace,
No errors shall escape this testing space! 🧪
Quality rides on, smooth and bright! 🌟

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


🪧 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 skip-changelog Adding this label to a PR prevents it from being listed in the changelog Test labels Dec 23, 2024
@sagar-qa007
Copy link
Contributor Author

/ci-test-limit-count run_count=1 update_snapshot=true specs_to_run=cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts

@sagar-qa007
Copy link
Contributor Author

/ci-test-limit-count run_count=5 update_snapshot=true specs_to_run=cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12463358784.
Cypress dashboard
PR: #38308 with spec: cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts .

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

🧹 Nitpick comments (3)
app/client/cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts (3)

21-27: Consider using data- attribute for text-based clicks.*
Currently, you're clicking the string "Vehicle Maintenance App" (line 24). It's preferable to use a data-* locator for more robust and maintainable tests.

- agHelper.ContainsNClick("Vehicle Maintenance App");
+ agHelper.ClickElement(template.vehicleAppLocator); // Example using a data-* locator

30-34: Verify naming consistency for widget entities.
"Container2CopyCopy" might be a temporary or auto-generated name. For clarity and maintainability, consider assigning more descriptive labels to widgets.


53-53: Avoid using text-based selectors for "Open Menu".
Using text-based selectors can become brittle. Prefer referencing a data-* attribute or a dedicated locator from your JSON locators file.

- agHelper.ClickButton("Open Menu");
+ agHelper.ClickButton(template.openMenuBtn);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0785c55 and d7d11f8.

📒 Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
app/client/cypress/e2e/Regression/ClientSide/Templates/Template_DataBindingFunctions_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/Regression/ClientSide/Templates/Template_DataBindingFunctions_spec.ts (2)

1-8: No direct usage of forbidden Cypress commands detected.
It's good that you haven't used cy.wait, cy.pause, or agHelper.sleep in the test setup, in accordance with the project's Cypress guidelines.


70-74: Efficient handling of query actions and validations.
It's good that you're using dataSources.RunQuery() and dataSources.AssertQueryResponseHeaders(). Multiple assertions here ensure reliable test coverage.

@github-actions
Copy link

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12463358784.
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: 10 Total Passed: 10 Total Failed: 0 Total Skipped: 0 *****************************

Copy link
Contributor

@NandanAnantharamu NandanAnantharamu left a comment

Choose a reason for hiding this comment

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

Lgtm

@sagar-qa007 sagar-qa007 merged commit c5238ff into release Dec 23, 2024
@sagar-qa007 sagar-qa007 deleted the test/templatenewcasesfork branch December 23, 2024 13:21
NandanAnantharamu pushed a commit that referenced this pull request Dec 27, 2024
## Description
Added new test case for the template module.


Fixes [Issue
URL](https://app.zenhub.com/workspaces/stability-pod-6690c4814e31602e25cab7fd/issues/gh/appsmithorg/appsmith/38309)

## Automation

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

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


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

## Summary by CodeRabbit

- **New Features**
- Introduced a new test suite for validating template functionality in
the client-side application.
- Added comprehensive test cases to verify data bindings and button
actions within templates.

- **Tests**
- Enhanced the testing framework with checks for data source connections
and user interactions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
github-actions bot pushed a commit to Zeral-Zhang/appsmith that referenced this pull request Feb 7, 2025
## Description
Added new test case for the template module.


Fixes [Issue
URL](https://app.zenhub.com/workspaces/stability-pod-6690c4814e31602e25cab7fd/issues/gh/appsmithorg/appsmith/38309)

## Automation

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

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


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

## Summary by CodeRabbit

- **New Features**
- Introduced a new test suite for validating template functionality in
the client-side application.
- Added comprehensive test cases to verify data bindings and button
actions within templates.

- **Tests**
- Enhanced the testing framework with checks for data source connections
and user interactions.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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