-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Cypress test for validating file uploads greater than 20MB #38496
Conversation
WalkthroughThis pull request introduces a new Cypress test suite focused on validating file upload functionality for files larger than 20MB. The test specifically checks file upload using binary format and multipart form data, addressing potential issues with large file uploads. The test suite involves configuring a File Picker widget, uploading a file, and verifying the API response, with the test being added to the limited test configuration. Changes
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
/ci-test-limit-count run_count=20 update_snapshot=true specs_to_run=cypress/e2e/Regression/ServerSide/ApiTests/API_Bug_Upload_File_GreaterThan_20MB_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/12632340258. |
There was a problem hiding this 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/ServerSide/ApiTests/API_Bug_Upload_File_GreaterThan_20MB_spec.ts (3)
1-10
: Consider consistent import style and naming.You're mixing CommonJS (
require
) and ES imports. For consistency, prefer using ES import syntax or ensure both styles follow a uniform approach across your codebase.
19-38
: Use data- attributes for better maintainability.*Currently, "Select Files" is used to locate the button. The coding guidelines recommend data-* attributes instead of text-based locators. It improves test stability and consistency.
39-63
: Multiple assertions recommended.While you're correctly asserting the status code and checking the response text, consider adding additional expectations, such as verifying headers, response time, or other relevant checks if applicable to ensure a more robust test.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bug_Upload_File_GreaterThan_20MB_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/ApiTests/API_Bug_Upload_File_GreaterThan_20MB_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.
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (2)
app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bug_Upload_File_GreaterThan_20MB_spec.ts (1)
13-16
: Good use of describe block with tags.The describe block is clear, references the bug number, and includes relevant tags. No issues here.
app/client/cypress/limited-tests.txt (1)
2-2
: Good update to limited tests path.Replacing the visual test spec with this new server-side test spec helps focus on the file upload scenario.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12632340258.
|
2 failures were due to the fact that settings config failed to load. Not related to the test. |
Description
This PR introduces a Cypress test to validate the functionality of uploading files larger than 20MB using the File Picker widget and a POST API.
Tests: #34123
Automation
/ok-to-test tags="@tag.Datasource, @tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12633295995
Commit: 5ee713a
Cypress dashboard.
Tags:
@tag.Datasource, @tag.Sanity
Spec:
Mon, 06 Jan 2025 14:20:44 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit