-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: PartialExport_Widgets_spec - updated test validation logic #33371
Conversation
/ci-test-limit |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9058077690. |
WalkthroughWalkthroughThe recent changes focus on enhancing the Cypress test suite for partial import and export of widgets. Key updates include adding helper functions for widget property validation, renaming test cases, and updating import/export functionalities. Additionally, new imports and methods have been introduced to streamline the testing process, ensuring more robust validations and efficient test case management. Changes
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review due to trivial changes (1)
Additional Context UsedLanguageTool (1)
Additional comments not posted (1)
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
/ci-test-limit |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9058124081. |
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: 1
app/client/cypress/limited-tests.txt
Outdated
@@ -1,5 +1,5 @@ | |||
# To run only limited tests - give the spec names in below format: |
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.
Consider revising the sentence for grammatical accuracy.
- # To run only limited tests - give the spec names in below format:
+ # To run only limited tests - give the spec names in the format below:
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.
# To run only limited tests - give the spec names in below format: | |
# To run only limited tests - give the spec names in the format below: |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9058124081. |
/ci-test-limit runId=9058124081 |
13 similar comments
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
/ci-test-limit runId=9058124081 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9064885071. |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9064885755. |
/ci-test-limit runId=9058124081 |
1 similar comment
/ci-test-limit runId=9058124081 |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9064886481. |
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
Outside diff range and nitpick comments (2)
app/client/src/sagas/PartialImportExportSagas/PartialExportSagas.ts (2)
Line range hint
25-82
: Consider refactoring the download functionality into a separate function for better testability and maintainability.- (function downloadJSON(response: unknown) { - const dataStr = - "data:text/json;charset=utf-8," + - encodeURIComponent(JSON.stringify(response)); - const downloadAnchorNode = document.createElement("a"); - downloadAnchorNode.setAttribute("href", dataStr); - downloadAnchorNode.setAttribute("download", `${application.name}.json`); - document.body.appendChild(downloadAnchorNode); // required for firefox - downloadAnchorNode.click(); - downloadAnchorNode.remove(); - })((response as { data: unknown }).data); + const downloadJSON = (response: unknown, applicationName: string) => { + const dataStr = + "data:text/json;charset=utf-8," + + encodeURIComponent(JSON.stringify(response)); + const downloadAnchorNode = document.createElement("a"); + downloadAnchorNode.setAttribute("href", dataStr); + downloadAnchorNode.setAttribute("download", `${applicationName}.json`); + document.body.appendChild(downloadAnchorNode); // required for firefox + downloadAnchorNode.click(); + downloadAnchorNode.remove(); + }; + downloadJSON((response as { data: unknown }).data, application.name);
Line range hint
82-125
: Consider adding user feedback for cases where no widgets are selected.- if (!selectedWidgets || !selectedWidgets.length) return; + if (!selectedWidgets || !selectedWidgets.length) { + toast.show(createMessage(ERROR_NO_WIDGETS_SELECTED), { + kind: "warning", + }); + return; + }
/ci-test-limit |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9171948467. |
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
Outside diff range and nitpick comments (1)
app/client/cypress/limited-tests.txt (1)
Line range hint
8-8
: Consider adding the article "the" for grammatical correctness.- #ci-test-limit uses this file to run minimum of specs. Do not run entire suite with this command. + #ci-test-limit uses this file to run the minimum of specs. Do not run the entire suite with this command.
/ci-test-limit |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/9172602363. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9172602363. |
Spec - cypress/e2e/Regression/ClientSide/PartialImportExport/PartialExport_Widgets_spec.ts
RCA:
Comparison of this file post export is failing this file needed change.
closeModal('Insert_Modal')) is changed to closeModal(Insert_Modal.name)) and
showModal('Delete_Modal')) to showModal(Delete_Modal.name))
Solution:
To overcome this issue of frequent updation of file we have come up with a solution to validate the partial import post export in a different way.