Skip to content

Commit 3bcc244

Browse files
author
Stas Puga
committed
Merge remote-tracking branch 'origin/MC-219' into 2.3-develop-mftf-pr20
2 parents 3708732 + 55feda6 commit 3bcc244

File tree

5 files changed

+138
-0
lines changed

5 files changed

+138
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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="AdminShouldBeAbleToMassUpdateAttributesForBundleProductsTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Admin list bundle products"/>
15+
<title value="Admin should be able to mass update attributes for bundle products"/>
16+
<description value="Admin should be able to mass update attributes for bundle products"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-219"/>
19+
<group value="bundle"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!-- Create Simple Product -->
24+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
25+
<!-- Create Fixed Bundle Product -->
26+
<createData entity="ApiFixedBundleProduct" stepKey="createFixedBundleProduct"/>
27+
<!-- Create DropDown Bundle Option -->
28+
<createData entity="DropDownBundleOption" stepKey="createBundleOption">
29+
<requiredEntity createDataKey="createFixedBundleProduct"/>
30+
</createData>
31+
<!-- Link Simple Product -->
32+
<createData entity="ApiBundleLink" stepKey="createNewBundleLink">
33+
<requiredEntity createDataKey="createFixedBundleProduct"/>
34+
<requiredEntity createDataKey="createBundleOption"/>
35+
<requiredEntity createDataKey="createSimpleProduct"/>
36+
</createData>
37+
</before>
38+
<after>
39+
<!-- Delete Simple Product -->
40+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
41+
<!-- Delete Fixed Bundle Product -->
42+
<deleteData createDataKey="createFixedBundleProduct" stepKey="deleteBundleProduct"/>
43+
<!-- Clear Filter -->
44+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
45+
<!--Log Out Admin-->
46+
<actionGroup ref="logout" stepKey="logoutAsAdmin"/>
47+
</after>
48+
<!-- Login as Admin -->
49+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
50+
<!-- Go to Catalog -> Catalog -> Products and Search created product in precondition and choose it -->
51+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct">
52+
<argument name="product" value="$$createFixedBundleProduct$$"/>
53+
</actionGroup>
54+
<!-- Choose "Update attributes" and Change any product data -->
55+
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
56+
<argument name="product" value="UpdateAttributeNameAndDescription"/>
57+
</actionGroup>
58+
<!--Run cron twice-->
59+
<magentoCLI command="cron:run" stepKey="cronRun"/>
60+
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
61+
<!-- Search for a product with a new name and Open Product -->
62+
<actionGroup ref="filterProductGridByName" stepKey="searchWithNewProductName">
63+
<argument name="product" value="UpdateAttributeNameAndDescription"/>
64+
</actionGroup>
65+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openProductPage">
66+
<argument name="product" value="$$createFixedBundleProduct$$"/>
67+
</actionGroup>
68+
<!-- Assert product name and description -->
69+
<actionGroup ref="AssertProductNameInProductEditForm" stepKey="assertProductName">
70+
<argument name="productName" value="{{UpdateAttributeNameAndDescription.name}}"/>
71+
</actionGroup>
72+
<actionGroup ref="AssertProductDescriptionInProductEditForm" stepKey="assertProductDescription">
73+
<argument name="productDescription" value="{{UpdateAttributeNameAndDescription.description}}"/>
74+
</actionGroup>
75+
</test>
76+
</tests>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,21 @@
542542
<remove keyForRemoval="seeCheckboxForWebsite"/>
543543
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
544544
</actionGroup>
545+
<!-- You are on product Edit Page -->
546+
<!-- Assert Product Name in admin Product page -->
547+
<actionGroup name="AssertProductNameInProductEditForm">
548+
<arguments>
549+
<argument name="productName" type="string"/>
550+
</arguments>
551+
<seeInField selector="{{AdminProductFormSection.productName}}" userInput="{{productName}}" stepKey="seeProductNameOnEditProductPage"/>
552+
</actionGroup>
553+
<!-- You are on product Edit Page -->
554+
<!-- Assert Product Description in admin Product page -->
555+
<actionGroup name="AssertProductDescriptionInProductEditForm">
556+
<arguments>
557+
<argument name="productDescription" type="string"/>
558+
</arguments>
559+
<conditionalClick selector="{{AdminProductContentSection.sectionHeader}}" dependentSelector="{{AdminProductContentSection.sectionHeaderShow}}" visible="false" stepKey="expandContentSection"/>
560+
<seeInField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="{{productDescription}}" stepKey="seeProductDescription"/>
561+
</actionGroup>
545562
</actionGroups>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Update Product Name and Description attribute -->
12+
<actionGroup name="AdminUpdateProductNameAndDescriptionAttributes">
13+
<arguments>
14+
<argument name="product"/>
15+
</arguments>
16+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="clickCheckbox"/>
17+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
18+
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
19+
<waitForPageLoad stepKey="waitForUploadPage"/>
20+
<seeInCurrentUrl url="{{ProductAttributesEditPage.url}}" stepKey="seeAttributePageEditUrl"/>
21+
<click selector="{{AdminUpdateAttributesSection.toggleName}}" stepKey="clickToChangeName"/>
22+
<fillField selector="{{AdminUpdateAttributesSection.name}}" userInput="{{product.name}}" stepKey="fillFieldName"/>
23+
<click selector="{{AdminUpdateAttributesSection.toggleDescription}}" stepKey="clickToChangeDescription"/>
24+
<fillField selector="{{AdminUpdateAttributesSection.description}}" userInput="{{product.description}}" stepKey="fillFieldDescription"/>
25+
<click selector="{{AdminUpdateAttributesSection.saveButton}}" stepKey="save"/>
26+
<waitForElementVisible selector="{{AdminMessagesSection.successMessage}}" stepKey="waitVisibleSuccessMessage"/>
27+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeSuccessMessage"/>
28+
</actionGroup>
29+
</actionGroups>
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+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="UpdateAttributeNameAndDescription" type="productAttributeMassUpdate">
12+
<data key="name" unique="suffix">New Bundle Product Name</data>
13+
<data key="description" unique="suffix">This is the description</data>
14+
</entity>
15+
</entities>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<element name="toggleWeight" type="checkbox" selector="#toggle_weight"/>
3737
<element name="toggleColor" type="checkbox" selector="#toggle_color"/>
3838

39+
<element name="name" type="input" selector="#name"/>
3940
<element name="description" type="input" selector="#description"/>
4041
</section>
4142
<section name="AdminUpdateAttributesWebsiteSection">

0 commit comments

Comments
 (0)