-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5411 from magento-tsg/2.4-develop-pr20
[TSG] TESTs Fixes for 2.4 (pr20) (2.4-develop)
- Loading branch information
Showing
6 changed files
with
126 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
app/code/Magento/Sales/Test/Mftf/ActionGroup/AssertAdminItemOrderedErrorActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?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="AssertAdminItemOrderedErrorActionGroup"> | ||
<annotations> | ||
<description>Assert that item in "Item Ordered" grid has an error/notice</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/> | ||
<argument name="messageType" defaultValue="error" type="string"/> | ||
<argument name="message" defaultValue="The requested qty is not available" type="string"/> | ||
</arguments> | ||
<see userInput="{{message}}" selector="{{AdminOrderFormItemsOrderedSection.productMessage(productName, messageType)}}" stepKey="assertItemErrorVisible"/> | ||
</actionGroup> | ||
</actionGroups> |
21 changes: 21 additions & 0 deletions
21
.../Magento/Sales/Test/Mftf/ActionGroup/AssertAdminItemOrderedErrorNotVisibleActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?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="AssertAdminItemOrderedErrorNotVisibleActionGroup"> | ||
<annotations> | ||
<description>Assert that item in "Item Ordered" grid does not have an error/notice</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/> | ||
<argument name="messageType" defaultValue="error" type="string"/> | ||
<argument name="message" defaultValue="The requested qty is not available" type="string"/> | ||
</arguments> | ||
<dontSee userInput="{{message}}" selector="{{AdminOrderFormItemsOrderedSection.productMessage(productName, messageType)}}" stepKey="assertItemErrorNotVisible"/> | ||
</actionGroup> | ||
</actionGroups> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
app/code/Magento/Sales/Test/Mftf/Test/AdminAddSelectedProductToOrderTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?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="AdminAddSelectedProductToOrderTest"> | ||
<annotations> | ||
<features value="CatalogInventory"/> | ||
<stories value="Admin create order"/> | ||
<title value="Add selected products to order in Admin when requested qty more than available"/> | ||
<description value="Trying to add selected products to order in Admin when requested qty more than available"/> | ||
<useCaseId value="MC-29184"/> | ||
<testCaseId value="MC-31589"/> | ||
<severity value="MAJOR"/> | ||
<group value="sales"/> | ||
<group value="catalogInventory"/> | ||
</annotations> | ||
<before> | ||
<createData entity="Simple_US_Customer" stepKey="simpleCustomer"/> | ||
<createData entity="SimpleProduct2" stepKey="simpleProduct"/> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> | ||
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> | ||
<actionGroup ref="logout" stepKey="logoutFromAdmin"/> | ||
</after> | ||
|
||
<!-- Initiate create new order --> | ||
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPageWithExistingCustomer"> | ||
<argument name="customer" value="$simpleCustomer$"/> | ||
</actionGroup> | ||
<!-- Add to order maximum available quantity - 1 --> | ||
<executeJS function="return {{SimpleProduct2.quantity}} - 1" stepKey="maxQtyMinusOne"/> | ||
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderWithMaxQtyMinusOne"> | ||
<argument name="product" value="$simpleProduct$"/> | ||
<argument name="productQty" value="{$maxQtyMinusOne}"/> | ||
</actionGroup> | ||
<!-- Check that there is no error or notice --> | ||
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsent"> | ||
<argument name="productName" value="$simpleProduct.name$"/> | ||
<argument name="messageType" value="notice"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsent"> | ||
<argument name="productName" value="$simpleProduct.name$"/> | ||
<argument name="messageType" value="error"/> | ||
</actionGroup> | ||
<!-- Add to order maximum available quantity --> | ||
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> | ||
<argument name="product" value="$simpleProduct$"/> | ||
<argument name="productQty" value="1"/> | ||
</actionGroup> | ||
<!-- Check that there is no error or notice --> | ||
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsentAgain"> | ||
<argument name="productName" value="$simpleProduct.name$"/> | ||
<argument name="messageType" value="notice"/> | ||
</actionGroup> | ||
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsentAgain"> | ||
<argument name="productName" value="$simpleProduct.name$"/> | ||
<argument name="messageType" value="error"/> | ||
</actionGroup> | ||
<!-- Add to order one more quantity --> | ||
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderAgain"> | ||
<argument name="product" value="$simpleProduct$"/> | ||
<argument name="productQty" value="1"/> | ||
</actionGroup> | ||
<!-- Check that error remains --> | ||
<actionGroup ref="AssertAdminItemOrderedErrorActionGroup" stepKey="assertProductErrorRemains"> | ||
<argument name="productName" value="$simpleProduct.name$"/> | ||
<argument name="messageType" value="notice"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |