Skip to content

Commit 07b2081

Browse files
committed
B2B-1640: Add MFTF test for MC-38222
- Adding check on Import History page
1 parent 02163a6 commit 07b2081

File tree

6 files changed

+88
-0
lines changed

6 files changed

+88
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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="AdminNavigateToImportHistoryPageActionGroup">
12+
<annotations>
13+
<description>Navigates to the admin System > Data Transfer > Import History page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminImportHistoryPage.url}}" stepKey="navigateToImportHistoryPage"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminImportHistoryPage" url="admin/history" area="admin" module="Magento_ImportExport"/>
12+
</pages>

app/code/Magento/ImportExport/Test/Mftf/Test/AdminImportSimpleAndConfigurableProductsWithAssignedImagesTest.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@
8686
<argument name="indices" value=""/>
8787
</actionGroup>
8888

89+
<!-- Admin: Verify Data on Import History Page -->
90+
<actionGroup ref="AdminNavigateToImportHistoryPageActionGroup" stepKey="navigateToImportHistoryPage"/>
91+
<actionGroup ref="AdminGridSortColumnDescendingActionGroup" stepKey="sortColumnByIdDescending">
92+
<argument name="columnLabel" value="history_id"/>
93+
</actionGroup>
94+
<see userInput="import_configurable_product.csv" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeImportedFile"/>
95+
<see userInput="Created: 4, Updated: 0, Deleted: 0" selector="{{AdminDataGridTableSection.firstRow}}" stepKey="seeSummary"/>
96+
8997
<!-- Admin: Verify Simple Product 1 on Product Index Page -->
9098
<actionGroup ref="AssertProductOnAdminGridActionGroup" stepKey="assertSimpleProduct1InAdminGrid">
9199
<argument name="product" value="ImportSimple1"/>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminGridSortColumnAscendingActionGroup">
11+
<annotations>
12+
<description>Sorts the specified column in ascending order on Admin Grid page.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="columnLabel" type="string"/>
16+
</arguments>
17+
<conditionalClick selector="{{AdminDataGridHeaderSection.columnByLabel(columnLabel)}}" dependentSelector="{{AdminDataGridHeaderSection.columnNotSorted(columnLabel)}}" visible="true" stepKey="clickColumnIfNotSorted"/>
18+
<waitForPageLoad stepKey="waitForGridLoad1"/>
19+
<conditionalClick selector="{{AdminDataGridHeaderSection.columnByLabel(columnLabel)}}" dependentSelector="{{AdminDataGridHeaderSection.columnSortedDescending(columnLabel)}}" visible="true" stepKey="clickColumnIfDescending"/>
20+
<waitForPageLoad stepKey="waitForGridLoad2"/>
21+
<waitForElementVisible selector="{{AdminDataGridHeaderSection.columnSortedAscending(columnLabel)}}" stepKey="seeColumnAscending"/>
22+
</actionGroup>
23+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminGridSortColumnDescendingActionGroup">
11+
<annotations>
12+
<description>Sorts the specified column in descending order on Admin Grid page.</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="columnLabel" type="string"/>
16+
</arguments>
17+
<conditionalClick selector="{{AdminDataGridHeaderSection.columnByLabel(columnLabel)}}" dependentSelector="{{AdminDataGridHeaderSection.columnNotSorted(columnLabel)}}" visible="true" stepKey="clickColumnIfNotSorted"/>
18+
<waitForPageLoad stepKey="waitForGridLoad1"/>
19+
<conditionalClick selector="{{AdminDataGridHeaderSection.columnByLabel(columnLabel)}}" dependentSelector="{{AdminDataGridHeaderSection.columnSortedAscending(columnLabel)}}" visible="true" stepKey="clickColumnIfAscending"/>
20+
<waitForPageLoad stepKey="waitForGridLoad2"/>
21+
<waitForElementVisible selector="{{AdminDataGridHeaderSection.columnSortedDescending(columnLabel)}}" stepKey="seeColumnDescending"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Ui/Test/Mftf/Section/AdminDataGridHeaderSection.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,10 @@
2727
<element name="columnCheckbox" type="checkbox" selector="//div[contains(@class,'admin__data-grid-action-columns')]//div[contains(@class, 'admin__field-option')]//label[text() = '{{column}}']/preceding-sibling::input" parameterized="true"/>
2828
<element name="perPage" type="select" selector="#product_attributes_listing.product_attributes_listing.listing_top.listing_paging_sizes"/>
2929
<element name="attributeName" type="input" selector="//div[text()='{{arg}}']/../preceding-sibling::td//input" parameterized="true"/>
30+
<!--Sorting-->
31+
<element name="columnByLabel" type="text" parameterized="true" selector="th[data-sort='{{columnName}}']"/>
32+
<element name="columnNotSorted" type="text" parameterized="true" selector="th[data-sort='{{columnName}}'].not-sort"/>
33+
<element name="columnSortedAscending" type="text" parameterized="true" selector="th[data-sort='{{columnName}}']._ascend"/>
34+
<element name="columnSortedDescending" type="text" parameterized="true" selector="th[data-sort='{{columnName}}']._descend"/>
3035
</section>
3136
</sections>

0 commit comments

Comments
 (0)