Skip to content

Commit b21d60c

Browse files
authored
Merge pull request #5411 from magento-tsg/2.4-develop-pr20
[TSG] TESTs Fixes for 2.4 (pr20) (2.4-develop)
2 parents 690500f + 9207083 commit b21d60c

File tree

6 files changed

+126
-2
lines changed

6 files changed

+126
-2
lines changed

app/code/Magento/ConfigurableProduct/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@
6161
<requiredEntity createDataKey="createConfigProduct"/>
6262
</createData>
6363
<updateData entity="ApiSimpleProductUpdateDescription" stepKey="updateConfigProduct" createDataKey="createConfigProduct"/>
64+
<!-- Reindex invalidated indices after product attribute has been created/deleted -->
65+
<actionGroup ref="CliRunReindexUsingCronJobsActionGroup" stepKey="reindexInvalidatedIndices"/>
6466
</before>
6567
<after>
6668
<!-- @TODO: Uncomment once MQE-679 is fixed -->

app/code/Magento/Customer/Test/Mftf/Test/EndToEndB2CLoggedInUserTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
</before>
2525
<after>
2626
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
27-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2828
<actionGroup ref="DeleteCustomerFromAdminActionGroup" stepKey="deleteCustomerFromAdmin"/>
29-
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
29+
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearProductsGridFilters"/>
30+
<actionGroup ref="logout" stepKey="adminLogout"/>
3031
</after>
3132
<!-- Step 0: User signs up an account -->
3233
<comment userInput="Start of signing up user account" stepKey="startOfSigningUpUserAccount" />
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminItemOrderedErrorActionGroup">
11+
<annotations>
12+
<description>Assert that item in "Item Ordered" grid has an error/notice</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/>
16+
<argument name="messageType" defaultValue="error" type="string"/>
17+
<argument name="message" defaultValue="The requested qty is not available" type="string"/>
18+
</arguments>
19+
<see userInput="{{message}}" selector="{{AdminOrderFormItemsOrderedSection.productMessage(productName, messageType)}}" stepKey="assertItemErrorVisible"/>
20+
</actionGroup>
21+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AssertAdminItemOrderedErrorNotVisibleActionGroup">
11+
<annotations>
12+
<description>Assert that item in "Item Ordered" grid does not have an error/notice</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="productName" defaultValue="{{_defaultProduct.name}}" type="string"/>
16+
<argument name="messageType" defaultValue="error" type="string"/>
17+
<argument name="message" defaultValue="The requested qty is not available" type="string"/>
18+
</arguments>
19+
<dontSee userInput="{{message}}" selector="{{AdminOrderFormItemsOrderedSection.productMessage(productName, messageType)}}" stepKey="assertItemErrorNotVisible"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsOrderedSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<element name="configureSelectAttribute" type="select" selector="select[id*=attribute]"/>
1919
<element name="itemsSKU" type="text" selector="(//div[contains(@class, 'product-sku-block')])[{{productNumber}}]" parameterized="true"/>
2020
<element name="moveProduct" type="select" selector="//td[contains(.,'{{productName}}')]/../..//td//select" parameterized="true"/>
21+
<element name="productMessage" type="text" selector="//section[@id = 'order-items']//span[text()='{{productName}}']/ancestor::tr/..//div[contains(@class, 'message-{{messageType}}')]" parameterized="true"/>
2122
</section>
2223
</sections>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminAddSelectedProductToOrderTest">
12+
<annotations>
13+
<features value="CatalogInventory"/>
14+
<stories value="Admin create order"/>
15+
<title value="Add selected products to order in Admin when requested qty more than available"/>
16+
<description value="Trying to add selected products to order in Admin when requested qty more than available"/>
17+
<useCaseId value="MC-29184"/>
18+
<testCaseId value="MC-31589"/>
19+
<severity value="MAJOR"/>
20+
<group value="sales"/>
21+
<group value="catalogInventory"/>
22+
</annotations>
23+
<before>
24+
<createData entity="Simple_US_Customer" stepKey="simpleCustomer"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct"/>
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
</before>
28+
<after>
29+
<deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/>
30+
<deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/>
31+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
32+
</after>
33+
34+
<!-- Initiate create new order -->
35+
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPageWithExistingCustomer">
36+
<argument name="customer" value="$simpleCustomer$"/>
37+
</actionGroup>
38+
<!-- Add to order maximum available quantity - 1 -->
39+
<executeJS function="return {{SimpleProduct2.quantity}} - 1" stepKey="maxQtyMinusOne"/>
40+
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderWithMaxQtyMinusOne">
41+
<argument name="product" value="$simpleProduct$"/>
42+
<argument name="productQty" value="{$maxQtyMinusOne}"/>
43+
</actionGroup>
44+
<!-- Check that there is no error or notice -->
45+
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsent">
46+
<argument name="productName" value="$simpleProduct.name$"/>
47+
<argument name="messageType" value="notice"/>
48+
</actionGroup>
49+
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsent">
50+
<argument name="productName" value="$simpleProduct.name$"/>
51+
<argument name="messageType" value="error"/>
52+
</actionGroup>
53+
<!-- Add to order maximum available quantity -->
54+
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder">
55+
<argument name="product" value="$simpleProduct$"/>
56+
<argument name="productQty" value="1"/>
57+
</actionGroup>
58+
<!-- Check that there is no error or notice -->
59+
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsentAgain">
60+
<argument name="productName" value="$simpleProduct.name$"/>
61+
<argument name="messageType" value="notice"/>
62+
</actionGroup>
63+
<actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsentAgain">
64+
<argument name="productName" value="$simpleProduct.name$"/>
65+
<argument name="messageType" value="error"/>
66+
</actionGroup>
67+
<!-- Add to order one more quantity -->
68+
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderAgain">
69+
<argument name="product" value="$simpleProduct$"/>
70+
<argument name="productQty" value="1"/>
71+
</actionGroup>
72+
<!-- Check that error remains -->
73+
<actionGroup ref="AssertAdminItemOrderedErrorActionGroup" stepKey="assertProductErrorRemains">
74+
<argument name="productName" value="$simpleProduct.name$"/>
75+
<argument name="messageType" value="notice"/>
76+
</actionGroup>
77+
</test>
78+
</tests>

0 commit comments

Comments
 (0)