Skip to content

Commit a24105d

Browse files
authored
Merge pull request #2584 from magento-pangolin/RE-develop
[pangolin] RE-develop Functional Tests
2 parents 39ff541 + edfa353 commit a24105d

26 files changed

+1209
-157
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminAddDefaultImageBundleProductTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="Admin should be able to add default images for a Bundle Product"/>
16+
<description value="Admin should be able to add default images for a Bundle Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-115"/>
19+
<group value="Bundle"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
24+
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
25+
</before>
26+
<after>
27+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
28+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
29+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
30+
</after>
31+
32+
<!-- Create a bundle product -->
33+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/>
34+
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/>
35+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct">
36+
<argument name="product" value="BundleProduct"/>
37+
</actionGroup>
38+
39+
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku">
40+
<argument name="product" value="BundleProduct"/>
41+
</actionGroup>
42+
43+
<!-- Add two bundle items -->
44+
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/>
45+
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/>
46+
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/>
47+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/>
48+
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/>
49+
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/>
50+
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/>
51+
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/>
52+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions">
53+
<argument name="product" value="$$simpleProduct1$$"/>
54+
</actionGroup>
55+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
56+
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
57+
<argument name="product" value="$$simpleProduct2$$"/>
58+
</actionGroup>
59+
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
60+
<click selector="{{AdminAddProductsToOptionPanel.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/>
61+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/>
62+
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/>
63+
64+
<!-- Add image to product -->
65+
<actionGroup ref="addProductImage" stepKey="addImageForProduct">
66+
<argument name="image" value="MagentoLogo"/>
67+
</actionGroup>
68+
69+
<!--Save product-->
70+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
71+
72+
<!-- Assert product image in admin product form -->
73+
<actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/>
74+
75+
<!-- Assert product in storefront product page -->
76+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
77+
<argument name="product" value="BundleProduct"/>
78+
</actionGroup>
79+
80+
<!-- Assert product image in storefront product page -->
81+
<actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage">
82+
<argument name="product" value="BundleProduct"/>
83+
<argument name="image" value="MagentoLogo"/>
84+
</actionGroup>
85+
</test>
86+
</tests>
Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11-
<test name="AdminAddRemoveProductImageBundleProductTest">
11+
<test name="AdminRemoveDefaultImageBundleProductTest">
1212
<annotations>
1313
<features value="Bundle"/>
14-
<stories value="Bundle Product Add/Remove Images"/>
15-
<title value="Admin should be able to add/remove images for a Bundle Product"/>
16-
<description value="Admin should be able to add/remove images for a Bundle Product"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="Admin should be able to remove default images from a Bundle Product"/>
16+
<description value="Admin should be able to remove default images from a Bundle Product"/>
1717
<severity value="MAJOR"/>
18-
<testCaseId value="MC-115"/>
18+
<testCaseId value="MC-200"/>
1919
<group value="Bundle"/>
2020
</annotations>
2121
<before>
@@ -69,27 +69,7 @@
6969
<!--Save product-->
7070
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
7171

72-
<!-- Assert product image in admin product form -->
73-
<actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/>
74-
75-
<!-- Assert product in storefront product page -->
76-
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
77-
<argument name="product" value="BundleProduct"/>
78-
</actionGroup>
79-
80-
<!-- Assert product image in storefront product page -->
81-
<actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage">
82-
<argument name="product" value="BundleProduct"/>
83-
<argument name="image" value="MagentoLogo"/>
84-
</actionGroup>
85-
8672
<!-- Remove image from product -->
87-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageRemove"/>
88-
<waitForPageLoad stepKey="waitForProductIndexPageLoad2"/>
89-
<actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku">
90-
<argument name="product" value="BundleProduct"/>
91-
</actionGroup>
92-
<actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/>
9373
<actionGroup ref="removeProductImage" stepKey="removeProductImage"/>
9474

