Skip to content

Commit 6ea8e85

Browse files
author
Anna Bukatar
committed
ACP2E-980: Customizable options Drag and drop issue
1 parent e8a01c4 commit 6ea8e85

File tree

4 files changed

+112
-0
lines changed

4 files changed

+112
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminOpenAndApplyCustomOptionRecordsPerPageActionGroup">
12+
<annotations>
13+
<description>Open the custom option drop down section and assign the user defined custom value</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="perPageInputValue" type="string" defaultValue="1"/>
17+
</arguments>
18+
19+
<click selector="{{AdminProductCustomOptionsPaginationSection.perPageDropdown}}" stepKey="clickProductPerPageDropdown"/>
20+
<click selector="{{AdminProductCustomOptionsPaginationSection.perPageOption('Custom')}}" stepKey="selectCustomPerPage"/>
21+
<fillField selector="{{AdminProductCustomOptionsPaginationSection.perPageInput}}" userInput="{{perPageInputValue}}" stepKey="fillCustomPerPage"/>
22+
<click selector="{{AdminProductCustomOptionsPaginationSection.perPageApplyInput}}" stepKey="applyCustomPerPage"/>
23+
<waitForPageLoad stepKey="waitForPageRefreshCustomPerPage"/>
24+
</actionGroup>
25+
</actionGroups>
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductCustomOptionsPaginationSection">
12+
<element name="perPageDropdown" type="select" selector=".admin__control-table-pagination .selectmenu"/>
13+
<element name="perPageOption" type="button" selector="//div[@class='admin__control-table-pagination']//div[@class='selectmenu-items _active']//li//button[text()='{{label}}']" parameterized="true"/>
14+
<element name="perPageInput" type="input" selector="//div[@class='admin__control-table-pagination']//div[@class='selectmenu-items _active']//li[@class='_edit']//div[@class='selectmenu-item-edit']//input"/>
15+
<element name="perPageApplyInput" type="button" selector="//div[@class='admin__control-table-pagination']//div[@class='selectmenu-items _active']//li[@class='_edit']//div[@class='selectmenu-item-edit']//button"/>
16+
</section>
17+
</sections>

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<element name="deleteCustomOptions" type="button" selector="//div[contains(@class, 'fieldset-wrapper-title')]//span[contains(., '{{optionTitle}}')]/parent::div/parent::div//button[@class='action-delete']" parameterized="true" timeout="30"/>
2323
<element name="customOption" type="block" selector="[data-index='options'] tbody tr.data-row"/>
2424
<element name="customOptionButtonDelete" type="button" selector="[data-index='options'] [data-index='delete_button']"/>
25+
<element name="toggleCustomizableOption" type="button" selector="//table[@data-index='options']//tr[{{index}}]//div[contains(@class, 'admin__collapsible-title')]" parameterized="true" timeout="30"/>
2526

