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: udpated 3rd party api for Commandclick nav spec #36545

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

NandanAnantharamu
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu commented Sep 25, 2024

replace 3rd API with TED
/ok-to-test tags="@tag.IDE"

Summary by CodeRabbit

  • New Features

    • Updated the test suite to focus on command click navigation within the IDE.
  • Bug Fixes

    • Adjusted the base URL for the data source in the navigation test to reflect local development settings.
  • Chores

    • Modified the limited tests execution list to prioritize IDE command click navigation tests over template-related tests.

Tip

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


Thu, 26 Sep 2024 05:55:50 UTC

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

The pull request introduces changes to test specifications within the Cypress framework, specifically updating the URL for a command click navigation test from a public domain to a local development address. Additionally, it modifies the list of tests executed during limited runs, replacing a template test with the new command click navigation test, thereby refocusing the testing efforts.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js Updated URL in cy.updateCodeInput from a public URL to a local development URL; added to limited tests execution list.
app/client/cypress/limited-tests.txt Replaced entry for limited tests from a template test to the command click navigation test.

Possibly related PRs

Suggested labels

skip-changelog, ok-to-test, Test

Suggested reviewers

  • jsartisan
  • rahulbarwal

Poem

In the land of tests where code does flow,
A click navigates, and now we know,
From public to local, the path is clear,
A shift in focus, let’s give a cheer!
With limited tests, we sharpen our aim,
In the world of Cypress, we play the game! 🎉


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.

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit-count run_count=25

@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
Copy link

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 (2)
app/client/cypress/e2e/Regression/ClientSide/IDE/Command_Click_Navigation_spec.js (2)

82-82: Class, let's examine this URL change, shall we?

I see you've updated the URL to use a local development address. Very good! This change allows for testing against a local environment, which can be quite useful. However, let's consider a few things:

  1. Remember that using "host.docker.internal" might not work in all environments. It's specific to Docker for Mac and Windows.

  2. We should think about how this will affect our CI/CD pipeline. Will this URL work in all testing environments?

  3. For extra credit, consider using environment variables for the URL. This way, we can easily switch between different environments without changing the code. For example:

Cypress.env('API_URL') + "/{{ SQL_Query.data }}"

Then you can set the API_URL in your Cypress configuration or when running the tests.

Any questions, class?


Line range hint 1-238: Attention, class! Let's review our test file hygiene.

While you've done a commendable job on many aspects, there are a few areas where we need to improve to meet our coding guidelines:

  1. I've noticed several instances of cy.wait() and agHelper.Sleep(). Remember, class, we want to avoid these as they can make our tests flaky and slow. Instead, let's use Cypress's built-in retry-ability and wait for specific elements or network requests.

  2. Some of our selectors could use a bit of polishing. While we're using data-* attributes in some places (good job!), we're still relying on class names or complex selectors in others. Let's aim to use data-* attributes consistently throughout our tests.

  3. Well done on avoiding cy.pause(), it.only, and duplicate filenames! You're showing great progress in these areas.

For homework, I'd like you to:

  1. Replace cy.wait() and agHelper.Sleep() with appropriate Cypress commands that wait for specific conditions.
  2. Update all selectors to use data-* attributes.

Here's an example of how you might refactor a wait:

// Instead of:
cy.wait(2000);
cy.get('.some-class').click();

// Do this:
cy.get('[data-cy=some-element]').should('be.visible').click();

Any questions before you start your revisions?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

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

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

2-2: Class, let's review this change together.

Now, children, pay attention to line 2. We've updated our test file selection, haven't we? This is an excellent example of focusing our efforts on a specific area of study. We've moved from studying templates to examining the IDE's command click navigation. This aligns perfectly with our lesson plan, doesn't it?

Remember, when we make changes like this, we're telling our testing system which areas to concentrate on. It's just like when I ask you to open your textbooks to a specific page - we're directing our attention to what's most important right now.

Any questions before we move on?

Copy link

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

@NandanAnantharamu NandanAnantharamu added the ok-to-test Required label for CI label Sep 26, 2024
@NandanAnantharamu NandanAnantharamu merged commit cc96737 into release Sep 26, 2024
47 checks passed
@NandanAnantharamu NandanAnantharamu deleted the test/replaceAPI5 branch September 26, 2024 06:39
Shivam-z pushed a commit to Shivam-z/appsmith that referenced this pull request Sep 26, 2024
)

replace 3rd API with TED
/ok-to-test tags="@tag.IDE"



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

## Summary by CodeRabbit

- **New Features**
- Updated the test suite to focus on command click navigation within the
IDE.
  
- **Bug Fixes**
- Adjusted the base URL for the data source in the navigation test to
reflect local development settings.

- **Chores**
- Modified the limited tests execution list to prioritize IDE command
click navigation tests over template-related tests.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

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

---------

Co-authored-by: “NandanAnantharamu” <“nandan@thinkify.io”>
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