Skip to content

Commit af9598e

Browse files
committed
Merge remote-tracking branch 'origin/2.4-develop' into ims-phase1
2 parents 14a749d + 9661597 commit af9598e

18 files changed

+689
-6
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,10 @@
1717
<data key="store_id">0</data>
1818
<var key="sku" entityType="product" entityKey="sku" />
1919
</entity>
20+
21+
<entity name="specialProductPrice3" type="catalogSpecialPrice">
22+
<data key="price">90</data>
23+
<data key="store_id">0</data>
24+
<var key="sku" entityType="product" entityKey="sku" />
25+
</entity>
2026
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,4 +1468,5 @@
14681468
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
14691469
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
14701470
</entity>
1471+
14711472
</entities>

app/code/Magento/Catalog/Test/Mftf/Section/AdminCategoryBasicFieldSection/AdminCategoryBasicFieldSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
<element name="panelFieldControl" type="input" selector="//aside//div[@data-index=&quot;{{arg1}}&quot;]/descendant::*[@name=&quot;{{arg2}}&quot;]" parameterized="true"/>
2424
<element name="productsInCategory" type="input" selector="div[data-index='assign_products']" timeout="30"/>
2525
<element name="scheduleDesignUpdateTab" type="block" selector="div[data-index='schedule_design_update']" timeout="15"/>
26+
<element name="categoryNameRequiredField" type="text" selector="//label[@class='admin__field-error' and contains(text(),'This is a required field.')]" timeout="15"/>
2627
</section>
2728
</sections>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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="AddProductToCartWithMinimumQuantity">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<title value="Add Product to Cart with Decimals Minimum Qty Allowed Set"/>
15+
<description value="User Can Add Product to Cart with Decimals Minimum Qty Allowed Set"/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="MC-26718"/>
18+
<stories value="Add Product to cart with Minimum Quantity Allowed"/>
19+
</annotations>
20+
<before>
21+
<!-- create category -->
22+
<createData entity="_defaultCategory" stepKey="testCategory"/>
23+
<!-- create product -->
24+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
25+
<requiredEntity createDataKey="testCategory"/>
26+
</createData>
27+
</before>
28+
<!-- delete category and product -->
29+
<after>
30+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
31+
<deleteData createDataKey="testCategory" stepKey="deleteSimpleCategory"/>
32+
</after>
33+
34+
<!-- Login to Admin Panel -->
35+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" />
36+
37+
<!-- Open Product Page by ID -->
38+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
39+
<argument name="productId" value="$$createSimpleProduct.id$$"/>
40+
</actionGroup>
41+
42+
<!-- Open Advanced Inventory Section -->
43+
<actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/>
44+
45+
<!-- Set Decimal Quantity as 0.5 -->
46+
<actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig">
47+
<argument name="value" value="Yes"/>
48+
</actionGroup>
49+
50+
<!-- Set Minimum Allowed Quantity as 0.5 -->
51+
<actionGroup ref="AdminSetMinAllowedQtyForProductActionGroup" stepKey="fillMiniAllowedQty">
52+
<argument name="qty" value="0.5"/>
53+
</actionGroup>
54+
55+
<!-- Click on Done Button -->
56+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
57+
58+
<!-- Click on Save Button -->
59+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/>
60+
61+
<!-- Navigate to Category Page on StoreFront -->
62+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
63+
<argument name="category" value="$$testCategory$$"/>
64+
</actionGroup>
65+
66+
<!-- Add Product to Cart from Category Page -->
67+
<actionGroup ref="StorefrontAddProductToCartFromCategoryActionGroup" stepKey="addProductToCart">
68+
<argument name="productName" value="$$createSimpleProduct.name$$"/>
69+
</actionGroup>
70+
71+
<!-- Click on Show Mini Cart Section -->
72+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickOnMiniCart"/>
73+
<waitForPageLoad stepKey="waitForPageToLoad"/>
74+
75+
<!-- Grab Quantity Value from MiniCart-->
76+
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInMinicart"/>
77+
78+
<!-- Assert Quantity value equals 0.5 -->
79+
<assertEquals stepKey="assertquantityValuesAreEqualfromCatalogPage">
80+
<actualResult type="string">$grabProductQtyInMinicart</actualResult>
81+
<expectedResult type="string">0.5</expectedResult>
82+
</assertEquals>
83+
84+
<!-- Navigate to Product Page on StoreFront -->
85+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openStorefrontProductPage">
86+
<argument name="productUrl" value="$$createSimpleProduct.custom_attributes[url_key]$$"/>
87+
</actionGroup>
88+
<!-- Add Product to Cart from Category Page -->
89+
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
90+
91+
<!-- Grab Quantity Value from MiniCart-->
92+
<grabValueFrom selector="{{StorefrontMinicartSection.itemQuantity($$createSimpleProduct.name$$)}}" stepKey="grabProductQtyInShowMinicart"/>
93+
94+
<!-- Assert Quantity value equals 1 -->
95+
<assertEquals stepKey="assertquantityValuesAreEqualfromProductPage">
96+
<actualResult type="string">$grabProductQtyInShowMinicart</actualResult>
97+
<expectedResult type="string">1</expectedResult>
98+
</assertEquals>
99+
100+
101+
</test>
102+
</tests>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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="AdminCreateSubcategoryWithEmptyRequiredFieldsTest">
11+
<annotations>
12+
<features value="Catalog"/>
13+
<stories value="Create Subcategory with empty required fields - NEG"/>
14+
<title value="Create Subcategory with empty required fields - NEG"/>
15+
<description value="Admin Create Subcategory with empty required fields - NEG"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-27471"/>
18+
<group value="Catalog"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22+
</before>
23+
24+
<!-- Goto Categories Select Default Category > Click 'Add Subcategory'-->
25+
<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="amOnAdminCategoryPage"/>
26+
<scrollToTopOfPage stepKey="scrollToTopOfPage1"/>
27+
<waitForPageLoad stepKey="waitForPageLoad1"/>
28+
<click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategory"/>
29+
<checkOption selector="{{AdminCategoryBasicFieldSection.EnableCategory}}" stepKey="enableNewCategory"/>
30+
<click selector="{{AdminCategorySEOSection.SectionHeader}}" stepKey="openSEO"/>
31+
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{Gear.name_lwr}}" stepKey="enterURLKey"/>
32+
33+
<!-- Click on Save -->
34+
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFirstSubCategory"/>
35+
36+
<!-- Validate "This is a required field" for empty required field-->
37+
<waitForElementVisible selector="{{AdminCategoryBasicFieldSection.categoryNameRequiredField}}" stepKey="seeRequiredField"/>
38+
<seeElement selector="{{AdminCategoryBasicFieldSection.categoryNameRequiredField}}" stepKey="seeRequiredField1"/>
39+
40+
<after>
41+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
42+
</after>
43+
44+
</test>
45+
</tests>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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="EnablingManageStockTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Enabling Manage Stock During Product Creation"/>
15+
<title value="Enabling Manage Stock During Product Creation"/>
16+
<description value="Admin can EnableManage Stock During Product Creation"/>
17+
<severity value="AVERAGE"/>
18+
<testCaseId value="MC-27457"/>
19+
</annotations>
20+
<before>
21+
<!-- Set ManageStock to No-->
22+
<magentoCLI command="config:set {{CatalogInventoryManageStockDisable.path}} {{CatalogInventoryManageStockDisable.value}}" stepKey="manageStockdisable"/>
23+
<!-- Login to Admin Panel -->
24+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
25+
</before>
26+
<after>
27+
<!--Logout From Admin Panel -->
28+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/>
29+
</after>
30+
<!-- Navigate to Product Page-->
31+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
32+
<!-- Click on Add Product Button -->
33+
<click selector="#add_new_product-button" stepKey="clickAddProductButton"/>
34+
<!-- Wait for Page Load-->
35+
<waitForPageLoad stepKey="waitForNewProductPageOpened"/>
36+
<!-- Fill Product Name-->
37+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="Sample Product" stepKey="fillProductName" />
38+
<!-- Fill Product Price-->
39+
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="100" stepKey="fillProductPrice" />
40+
<!-- Click on Advanced Inventory Section-->
41+
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="goToAdvancedInventory"/>
42+
<!-- Uncheck Manage Stock Use Config Settings-->
43+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.useConfigSettings}}" stepKey="uncheckQManangeStockConfigCheckbox"/>
44+
<!-- Set Manage Stock to Yes-->
45+
<selectOption selector="{{AdminProductFormAdvancedInventorySection.manageStock}}" userInput="Yes" stepKey="changeManageStocktoYes"/>
46+
<!-- Add Quantity field-->
47+
<fillField selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryQty}}" userInput="10" stepKey="fillAdvancedInventoryQuantity" />
48+
<!-- Uncheck Threshold Use Config Settings-->
49+
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.minQtyConfigSetting}}" stepKey="uncheckThhresholdConfigCheckbox"/>
50+
<!--Fill Threshold Value-->
51+
<fillField selector="{{AdminProductFormAdvancedInventorySection.outOfStockThreshold}}" userInput="10" stepKey="fillAdvancedInventoryThresholdValue" />
52+
<!-- Save Advanced Inventory Section-->
53+
<actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/>
54+
<!-- Save Product Page-->
55+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductAfterDisableManageStock"/>
56+
</test>
57+
</tests>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
9+
<test name="SpecialPriceCheckOnWishListPageTest">
10+
<annotations>
11+
<features value="Checkout"/>
12+
<stories value="Check verify Special Price is the same as on the catalog page"/>
13+
<title value="'Special Price on Catalog' is shown correctly"/>
14+
<description value="Add Product to Wishlist and verify Special Price is the same as on the catalog page"/>
15+
<testCaseId value="MC-26860"/>
16+
<severity value="AVERAGE"/>
17+
<group value="Catalog"/>
18+
</annotations>
19+
<before>
20+
<!-- Create first simple product-->
21+
22+
<createData entity="ApiSimplePrice100Qty100" stepKey="createFirstSimpleProduct"/>
23+
24+
<!-- Create category -->
25+
<createData entity="_defaultCategory" stepKey="createCategory"/>
26+
<createData entity="AssignProductToCategory" stepKey="assignTestCategoryToTestProduct">
27+
<requiredEntity createDataKey="createCategory"/>
28+
<requiredEntity createDataKey="createFirstSimpleProduct"/>
29+
</createData>
30+
31+
<!-- Create Customer -->
32+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
33+
</before>
34+
<!-- Delete Data -->
35+
<after>
36+
<deleteData createDataKey="createFirstSimpleProduct" stepKey="deleteSimpleProduct"/>
37+
<deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/>
38+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
39+
</after>
40+
<!-- Login into Admin Panel-->
41+
<actionGroup ref="AdminLoginActionGroup" stepKey="adminLogin"/>
42+
43+
<!-- Open Product Page-->
44+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductPagebyID">
45+
<argument name="productId" value="$createFirstSimpleProduct.id$"/>
46+
</actionGroup>
47+
48+
<!-- Open Advanced Pricing and add Special Price to Product-->
49+
<actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceForFirstProduct">
50+
<argument name="price" value="{{specialProductPrice3.price}}"/>
51+
</actionGroup>
52+
53+
<!-- Save Product Page-->
54+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/>
55+
56+
<!-- Login to StoreFront-->
57+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="storefrontCustomerLogin">
58+
<argument name="Customer" value="$$createCustomer$$"/>
59+
</actionGroup>
60+
61+
<!-- Navigates to category page -->
62+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
63+
<argument name="category" value="$$createCategory$$"/>
64+
</actionGroup>
65+
66+
<!-- Grab Value of Product Price from Category Page-->
67+
<grabTextFrom selector=" {{StorefrontCategoryMainSection.productPrice}}" stepKey="grabProductPrice"/>
68+
69+
<!-- Open Product Page -->
70+
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProductPage">
71+
<argument name="product" value="$$createFirstSimpleProduct$$"/>
72+
</actionGroup>
73+
74+
<!-- Grab Value of Special Price from Product Page-->
75+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="waitForProductSpecialPrice"/>
76+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.specialPriceValue}}" stepKey="grabSpecialPricefromProductPage"/>
77+
78+
<!-- Add Product To WishList from Product Page-->
79+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="wishlist">
80+
<argument name="productVar" value="$$createFirstSimpleProduct$$"/>
81+
</actionGroup>
82+
83+
<!-- Grab Value of Special Price from WishList Page-->
84+
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productSpecialPrice}}" stepKey="grabspecialPriceFromWishListPage"/>
85+
86+
<!-- Check Special Price on the Catalog Page is same as Special Price on WishList Page-->
87+
<assertEquals stepKey="assertProductPriceValuesAreEqual">
88+
<actualResult type="const">$grabSpecialPricefromProductPage</actualResult>
89+
<expectedResult type="string">$grabspecialPriceFromWishListPage</expectedResult>
90+
</assertEquals>
91+
92+
</test>
93+
</tests>

app/code/Magento/CatalogInventory/Test/Mftf/Data/CatalogInventoryConfigData.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,14 @@
4343
<data key="path">cataloginventory/item_options/auto_return</data>
4444
<data key="value">0</data>
4545
</entity>
46+
<entity name="CatalogInventoryManageStockEnable">
47+
<!-- Magento default value -->
48+
<data key="path">cataloginventory/item_options/manage_stock</data>
49+
<data key="value">1</data>
50+
</entity>
51+
<entity name="CatalogInventoryManageStockDisable">
52+
<!-- Magento default value -->
53+
<data key="path">cataloginventory/item_options/manage_stock</data>
54+
<data key="value">0</data>
55+
</entity>
4656
</entities>

0 commit comments

Comments
 (0)