Skip to content

Commit 08ccf75

Browse files
authored
Merge pull request #2509 from magento-pangolin/RE-develop
[pangolin] RE-develop functional tests
2 parents 4832a75 + 8216ad4 commit 08ccf75

File tree

60 files changed

+2490
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2490
-149
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
11+
<page name="AdminLogoutPage" url="admin/auth/logout/" area="admin" module="Magento_Backend">
12+
<section name="removeAfterMqe-896"/>
13+
</page>
14+
</pages>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="AdminMainActionsSection">
12+
</section>
13+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<data key="optionInputType1">checkbox</data>
1818
<data key="defaultQuantity">10</data>
1919
<data key="status">1</data>
20+
<data key="urlKey" unique="suffix">bundleproduct</data>
2021
</entity>
2122
</entities>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Bundle/Section/AdminProductFormBundleSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductFormBundleSection">
12+
<element name="bundleItemsToggle" type="button" selector="//span[text()='Bundle Items']"/>
1213
<element name="shipmentType" type="select" selector=".admin__control-select[name='product[shipment_type]']"/>
1314
<element name="addOption" type="button" selector="button[data-index='add_button']"/>
1415
<element name="firstOptionTitle" type="input" selector="[name='bundle_options[bundle_options][0][title]']"/>
1516
<element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/>
1617
<element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/>
1718
<element name="firstProductQuantity" type="input" selector="[name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']"/>
19+
<element name="bundleOptionXTitle" type="input" selector="[name='bundle_options[bundle_options][{{x}}][title]']" parameterized="true"/>
20+
<element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/>
21+
<element name="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
22+
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
1823
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
1924
</section>
2025
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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="AdminAddRemoveProductImageBundleProductTest">
12+
<annotations>
13+
<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"/>
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+
86+
<!-- 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"/>
93+
<actionGroup ref="removeProductImage" stepKey="removeProductImage"/>
94+
95+
<!-- Skip success message check when saving product because of bug MAGETWO-91177 -->
96+
<!-- actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/-->
97+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductFormAfterRemove"/>
98+
99+
<!-- Assert product image not in admin product form -->
100+
<actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/>
101+
102+
<!-- Assert product in storefront product page -->
103+
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove">
104+
<argument name="product" value="BundleProduct"/>
105+
</actionGroup>
106+
<!-- Assert product image not in storefront product page -->
107+
<actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage">
108+
<argument name="product" value="BundleProduct"/>
109+
</actionGroup>
110+
</test>
111+
</tests>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/AdminProductActionGroup.xml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,41 @@
2525
<arguments>
2626
<argument name="product" defaultValue="_defaultProduct"/>
2727
</arguments>
28-
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/>
29-
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/>
28+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
29+
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
3030
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
3131
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
3232
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
33+
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/>
3334
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/>
3435
</actionGroup>
3536

37+
<!--Fill main fields in create product form with no weight, useful for virtual and downloadable products -->
38+
<actionGroup name="fillMainProductFormNoWeight">
39+
<arguments>
40+
<argument name="product" defaultValue="DownloadableProduct"/>
41+
</arguments>
42+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
43+
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
44+
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
45+
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
46+
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
47+
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/>
48+
</actionGroup>
49+
50+
<!--Fill main fields in create product form with name and sku -->
51+
<actionGroup name="fillProductNameAndSkuInProductForm">
52+
<arguments>
53+
<argument name="product"/>
54+
</arguments>
55+
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
56+
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
57+
</actionGroup>
58+
3659
<!--Check that required fields are actually required-->
3760
<actionGroup name="checkRequiredFieldsInProductForm">
38-
<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/>
39-
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/>
61+
<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/>
62+
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/>
4063
<clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/>
4164
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
4265
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/>
@@ -64,6 +87,33 @@
6487
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
6588
</actionGroup>
6689

90+
<!--Remove image for product-->
91+
<actionGroup name="removeProductImage">
92+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
93+
<waitForPageLoad time="30" stepKey="waitForPageRefresh"/>
94+
<click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/>
95+
</actionGroup>
96+
97+
<!-- Assert product image in Admin Product page -->
98+
<actionGroup name="assertProductImageAdminProductPage">
99+
<arguments>
100+
<argument name="image" defaultValue="MagentoLogo"/>
101+
</arguments>
102+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
103+
<waitForPageLoad stepKey="waitForPageLoad"/>
104+
<seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/>
105+
</actionGroup>
106+
107+
<!-- Assert no product image in Admin Product page -->
108+
<actionGroup name="assertProductImageNotInAdminProductPage">
109+
<arguments>
110+
<argument name="image" defaultValue="MagentoLogo"/>
111+
</arguments>
112+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
113+
<waitForPageLoad stepKey="waitForPageLoad"/>
114+
<dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/>
115+
</actionGroup>
116+
67117
<!--Fill fields for simple product in a category in Admin-->
68118
<actionGroup name="FillAdminSimpleProductForm">
69119
<arguments>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/AdminProductGridActionGroup.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
3030
</actionGroup>
3131

32+
<!--Filter the product grid by the SKU string -->
33+
<actionGroup name="filterProductGridBySku2">
34+
<arguments>
35+
<argument name="sku" type="string"/>
36+
</arguments>
37+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
38+
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
39+
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
40+
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
41+
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
42+
</actionGroup>
43+
3244
<!--Filter the product grid by the Name field-->
3345
<actionGroup name="filterProductGridByName">
3446
<arguments>
@@ -82,6 +94,17 @@
8294
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/>
8395
</actionGroup>
8496

97+
<!--Search product grid with keyword search-->
98+
<!-- Argument type: string (see more in MQE-965) -->
99+
<actionGroup name="searchProductGridByKeyword2">
100+
<arguments>
101+
<argument name="keyword" type="string"/>
102+
</arguments>
103+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
104+
<fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/>
105+
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/>
106+
</actionGroup>
107+
85108
<!--Filter product grid by name, sku, and type; and see expected product-->
86109
<actionGroup name="viewProductInAdminGrid">
87110
<arguments>
@@ -121,4 +144,24 @@
121144
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
122145
</actionGroup>
123146

147+
<!--Open product for edit by clicking row X and column Y in product grid-->
148+
<actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid">
149+
<arguments>
150+
<argument name="X" type="string" defaultValue="1"/>
151+
<argument name="Y" type="string" defaultValue="2"/>
152+
</arguments>
153+
<click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/>
154+
</actionGroup>
155+
156+
<!-- Sort products by ID descending -->
157+
<actionGroup name="sortProductsByIdDescending">
158+
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/>
159+
<waitForPageLoad stepKey="waitForPageLoad"/>
160+
</actionGroup>
161+
162+
<!-- Sort products by ID ascending -->
163+
<actionGroup name="sortProductsByIdAscending">
164+
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/>
165+
<waitForPageLoad stepKey="waitForPageLoad"/>
166+
</actionGroup>
124167
</actionGroups>

0 commit comments

Comments
 (0)