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: replaced 3rd apty api in API_On_Load spec #36529

Closed
wants to merge 2 commits into from

Conversation

NandanAnantharamu
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu commented Sep 25, 2024

replacing 3rd party API with TED api
/ok-to-test tags="@tag.JS"

Tip

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


Wed, 25 Sep 2024 10:41:35 UTC

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit-count run_count=25

Copy link
Contributor

coderabbitai bot commented Sep 25, 2024

Walkthrough

This pull request introduces changes primarily focused on updating API endpoint references and test specifications. The API test case in APIOnLoad_Spec.ts has transitioned from a public endpoint to a local development endpoint, alongside a simplification of data access. Additionally, the limited-tests.txt file has been modified to redirect limited tests from client-side templates to server-side API load tests, reflecting a shift in testing priorities.

Changes

File Path Change Summary
app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts Updated API endpoint from a public URL to a local development URL and simplified data access structure.
app/client/cypress/limited-tests.txt Changed the entry for limited tests to focus on APIOnLoad_Spec.ts, moving from client-side to server-side testing.

Possibly related PRs

Suggested labels

skip-changelog, ok-to-test, Test

Suggested reviewers

  • ApekshaBhosale
  • sagar-qa007

In the realm of code, changes abound,
From public to local, new paths are found.
Tests shift their focus, a server-side spree,
With data streamlined, as clear as can be.
So let’s celebrate this coding delight,
For each little change makes our software bright! 🌟


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.

@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/limited-tests.txt (1)

2-2: Well done, class! This change looks splendid!

Now, let's take a moment to appreciate the thoughtful modification you've made. You've successfully replaced the client-side template test with a server-side API load test. This aligns perfectly with our lesson plan of replacing the third-party API with the TED API.

Remember, children, in the world of testing, it's important to keep our focus on what matters most. By updating this file, you're ensuring that our limited tests are targeting the right areas.

As your teacher, I'd like to give you a little homework assignment. Consider if there are any additional tests we should include in our limited test suite. It's always good to be thorough!

If you think of any other crucial tests, feel free to add them to this file. For example:

cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts
+ cypress/e2e/Regression/ServerSide/AnotherImportantTest_Spec.ts

Don't forget to raise your hand if you need any help with this assignment!

app/client/cypress/e2e/Regression/ServerSide/OnLoadTests/APIOnLoad_Spec.ts (1)

57-57: Let's discuss best practices for our test code, class!

While our code is looking good overall, I'd like to bring your attention to a small improvement we can make. In line 57, we're using a string selector for "Table data". Remember, it's a best practice to use locator variables for our selectors. This makes our tests more maintainable and easier to update if our UI changes.

Here's a little homework assignment:

  1. Create a locator variable for the "Table data" selector.
  2. Use this variable in our propPane.UpdatePropertyFieldValue() call.

This small change will make our code more robust and easier to maintain in the long run. Who wants to give it a try?

Consider creating a locator variable for the "Table data" selector and using it in the propPane.UpdatePropertyFieldValue() call. This will improve the maintainability of our test code.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 20fa8de and b09d271.

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

49-49: Class, let's examine the API endpoint change.

I see you've updated the API endpoint to use a local Docker address. While this might be helpful for local testing, we need to ensure it doesn't cause issues in other environments. Let's consider the following:

  1. Is this change intentional for all environments or just for local testing?
  2. Should we use an environment variable instead of hardcoding the URL?
  3. How will this affect our CI/CD pipeline?

Remember, in the real world, we often need to handle multiple environments. Let's discuss how we can make this more flexible!

Can you please clarify the intention behind this change and how it will be managed across different environments?


57-57: Now, let's turn our attention to the Table data property update.

I notice you've simplified the data access by removing one level of nesting. This is an interesting change! Let's consider a few points:

  1. Has the structure of PageLoadApi2.data changed to warrant this update?
  2. Will this affect how the data is displayed in the table?
  3. Have we tested this change to ensure the table still displays correctly?

Remember, when we make changes to data structures, it's crucial to verify that all dependent components still function as expected. Let's make sure our table is still happy with this new data format!

Could you please confirm that you've tested the table display with this new data structure? It would be great to see some test results or screenshots to ensure everything is working as intended.

Copy link

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

@NandanAnantharamu NandanAnantharamu added the ok-to-test Required label for CI label Sep 25, 2024
Copy link

github-actions bot commented Oct 2, 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 2, 2024
@NandanAnantharamu
Copy link
Collaborator Author

closing this as its redundant

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 Stale Test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants