Skip to content

Commit 0bbfb66

Browse files
committed
MC-37098: Create automated test for "Check functionality of RabbitMQ"
1 parent edfbc39 commit 0bbfb66

File tree

6 files changed

+118
-0
lines changed

6 files changed

+118
-0
lines changed

app/code/Magento/AdminNotification/Test/Mftf/Section/AdminSystemMessagesSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@
1515
<element name="success" type="text" selector="#system_messages div.message-success"/>
1616
<element name="warning" type="text" selector="#system_messages div.message-warning"/>
1717
<element name="notice" type="text" selector="#system_messages div.message-notice"/>
18+
<element name="info" type="text" selector="#system_messages div.message-info"/>
19+
<element name="viewDetailsLink" type="button" selector="//div[contains(@class, 'message-system-short')]/a[contains(text(), 'View Details')]" timeout="30"/>
1820
</section>
1921
</sections>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminBulkDetailsModalSection">
12+
<element name="descriptionValue" type="text" selector="//aside//div[@data-index='description']//span[@name='description']"/>
13+
<element name="summaryValue" type="text" selector="//aside//div[@data-index='summary']//span[@name='summary']" />
14+
<element name="startTimeValue" type="text" selector="//aside//div[@data-index='start_time']//span[@name='start_time']" />
15+
</section>
16+
</sections>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
<actionGroup name="AdminClickMassUpdateProductAttributesActionGroup">
12+
<annotations>
13+
<description>Clicks on 'Update attributes' on product grid page.</description>
14+
</annotations>
15+
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickDropdown"/>
16+
<click selector="{{AdminProductGridSection.bulkActionOption('Update attributes')}}" stepKey="clickOption"/>
17+
<waitForPageLoad stepKey="waitForBulkUpdatePage"/>
18+
<seeInCurrentUrl url="catalog/product_action_attribute/edit/" stepKey="seeInUrl"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroup name="AdminSaveProductsMassAttributesUpdateActionGroup">
12+
<annotations>
13+
<description>Clicks on 'Save' button on products mass attributes update page.</description>
14+
</annotations>
15+
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
16+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" time="60" stepKey="waitForSuccessMessage"/>
17+
</actionGroup>
18+
</actionGroups>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
<element name="defaultLabel" type="text" selector="//td[contains(text(), '{{attributeName}}')]/following-sibling::td[contains(@class, 'col-frontend_label')]" parameterized="true"/>
2424
<element name="formByStoreId" type="block" selector="//form[contains(@action,'store/{{store_id}}')]" parameterized="true"/>
2525
<element name="tabButton" type="text" selector="#product_attribute_tabs a[title='{{tabName}}']" parameterized="true"/>
26+
<element name="attributeShortDescription" type="text" selector="#short_description"/>
27+
<element name="changeAttributeShortDescriptionToggle" type="checkbox" selector="#toggle_short_description"/>
2628
</section>
2729
</sections>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="AdminMassProductAttributeUpdateAddedToQueueTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Mass update product attributes"/>
15+
<title value="Check functionality of RabbitMQ"/>
16+
<description value="Mass product attribute update task should be added to the queue"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-28990"/>
19+
<useCaseId value="MC-29179"/>
20+
<group value="catalog"/>
21+
<group value="asynchronousOperations"/>
22+
<group value="productAttributes"/>
23+
</annotations>
24+
<before>
25+
<createData entity="ApiProductWithDescription" stepKey="createFirstProduct"/>
26+
<createData entity="ApiProductWithDescription" stepKey="createSecondProduct"/>
27+
<createData entity="ApiProductNameWithNoSpaces" stepKey="createThirdProduct"/>
28+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
29+
</before>
30+
<after>
31+
<deleteData createDataKey="createFirstProduct" stepKey="deleteFirstProduct"/>
32+
<deleteData createDataKey="createSecondProduct" stepKey="deleteSecondProduct"/>
33+
<deleteData createDataKey="createThirdProduct" stepKey="deleteThirdProduct"/>
34+
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
35+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
36+
</after>
37+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
38+
<actionGroup ref="SearchProductGridByKeyword2ActionGroup" stepKey="searchByKeyword">
39+
<argument name="keyword" value="api-simple-product"/>
40+
</actionGroup>
41+
<actionGroup ref="SortProductsByIdDescendingActionGroup" stepKey="sortProductsByIdDescending"/>
42+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('1')}}" stepKey="selectThirdProduct"/>
43+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('2')}}" stepKey="selectSecondProduct"/>
44+
<click selector="{{AdminProductGridSection.productGridCheckboxOnRow('3')}}" stepKey="selectFirstProduct"/>
45+
<actionGroup ref="AdminClickMassUpdateProductAttributesActionGroup" stepKey="goToUpdateProductAttributesPage"/>
46+
<checkOption selector="{{AdminEditProductAttributesSection.changeAttributeShortDescriptionToggle}}" stepKey="toggleToChangeShortDescription"/>
47+
<fillField selector="{{AdminEditProductAttributesSection.attributeShortDescription}}" userInput="Test Update" stepKey="fillShortDescriptionField"/>
48+
<actionGroup ref="AdminSaveProductsMassAttributesUpdateActionGroup" stepKey="saveMassAttributeUpdate"/>
49+
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/>
50+
<see selector="{{AdminSystemMessagesSection.info}}" userInput="Task &quot;Update attributes for 3 selected products&quot;: 1 item(s) have been scheduled for update." stepKey="seeInfoMessage"/>
51+
<click selector="{{AdminSystemMessagesSection.viewDetailsLink}}" stepKey="seeDetails"/>
52+
<see selector="{{AdminBulkDetailsModalSection.descriptionValue}}" userInput="Update attributes for 3 selected products" stepKey="seeDescription"/>
53+
<see selector="{{AdminBulkDetailsModalSection.summaryValue}}" userInput="Pending, in queue..." stepKey="seeSummary"/>
54+
<grabTextFrom selector="{{AdminBulkDetailsModalSection.startTimeValue}}" stepKey="grabStartTimeValue"/>
55+
<assertRegExp stepKey="assertStartTime">
56+
<expectedResult type="string">/\d{1,2}\/\d{2}\/\d{4}\s\d{1,2}:\d{2}:\d{2}\s(AM|PM)/</expectedResult>
57+
<actualResult type="variable">grabStartTimeValue</actualResult>
58+
</assertRegExp>
59+
</test>
60+
</tests>

0 commit comments

Comments
 (0)