2627
<element name="optionTypeDropDown" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//div[contains(@class, 'action-select-wrap')]" parameterized="true" timeout="30"/>
2728
<element name="optionTypeItem" type="select" selector="//table[@data-index='options']//tr[{{index}}]//div[@data-index='type']//*[contains(@class, 'action-menu-item')]//*[contains(., '{{optionValue}}')]" parameterized="true" timeout="30"/>
@@ -57,6 +58,13 @@
5758
<element name="optionSku" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr//*[@name='product[options][{{index}}][sku]']" parameterized="true"/>
5859
<element name="optionFileExtensions" type="input" selector="//*[@data-index='custom_options']//*[@data-index='options']/tbody/tr//*[@name='product[options][{{index}}][file_extension]']" parameterized="true"/>
5960
<element name="importOptions" type="button" selector="//button[@data-index='button_import']" timeout="30"/>
61+
62+
<!-- Records/Rows Pagination -->
6063
<element name="customOptionTableRows" type="button" selector=".admin__dynamic-rows[data-index='values'] tr.data-row" timeout="30"/>
64+
<element name="customOptionsTableRecords" type="button" selector=".admin__dynamic-rows[data-index='options']>tbody>tr.data-row" timeout="30"/>
65+
66+
<!-- Elements to test drag&drop -->
67+
<element name="dragCustomOptionRecord" type="block" selector="(//tr[{{dragIndex}}]//div[contains(@class, 'draggable-handle')])['1']" timeout="30" parameterized="true"/>
68+
<element name="customOptionRecordTitle" type="button" selector="//table[@data-index='options']//tr[{{index}}]//div[contains(@class, 'admin__collapsible-title')]//span" timeout="30" parameterized="true"/>
6169
</section>
6270
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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="AdminValidateSimpleProductWithCustomOptionsDragNDropPerPageTest" extends="AdminValidateSimpleProductWithCustomOptionsPerPageTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Customizable options Drag and drop issue"/>
15+
<title value="Customizable options Drag&amp;Drop records across pages"/>
16+
<description value="Validate product's customizable option records Drag&amp;Drop functionality across pages in Admin"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="AC-6086"/>
19+
<useCaseId value="ACP2E-980"/>
20+
<group value="SimpleProduct"/>
21+
</annotations>
22+
23+
<!-- Create two more custom options with 2 values -->
24+
<actionGroup ref="AdminCreateCustomDropDownOptionsActionGroup" stepKey="createSecondCustomOption">
25+
<argument name="customOptionName" value="{{ProductOptionDropDown.title}}2"/>
26+
<argument name="firstOption" value="ProductOptionValueDropdown1"/>
27+
<argument name="secondOption" value="ProductOptionValueDropdown2"/>
28+
</actionGroup>
29+
30+
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomOptionsSection"/>
31+
32+
<actionGroup ref="AdminCreateCustomDropDownOptionsActionGroup" stepKey="createThirdCustomOption">
33+
<argument name="customOptionName" value="{{ProductOptionDropDown.title}}3"/>
34+
<argument name="firstOption" value="ProductOptionValueDropdown1"/>
35+
<argument name="secondOption" value="ProductOptionValueDropdown2"/>
36+
</actionGroup>
37+
38+
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomOptionsSection2"/>
39+
40+
<!-- Validate custom options records per page -->
41+
<actionGroup ref="AdminOpenAndApplyCustomOptionRecordsPerPageActionGroup" stepKey="decreaseNumberOfCustomOptionsPerPage">
42+
<argument name="perPageInputValue" value="1"/>
43+
</actionGroup>
44+
<waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.customOptionsTableRecords}}" stepKey="waitForCustomOptionsToBeVisible"/>
45+
<seeNumberOfElements selector="{{AdminProductCustomizableOptionsSection.customOptionsTableRecords}}" userInput="1" stepKey="see1CustomOptionRecord"/>
46+
47+
<!-- Multi page Drag&Drop -->
48+
<actionGroup ref="AdminOpenAndApplyCustomOptionRecordsPerPageActionGroup" stepKey="increaseNumberOfCustomOptionsPerPage">
49+
<argument name="perPageInputValue" value="3"/>
50+
</actionGroup>
51+
<waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.customOptionsTableRecords}}" stepKey="waitForCustomOptionsToBeVisible2"/>
52+
53+
<!-- Validate drag&drop -->
54+
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customOptionRecordTitle('2')}}" stepKey="scrollToSeeThirdCustomOption"/>
55+
<dragAndDrop selector1="{{AdminProductCustomizableOptionsSection.dragCustomOptionRecord('3')}}" selector2="{{AdminProductCustomizableOptionsSection.dragCustomOptionRecord('2')}}" stepKey="moveCustomOptionRecord"/>
56+
<waitForPageLoad stepKey="waitForDragAndDrop"/>
57+
<see userInput="{{ProductOptionDropDown.title}}3" selector="{{AdminProductCustomizableOptionsSection.customOptionRecordTitle('2')}}" stepKey="seeCustomOptionRecord"/>
58+
59+
<!-- Prepare fore after hook -->
60+
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomOptionsSection3"/>
61+
</test>
62+
</tests>

0 commit comments

Comments
 (0)