-
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
Changes from 4 commits
ff1a003
0e78fe4
ff5de32
1dab430
6b1837b
589b1d2
4ba689a
9e99f43
6359ac5
ade5168
1f0bcbf
937f9e5
2221a8b
32ae2ff
3fb5db4
e38122a
3b0e854
7006a96
beac203
564a8a6
ffc0ab7
247817a
5ec7bd4
52b5270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminGoToCreditmemoViewActionGroup"> | ||
<annotations> | ||
<description>Goes to the Order Creditmemo View Page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="identifier" type="string"/> | ||
</arguments> | ||
|
||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. Please, add a new line at the end of the file |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||
<?xml version="1.0" encoding="UTF-8"?> | ||||
<!-- | ||||
/** | ||||
* Copyright © Magento, Inc. All rights reserved. | ||||
* See COPYING.txt for license details. | ||||
*/ | ||||
--> | ||||
|
||||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||||
<test name="AdminOpenCreditmemoViewPageWithWrongCreditmemoIdTest"> | ||||
<annotations> | ||||
<stories value="Creditmemo Page With Wrong Creditmemo Id"/> | ||||
<title value="Open Creditmemo View Page with Wrong Creditmemo Id"/> | ||||
<description value="Open Creditmemo View Page with Wrong Creditmemo Id."/> | ||||
<severity value="MAJOR"/> | ||||
<group value="sales"/> | ||||
</annotations> | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove the unnecessary spaces on the MFTF files. |
||||
<before> | ||||
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> | ||||
</before> | ||||
|
||||
<after> | ||||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||||
</after> | ||||
|
||||
<actionGroup ref="AdminGoToCreditmemoViewActionGroup" stepKey="navigateOpenCreditmemoViewPage"> | ||||
<argument name="identifier" value="test"/> | ||||
</actionGroup> | ||||
|
||||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||||
|
||||
<seeInCurrentUrl url="{{AdminCreditmemosGridPage.url}}" stepKey="redirectToCreditmemosGridPage"/> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||
|
||||
<see selector="{{AdminMessagesSection.error}}" userInput='This creditmemo no longer exists.' | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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. |
||||
stepKey="seeErrorMessage"/> | ||||
</test> | ||||
</tests> | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, add a new line at the end of the file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminGoToShipmentViewActionGroup"> | ||
<annotations> | ||
<description>Goes to the Order Shipment View Page.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="identifier" type="string"/> | ||
</arguments> | ||
|
||
<amOnPage url="{{AdminShipmentViewPage.url}}/{{identifier}}" stepKey="amOnShipmentViewPage"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminShipmentViewPage" url="sales/shipment/view/shipment_id" area="admin" module="Shipping"> | ||
</page> | ||
</pages> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminOpenShipmentViewPageWithWrongShipmentIdTest"> | ||
<annotations> | ||
<stories value="Shipment Page With Wrong Shipment Id"/> | ||
<title value="Open Shipment View Page with Wrong Shipment Id"/> | ||
<description value="Open Shipment View Page with Wrong Shipment Id."/> | ||
<severity value="MAJOR"/> | ||
<group value="shipping"/> | ||
</annotations> | ||
|
||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> | ||
</before> | ||
|
||
<after> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminGoToShipmentViewActionGroup" stepKey="navigateOpenShipmentViewPage"> | ||
<argument name="identifier" value="test"/> | ||
</actionGroup> | ||
|
||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
|
||
<seeInCurrentUrl url="{{AdminShipmentsGridPage.url}}" stepKey="redirectToShipmentsGridPage"/> | ||
|
||
<see selector="{{AdminMessagesSection.error}}" userInput='This shipment 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.
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 implementationmagento2/app/code/Magento/Sales/Test/Mftf/ActionGroup/AdminOpenOrderByEntityIdActionGroup.xml
Line 11 in ae280ac
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.