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: updated 3rd party API fr CommunityIssue Spec #36544

Closed
wants to merge 1 commit into from

Conversation

NandanAnantharamu
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu commented Sep 25, 2024

We have skipped some unwanted tests which are redundant or they are covered elsewhere

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

Summary by CodeRabbit

  • Bug Fixes

    • Updated input value in the Community Issues test to ensure accurate data entry.
  • Documentation

    • Revised test specification for limited tests to reference the Community Issues test file.

@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 25, 2024
@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit-count run_count=25

Copy link

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The changes in this pull request involve updates to test specifications within the Cypress testing framework. Specifically, the input value for a test case has been altered, and references to test files have been modified in the limited-tests.txt file to reflect these changes. The focus is on ensuring that the correct test cases are executed during limited test runs.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts Updated input value from https://github.com/appsmithorg/appsmith/issues/12532 to http://host.docker.internal:5001.
app/client/cypress/limited-tests.txt Changed test specification from Fork_Template_spec.js to CommunityIssues_Spec.ts.

Possibly related PRs

Suggested labels

ok-to-test

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007

🌟 In the realm of code, changes take flight,
Input values shift, making tests feel just right.
From Fork to Community, the specs now align,
With each little tweak, our tests will shine!
So let’s run them with glee, and watch them succeed,
For every small change plants a testing seed! 🌱


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 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.

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/e2e/Regression/Apps/CommunityIssues_Spec.ts (1)

Line range hint 1-424: Class, let's review our overall test strategy.

While we've made a small but significant change to use a local testing environment, there are several areas where we can improve our test suite:

  1. Avoid using cy.wait: I've noticed several instances of cy.wait in our code. Remember, explicit waits can make our tests brittle. Let's use Cypress's built-in retry-ability instead.

  2. Use data-* attributes: We should update our selectors to use data-* attributes throughout the file. This will make our tests more resilient to UI changes.

  3. Avoid XPaths and CSS paths: While we're doing well in this area, let's ensure we consistently use best practices for selectors.

  4. Login via API: Consider using LoginFromAPI for authentication steps to speed up our tests.

  5. Avoid it.only: Make sure we're not leaving any it.only statements in our code, as this can prevent other tests from running.

Let's work on refactoring this test suite to align with these best practices. Who would like to volunteer to start this important task?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between cdb22f4 and 8080194.

📒 Files selected for processing (2)
  • app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts (1 hunks)
  • app/client/cypress/limited-tests.txt (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
app/client/cypress/e2e/Regression/Apps/CommunityIssues_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/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 (2)
app/client/cypress/limited-tests.txt (1)

2-2: Class, let's examine this change carefully.

Good morning, students! Today, we're going to analyze an important modification in our test specification. Can anyone tell me what's different? That's right! We've updated our test file from Fork_Template_spec.js to CommunityIssues_Spec.ts.

Now, who can tell me what this change might imply? Yes, you in the back! Correct, it suggests we're moving from JavaScript to TypeScript. And what about the path change? Excellent observation! We've reorganized our test structure from Regression/ClientSide/Templates to Regression/Apps.

This change aligns perfectly with our lesson plan - I mean, PR objectives - of updating the third-party API for CommunityIssue Spec. Well done, team!

Let's do a quick pop quiz to ensure we haven't missed anything:

app/client/cypress/e2e/Regression/Apps/CommunityIssues_Spec.ts (1)

312-312: ⚠️ Potential issue

Class, let's examine this change carefully.

The URL has been modified from a GitHub issue link to a local Docker URL. This alteration suggests a shift towards using a local environment for testing, which is a commendable approach. However, we must ensure this doesn't disrupt our existing test suite.

Let's run a quick check to see if this URL is used elsewhere in our codebase:

Additionally, we should verify if this change aligns with our Cypress best practices:

  1. Are we avoiding cy.wait? ✅
  2. Are we using data-* attributes for selectors? ❌ (We should consider updating this)
  3. Are we avoiding XPaths and CSS paths? ✅

To improve our test, let's consider updating our selector to use a data-* attribute:

-        .type("http://host.docker.internal:5001");
+        .invoke('attr', 'data-cy', 'issue-link-input')
+        .type("http://host.docker.internal:5001");

Remember, class, using data-* attributes makes our tests more resilient to UI changes!

✅ Verification successful

Great job!

The replacement of the GitHub URL with the local Docker URL is consistent across the test suite and doesn't impact other parts of the codebase. This change aligns well with our testing environment setup and should not introduce any issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of the old and new URLs
echo "Searching for the old GitHub URL:"
rg "https://github.com/appsmithorg/appsmith/issues/12532"
echo "Searching for the new Docker URL:"
rg "http://host.docker.internal:5001"

Length of output: 10018

Copy link

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

***** Repeat Run Summary ***** Total Tests with repeat: 250 Total Passed: 147 Total Failed: 103 Total Skipped: 0 *****************************

Copy link

github-actions bot commented Oct 3, 2024

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 Oct 3, 2024
@NandanAnantharamu
Copy link
Collaborator Author

redundant hence closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Adding this label to a PR prevents it from being listed in the changelog Stale Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant