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 tests by replacing external APIs #32718

Merged
merged 5 commits into from
Apr 18, 2024

Conversation

NandanAnantharamu
Copy link
Collaborator

@NandanAnantharamu NandanAnantharamu commented Apr 17, 2024

replaced some external APIs with ted APIs

Summary by CodeRabbit

  • Bug Fixes
    • Removed assertions for offsetHeight and offsetWidth in the test case related to a fixed canvas size being visible when height is selected as Fixed.
    • Updated URL references in the test script from "https://randomuser.me" to "http:https://host.docker.internal:8000" for image sources.
    • Updated API endpoints for two requests in the API_Bugs_Spec.js file.
    • Updated image URLs in JSON files for fixtures related to widgets in the client application.
  • Tests
    • Updated API endpoint URLs in test scripts to enhance reliability and internal consistency.
    • Modified image source URLs in various test fixtures to align with updated internal hosting.
  • Documentation
    • Updated source URLs in iframe configurations to reflect new internal hosting paths.

Warning

The provided command lacks proper tags. Please modify PR body, specifying the tags you want to include or use /ok-to-test tags="@tag.All" to run all specs.
Explore the tags documentation here

Copy link
Contributor

coderabbitai bot commented Apr 17, 2024

Walkthrough

Walkthrough

The recent changes aim to enhance test scripts for mobile responsiveness and widget functionality while transitioning from external to internal URLs in test and fixture files. These modifications seek to bolster reliability and control over test environments by utilizing local server endpoints.

Changes

File Path Change Summary
.../MobileResponsiveTests/BasicAppView_MobileViewPort_spec.ts Introduces tests for mobile responsiveness in the basic app view.
.../Widgets/Modal/Modal_spec.ts Removed offsetHeight and offsetWidth assertions in specific test cases.
.../Widgets/TableV2/TableV2_Url_Column_spec.ts, .../fixtures/Listv2/Listv2JSObjects.json, .../fixtures/tableResizedColumnsDsl.json, .../fixtures/tableV2ResizedColumnsDsl.json Updated image source URLs from external to internal (host.docker.internal).
.../ServerSide/ApiTests/API_Bugs_Spec.js, .../fixtures/IframeDsl.json, .../fixtures/IframeOnSrcDocChange.json Updated API endpoints and iframe source URLs to local server links.

Possibly related issues

These changes focus on ensuring the test environment reflects the latest application and infrastructure updates, potentially resolving issues related to testing consistency and reliability.


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b58be4d and 77f1acf.
Files selected for processing (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/client/cypress/e2e/Regression/ClientSide/Widgets/Modal/Modal_spec.ts

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

/ci-test-limit

Copy link

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

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

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit

Copy link

Copy link

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

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit

Copy link

Copy link

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

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit

Copy link

@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit

1 similar comment
@NandanAnantharamu
Copy link
Collaborator Author

/ci-test-limit

Copy link

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: 1

cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_onSrcDocChange_spec.js
cypress/e2e/Regression/ClientSide/Widgets/Iframe/Iframe_spec.js
cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js
cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the typo in the spec name.

- ListV2_SerververSide_spec.js
+ ListV2_ServerSide_spec.js

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js
cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_ServerSide_spec.js

Copy link

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

Copy link

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

Copy link

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

@@ -137,8 +136,8 @@ describe(
agHelper.AssertElementVisibility(locators._modal);

//Verify that a fixed canvas size is visible when height is selected as Fixed
agHelper.AssertProperty(locators._modal, "offsetHeight", 1094);
agHelper.AssertProperty(locators._modal, "offsetWidth", 456);
// agHelper.AssertProperty(locators._modal, "offsetHeight", 1094);
Copy link
Contributor

Choose a reason for hiding this comment

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

let's remove these

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js
cypress/e2e/Regression/ClientSide/Widgets/ListV2/ListV2_SerververSide_spec.js
cypress/e2e/Regression/ClientSide/Widgets/TableV1/Table_Column_Resize_spec.js
cypress/e2e/Regression/ClientSide/Widgets/TableV2/TableV2_Column_Resize_spec.js
Copy link
Contributor

Choose a reason for hiding this comment

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

remember to revert limited test file before merge

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@trishaanand trishaanand merged commit 905c738 into release Apr 18, 2024
15 checks passed
@trishaanand trishaanand deleted the test/replaceExternalApis1 branch April 18, 2024 13:31
"source": "https:https://www.example.com",
"source": "http:https://host.docker.internal:8000/a.txt",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this works.

  1. On CI, port 8000 is bound to the Cloud services container, not TED.
  2. The a.txt file doesn't exist in TED anymore.

Am I missing something? 🤔

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.

None yet

4 participants