Skip to content

Commit f6a7028

Browse files
committed
Merge branch 'mtf-eol' of github.com:magento-pangolin/magento2ce into MC-4765
2 parents f9828d0 + bfccd1b commit f6a7028

9 files changed

+194
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddProductToCartActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<argument name="product" defaultValue="product"/>
1313
</arguments>
1414
<amOnPage url="{{StorefrontProductPage.url(product.custom_attributes[url_key])}}" stepKey="goToProductPage"/>
15+
<waitForPageLoad stepKey="waitForProductPage"/>
1516
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/>
1617
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdding}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdding"/>
1718
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartButtonTitleIsAdded}}" stepKey="waitForElementNotVisibleAddToCartButtonTitleIsAdded"/>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CatalogInventoryOptionsShowOutOfStockEnable">
12+
<data key="path">cataloginventory/options/show_out_of_stock</data>
13+
<data key="label">Yes</data>
14+
<data key="value">1</data>
15+
</entity>
16+
<entity name="CatalogInventoryOptionsShowOutOfStockDisable">
17+
<!-- Magento default value -->
18+
<data key="path">cataloginventory/options/show_out_of_stock</data>
19+
<data key="label">No</data>
20+
<data key="value">0</data>
21+
</entity>
22+
<entity name="CatalogInventoryItemOptionsBackordersEnable">
23+
<data key="path">cataloginventory/item_options/backorders</data>
24+
<data key="label">Yes</data>
25+
<data key="value">1</data>
26+
</entity>
27+
<entity name="CatalogInventoryItemOptionsBackordersDisable">
28+
<!-- Magento default value -->
29+
<data key="path">cataloginventory/item_options/backorders</data>
30+
<data key="label">No</data>
31+
<data key="value">0</data>
32+
</entity>
33+
</entities>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@
153153
<data key="status">1</data>
154154
<data key="quantity">0</data>
155155
</entity>
156+
<entity name="SimpleProductInStockQuantityZero" type="product">
157+
<data key="sku" unique="suffix">testSku</data>
158+
<data key="type_id">simple</data>
159+
<data key="attribute_set_id">4</data>
160+
<data key="visibility">4</data>
161+
<data key="name" unique="suffix">SimpleProductInStockQuantityZero</data>
162+
<data key="price">123.00</data>
163+
<data key="urlKey" unique="suffix">SimpleProductInStockQuantityZero</data>
164+
<data key="status">1</data>
165+
<data key="quantity">0</data>
166+
<requiredEntity type="product_extension_attribute">EavStock0</requiredEntity>
167+
</entity>
156168
<!-- Simple Product Disabled -->
157169
<entity name="SimpleProductOffline" type="product2">
158170
<data key="sku" unique="suffix">testSku</data>

app/code/Magento/Catalog/Test/Mftf/Data/ProductExtensionAttributeData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
<entity name="EavStock1" type="product_extension_attribute">
2121
<requiredEntity type="stock_item">Qty_1</requiredEntity>
2222
</entity>
23+
<entity name="EavStock0" type="product_extension_attribute">
24+
<requiredEntity type="stock_item">Qty_0</requiredEntity>
25+
</entity>
2326
<entity name="EavStock777" type="product_extension_attribute">
2427
<requiredEntity type="stock_item">Qty_777</requiredEntity>
2528
</entity>

