Skip to content

Commit

Permalink
Merge pull request #5411 from magento-tsg/2.4-develop-pr20
Browse files Browse the repository at this point in the history
[TSG] TESTs Fixes for 2.4 (pr20) (2.4-develop)
  • Loading branch information
zakdma authored Mar 2, 2020
2 parents 690500f + 9207083 commit b21d60c
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<requiredEntity createDataKey="createConfigProduct"/>
</createData>
<updateData entity="ApiSimpleProductUpdateDescription" stepKey="updateConfigProduct" createDataKey="createConfigProduct"/>
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
</before>
<after>
<!-- @TODO: Uncomment once MQE-679 is fixed -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
</before>
<after>
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/>
<actionGroup ref="logout" stepKey="adminLogout"/>
</after>
<!-- Step 0: User signs up an account -->
<comment userInput="Start of signing up user account" stepKey="startOfSigningUpUserAccount" />
Expand Down
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>
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>
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<element name="configureSelectAttribute" type="select" selector="select[id*=attribute]"/>
<element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/>
<element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/>
<element name="productMessage" type="text" selector="//section[@id = 'order-items']//span[text()='{{productName}}']/ancestor::tr/..//div[contains(@class, 'message-{{messageType}}')]" parameterized="true"/>
</section>
</sections>
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>

0 comments on commit b21d60c

Please sign in to comment.