9575
<!-- Skip success message check when saving product because of bug MAGETWO-91177 -->

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,18 @@
253253
<requiredEntity type="product_option">ProductOptionDateTime</requiredEntity>
254254
<requiredEntity type="product_option">ProductOptionTime</requiredEntity>
255255
</entity>
256+
<entity name="ApiVirtualProductWithDescription" type="product">
257+
<data key="sku" unique="suffix">api-virtual-product</data>
258+
<data key="type_id">virtual</data>
259+
<data key="attribute_set_id">4</data>
260+
<data key="visibility">4</data>
261+
<data key="name" unique="suffix">Api Virtual Product</data>
262+
<data key="price">123.00</data>
263+
<data key="urlKey" unique="suffix">api-virtual-product</data>
264+
<data key="status">1</data>
265+
<data key="quantity">100</data>
266+
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
267+
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
268+
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
269+
</entity>
256270
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="stock" type="input" selector=".stock.available"/>
1313
<element name="productName" type="text" selector=".base"/>
1414
<element name="productSku" type="text" selector=".product.attribute.sku>.value"/>
15+
<element name="productPriceLabel" type="text" selector=".price-label"/>
1516
<element name="productPrice" type="text" selector="div.price-box.price-final_price"/>
1617
<element name="specialPrice" type="text" selector=".special-price"/>
1718
<element name="oldPrice" type="text" selector=".old-price"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminAddDefaultImageSimpleProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="Admin should be able to add default image for a Simple Product"/>
16+
<description value="Admin should be able to add default images for a Simple Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-113"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
26+
</after>
27+
28+
<!--Create product-->
29+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
30+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
31+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/>
32+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct">
33+
<argument name="product" value="SimpleProduct3"/>
34+
</actionGroup>
35+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain">
36+
<argument name="product" value="SimpleProduct3"/>
37+
</actionGroup>
38+
39+
<!-- Add image to product -->
40+
<actionGroup ref="addProductImage" stepKey="addImageForProductSimple">
41+
<argument name="image" value="MagentoLogo"/>
42+
</actionGroup>
43+
<actionGroup ref="saveProductForm" stepKey="saveSimpleProduct"/>
44+
45+
<!-- Assert product image in admin product form -->
46+
<actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/>
47+
48+
<!-- Assert product in storefront product page -->
49+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
50+
<argument name="product" value="SimpleProduct3"/>
51+
</actionGroup>
52+
53+
<!-- Assert product image in storefront product page -->
54+
<actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage">
55+
<argument name="product" value="SimpleProduct3"/>
56+
<argument name="image" value="MagentoLogo"/>
57+
</actionGroup>
58+
</test>
59+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="AdminAddRemoveProductImageVirtualProductTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Add/remove images and videos for all product types and category"/>
15+
<title value="Admin should be able to add default images for a Virtual Product"/>
16+
<description value="Admin should be able to add default images for a Virtual Product"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-103"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
26+
</after>
27+
28+
<!--Create product-->
29+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
30+
<waitForPageLoad stepKey="waitForProductIndexPage"/>
31+
<actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/>
32+
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateProduct">
33+
<argument name="product" value="defaultVirtualProduct"/>
34+
</actionGroup>
35+
<actionGroup ref="fillMainProductFormNoWeight" stepKey="fillProductMain">
36+
<argument name="product" value="defaultVirtualProduct"/>
37+
</actionGroup>
38+
39+
<!-- Add image to product -->
40+
<actionGroup ref="addProductImage" stepKey="addImageForProduct">
41+
<argument name="image" value="MagentoLogo"/>
42+
</actionGroup>
43+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
44+
45+
<!-- Assert product image in admin product form -->
46+
<actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/>
47+
48+
<!-- Assert product in storefront product page -->
49+
<actionGroup ref="AssertProductInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
50+
<argument name="product" value="defaultVirtualProduct"/>
51+
</actionGroup>
52+
53+
<!-- Assert product image in storefront product page -->
54+
<actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage">
55+
<argument name="product" value="defaultVirtualProduct"/>
56+
<argument name="image" value="MagentoLogo"/>
57+
</actionGroup>
58+
</test>
59+
</tests>

0 commit comments

Comments
 (0)