app/code/Magento/Catalog/Test/Mftf/Data/StockItemData.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
<data key="qty">1</data>
3333
<data key="is_in_stock">true</data>
3434
</entity>
35+
<entity name="Qty_0" type="stock_item">
36+
<data key="qty">0</data>
37+
<data key="is_in_stock">true</data>
38+
</entity>
3539
<entity name="Qty_777" type="stock_item">
3640
<data key="qty">777</data>
3741
<data key="is_in_stock">true</data>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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="AdminBackorderAllowedAddProductToCartTest">
12+
<annotations>
13+
<stories value="Manage products"/>
14+
<title value="Add Product to Cart, Backorder Allowed"/>
15+
<description value="Customer should be able to add products to cart when that products quantity is zero"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-11063"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Create a product that is "In Stock" but has quantity zero -->
23+
<createData entity="SimpleProductInStockQuantityZero" stepKey="createProduct"/>
24+
25+
<!-- Configure Magento to show out of stock products and to allow backorders -->
26+
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockEnable.path}} {{CatalogInventoryOptionsShowOutOfStockEnable.value}}" stepKey="setConfigShowOutOfStockTrue"/>
27+
<magentoCLI command="config:set {{CatalogInventoryItemOptionsBackordersEnable.path}} {{CatalogInventoryItemOptionsBackordersEnable.value}}" stepKey="setConfigAllowBackordersTrue"/>
28+
</before>
29+
30+
<after>
31+
<!-- Set Magento back to default configuration -->
32+
<magentoCLI command="config:set {{CatalogInventoryOptionsShowOutOfStockDisable.path}} {{CatalogInventoryOptionsShowOutOfStockDisable.value}}" stepKey="setConfigShowOutOfStockFalse"/>
33+
<magentoCLI command="config:set {{CatalogInventoryItemOptionsBackordersDisable.path}} {{CatalogInventoryItemOptionsBackordersDisable.value}}" stepKey="setConfigAllowBackordersFalse"/>
34+
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
35+
</after>
36+
37+
<!-- Go to the storefront and add the product to the cart -->
38+
<actionGroup ref="AddSimpleProductToCart" stepKey="gotoAndAddProductToCart">
39+
<argument name="product" value="$$createProduct$$"/>
40+
</actionGroup>
41+
42+
<!-- Go to the cart page and verify we see the product -->
43+
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="gotoCart"/>
44+
<waitForPageLoad stepKey="waitForCartLoad"/>
45+
<actionGroup ref="AssertStorefrontCheckoutCartItemsActionGroup" stepKey="assertProductItemInCheckOutCart">
46+
<argument name="productName" value="$$createProduct.name$$"/>
47+
<argument name="productSku" value="$$createProduct.sku$$"/>
48+
<argument name="productPrice" value="$$createProduct.price$$"/>
49+
<argument name="subtotal" value="$$createProduct.price$$" />
50+
<argument name="qty" value="1"/>
51+
</actionGroup>
52+
</test>
53+
</tests>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
10+
<section name="AdminAssignOrderStatusToStateSection">
11+
<element name="orderStatus" type="select" selector="#container [name=status]"/>
12+
<element name="orderState" type="select" selector="#container [name=state]"/>
13+
<element name="saveStatusAssignment" type="button" selector="#save" timeout="30"/>
14+
</section>
15+
</sections>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
<element name="statusCodeFilterField" type="input" selector="[data-role=filter-form] [name=status]"/>
1313
<element name="statusCodeDataColumn" type="input" selector="[data-role=row] [data-column=status]"/>
1414
<element name="statusLabelDataColumn" type="input" selector="[data-role=row] [data-column=label]"/>
15+
<element name="stateCodeAndTitleDataColumn" type="input" selector="[data-role=row] [data-column=state]"/>
16+
<element name="assignStatusToStateButton" type="button" selector="#assign" timeout="30"/>
17+
<element name="unassign" type="text" selector="[data-role=row] [data-column=unassign]"/>
1518
</section>
1619
</sections>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminUnassignCustomOrderStatusTest">
11+
<annotations>
12+
<stories value="UnassignCustomOrderStatus"/>
13+
<title value="Admin Unassign Custom Order Status Test"/>
14+
<description value="Test log in to Sales and Unassign Custom Order Status Test"/>
15+
<testCaseId value="MC-16060"/>
16+
<severity value="CRITICAL"/>
17+
<group value="Sales"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<actionGroup ref="logout" stepKey="logout"/>
25+
</after>
26+
27+
<!--Go to new order status page-->
28+
<amOnPage url="{{AdminOrderStatusPage.url}}" stepKey="goToOrderStatusPage"/>
29+
<click selector="{{AdminMainActionsSection.add}}" stepKey="clickCreateNewStatus"/>
30+
31+
<!--Fill the form and validate save success message-->
32+
<actionGroup ref="AdminOrderStatusFormFillAndSave" stepKey="fillFormAndClickSave">
33+
<argument name="status" value="{{defaultOrderStatus.status}}"/>
34+
<argument name="label" value="{{defaultOrderStatus.label}}"/>
35+
</actionGroup>
36+
<actionGroup ref="AssertOrderStatusFormSaveSuccess" stepKey="seeFormSaveSuccess"/>
37+
38+
<!--Open the created order status in grid page and change the order state to Pending and verify save message-->
39+
<actionGroup ref="AssertOrderStatusExistsInGrid" stepKey="searchCreatedOrderStatus">
40+
<argument name="status" value="{{defaultOrderStatus.status}}"/>
41+
<argument name="label" value="{{defaultOrderStatus.label}}"/>
42+
</actionGroup>
43+
<click selector="{{AdminOrderStatusGridSection.assignStatusToStateButton}}" stepKey="clickAssignStatusToStateButton"/>
44+
<waitForPageLoad stepKey="waitForAssignOrderStatusToStateLoad"/>
45+
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderStatus}}" userInput="{{defaultOrderStatus.label}}" stepKey="selectOrderStatus"/>
46+
<waitForPageLoad stepKey="waitForOrderStatusLoad"/>
47+
<selectOption selector="{{AdminAssignOrderStatusToStateSection.orderState}}" userInput="Pending" stepKey="selectPendingInOrderState"/>
48+
<click selector="{{AdminAssignOrderStatusToStateSection.saveStatusAssignment}}" stepKey="clickSaveStatusAssignmentButton"/>
49+
50+
<!--Verify the order status grid page shows the updated order status-->
51+
<actionGroup ref="AssertOrderStatusExistsInGrid" stepKey="searchUpdatedOrderStatus">
52+
<argument name="status" value="{{defaultOrderStatus.status}}"/>
53+
<argument name="label" value="{{defaultOrderStatus.label}}"/>
54+
</actionGroup>
55+
56+
<!--Click unassign and verify AssertOrderStatusSuccessUnassignMessage-->
57+
<click selector="{{AdminOrderStatusGridSection.unassign}}" stepKey="clickUnassign"/>
58+
<see selector="{{AdminMessagesSection.success}}" userInput="You have unassigned the order status." stepKey="seeAssertOrderStatusSuccessUnassignMessage"/>
59+
60+
<!--Verify the order status grid page shows the updated order status and verify AssertOrderStatusInGrid-->
61+
<actionGroup ref="AssertOrderStatusExistsInGrid" stepKey="seeAssertOrderStatusInGrid">
62+
<argument name="status" value="{{defaultOrderStatus.status}}"/>
63+
<argument name="label" value="{{defaultOrderStatus.label}}"/>
64+
</actionGroup>
65+
66+
<!--Verify the order status grid page shows the updated order status and verify AssertOrderStatusNotAssigned-->
67+
<dontSee selector="{{AdminOrderStatusGridSection.stateCodeAndTitleDataColumn}}" stepKey="seeEmptyStateCodeAndTitleValue"/>
68+
<dontSee selector="{{AdminOrderStatusGridSection.unassign}}" stepKey="seeAssertOrderStatusNotAssigned"/>
69+
</test>
70+
</tests>

0 commit comments

Comments
 (0)