-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fatal error page occurs if use wrong shipment id ,invoice id ,creditmemo id passed in url #30410
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
Fatal error page occurs if use wrong shipment id ,invoice id ,creditmemo id passed in url #30410
Conversation
…id in url of view page.
…id in url of view page.
Hi @GovindaSharma. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
#dmcdindia2020 |
@magento create issue |
@magento run all tests |
@magento give me test instance |
Hi @GovindaSharma. Thank you for your request. I'm working on Magento instance for you. |
Hi @GovindaSharma, here is your Magento Instance: https://c0f4193f0636baaeb8cd2e25ecf8c4df.instances.magento-community.engineering |
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.
Hi @GovindaSharma. Thank you for your contribution. Great Job!
Please, check my comments below. Please note, my recommendations are also applicable for all three entities (I've left the comments for credit memo only)
<amOnPage url="{{AdminCreditmemoViewPage.url}}/{{identifier}}" stepKey="amOnCreditmemoViewPage"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
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.
Please, add a new line at the end of the file
<see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' | ||
stepKey="seeErrorMessage"/> | ||
</test> | ||
</tests> |
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.
Please, add a new line at the end of the file
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminGoToCreditmemoViewActionGroup"> |
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.
I would suggest renaming this action group to something like AdminOpenCreditMemoByEntityIdActionGroup
. Just to use more or less the same naming as, for example, in the following implementation
magento2/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml
Line 11 in ae280ac
<actionGroup name="AdminOpenOrderByEntityIdActionGroup"> |
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.
Hi @rogyar .Thaks for your review. But can you please let me know what is the need of renaming the action group name? i have used this name based on other action group name.
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.
This one is not critical, but you may find the example of another action group in the Sales module in my previous comment. My recommendation is more about keeping the names transparent, i.e.
- AdminOpenCreditMemoByEntityIdActionGroup (new)
- AdminOpenOrderByEntityIdActionGroup (existing)
|
||
<seeInCurrentUrl url="{{AdminCreditmemosGridPage.url}}" stepKey="redirectToCreditmemosGridPage"/> | ||
|
||
<see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' |
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.
Please, use the following action group instead
magento2/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertMessageInAdminPanelActionGroup.xml
Line 11 in 83e3487
<actionGroup name="AssertMessageInAdminPanelActionGroup"> |
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.
Hi @rogyar what is the need of changing action group name for this file as it belongs to Magento_Backend module, i have done commits on Sales and Shipping module.
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.
The main reason is following the best practices and building the test body using action groups only. If we already have an action group for some purpose it's recommended to use it rather than introduce a new check.
|
||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
|
||
<seeInCurrentUrl url="{{AdminCreditmemosGridPage.url}}" stepKey="redirectToCreditmemosGridPage"/> |
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.
I would suggest using the following action group instead if possible
magento2/app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminAssertPageTitleActionGroup.xml
Line 11 in 83e3487
<actionGroup name="AdminAssertPageTitleActionGroup"> |
✔️ QA Passed Manual testing scenario: 1.Create An Order In Magento 2.Create invoice, shipment and creditmemo of that Order 3.View the created shipment,invoice and creditmemo 4.Now change the shipment id ,invoiceid and creditmemo id from url(use that id which does not exist) and run the url. Before: ✖️ error on pages occur Invoice Shipment Credit Memo After: ✔️ Proper error messages Order Invoice Shipment Credit Memo |
@magento run all tests |
…e id ,creditmemo id passed in url #30410
Hi @GovindaSharma, thank you for your contribution! |
@magento give me 2.4-develop instance |
Hi @GovindaSharma. Thank you for your request. I'm working on Magento instance for you. |
Hi @GovindaSharma, here is your Magento Instance: https://c0f4193f0636baaeb8cd2e25ecf8c4df-2-4-develop.instances.magento-community.engineering |
Preconditions (*)
Magento 2.4 Develop
Description (*)
Fatal error page occurs if use wrong shipment id ,invoice id ,creditmemo id passed in url
Fixes #30424
Related Pull Requests
https://github.com/magento/partners-magento2ee/pull/417
Manual testing scenarios (*)
1.Create An Order In Magento
2.Create invoice, shipment and creditmemo of that Order
3.View the created shipment,invoice and creditmemo
4.Now change the shipment id ,invoiceid and creditmemo id from url(use that id which does not exist) and run the url.
Expected result (*)
A proper error message should come
Actual Result (*)
error page occurs
Contribution checklist (*)
Resolved issues: