Skip to content

Commit 7fa3fe1

Browse files
ACQE-8247: Move and Update Category on Store View level when Category Flat Indexer is in Update on Schedule mode
- Created MFTF test file for automating move and update category on store view level when category flat indexer is in update on schedule mode
1 parent ebd6774 commit 7fa3fe1

File tree

4 files changed

+384
-0
lines changed

4 files changed

+384
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminChangeCategoryUrlKeyOnStoreViewActionGroup">
11+
<annotations>
12+
<description>Changes category URL key on store view level with proper wait conditions</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="value" type="string"/>
16+
</arguments>
17+
<!-- Open SEO section with proper conditional click -->
18+
<conditionalClick selector="{{AdminCategorySEOSection.SectionHeader}}"
19+
dependentSelector="{{AdminCategorySEOSection.sectionBody}}"
20+
visible="false"
21+
stepKey="openSeoSection"/>
22+
<waitForPageLoad stepKey="waitForSeoSectionToLoad"/>
23+
<!-- Wait for and uncheck the Use Default checkbox -->
24+
<waitForElementVisible selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}"
25+
stepKey="waitForUrlKeyCheckbox"/>
26+
<uncheckOption selector="{{AdminCategorySEOSection.UrlKeyDefaultValueCheckbox}}" stepKey="uncheckDefaultValue"/>
27+
<!-- Wait for URL key input field to become available -->
28+
<waitForElementVisible selector="{{AdminCategorySEOSection.UrlKeyInput}}" stepKey="waitForUrlKeyInput"/>
29+
<fillField selector="{{AdminCategorySEOSection.UrlKeyInput}}" userInput="{{value}}" stepKey="fillUrlKey"/>
30+
<!-- Save the category -->
31+
<click selector="{{AdminCategoryMainActionsSection.SaveButton}}" stepKey="saveCategoryWithUrlKey"/>
32+
<waitForPageLoad stepKey="waitForCategorySaved"/>
33+
<!-- Verify success message -->
34+
<waitForText userInput="You saved the category." stepKey="verifySuccessMessage"/>
35+
</actionGroup>
36+
</actionGroups>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
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="AdminUpdateCategoryDisplaySettingsWithCustomValuesActionGroup">
11+
<annotations>
12+
<description>Update Category Display settings with custom values (unchecks Use Config first)</description>
13+
</annotations>
14+
<arguments>
15+
<argument name="availableSortOptions" type="string" defaultValue="Product Name"/>
16+
<argument name="defaultSortingOption" type="string" defaultValue="name"/>
17+
<argument name="priceRange" type="string" defaultValue="5.5"/>
18+
</arguments>
19+
<!-- Select Display Setting and fill the options -->
20+
<scrollTo selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" x="0" y="-80"
21+
stepKey="scrollToDisplaySetting"/>
22+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}"
23+
stepKey="waitForDisplaySettingTab"/>
24+
<click selector="{{CategoryDisplaySettingsSection.DisplaySettingTab}}" stepKey="selectDisplaySetting"/>
25+
<waitForPageLoad stepKey="waitForDisplaySettingsSectionLoad"/>
26+
<!-- Uncheck Use Config for Available Sort Options and set custom value -->
27+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.productListCheckBox}}"
28+
stepKey="waitForAvailableSortCheckbox"/>
29+
<uncheckOption selector="{{CategoryDisplaySettingsSection.productListCheckBox}}"
30+
stepKey="uncheckUseConfigForAvailableSort"/>
31+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.productList}}"
32+
stepKey="waitForAvailableSortDropdown"/>
33+
<selectOption selector="{{CategoryDisplaySettingsSection.productList}}"
34+
parameterArray="[{{availableSortOptions}}]" stepKey="selectAvailableSortOptions"/>
35+
<!-- Uncheck Use Config for Default Sort Option and set custom value -->
36+
<scrollTo selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}" x="0" y="-80"
37+
stepKey="scrollToDefaultSortSection"/>
38+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}"
39+
stepKey="waitForDefaultSortCheckbox"/>
40+
<uncheckOption selector="{{CategoryDisplaySettingsSection.defaultProductLisCheckBox}}"
41+
stepKey="uncheckUseConfigForDefaultSort"/>
42+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.defaultProductList}}"
43+
stepKey="waitForDefaultSortDropdown"/>
44+
<selectOption selector="{{CategoryDisplaySettingsSection.defaultProductList}}"
45+
userInput="{{defaultSortingOption}}" stepKey="selectDefaultSortOption"/>
46+
<!-- Uncheck Use Config for Price Range and set custom value -->
47+
<scrollTo selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}" x="0" y="-80"
48+
stepKey="scrollToPriceRangeSection"/>
49+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}"
50+
stepKey="waitForPriceRangeCheckbox"/>
51+
<uncheckOption selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceCheckBox}}"
52+
stepKey="uncheckUseConfigForPriceRange"/>
53+
<waitForElementVisible selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}"
54+
stepKey="waitForPriceRangeInput"/>
55+
<fillField selector="{{CategoryDisplaySettingsSection.layeredNavigationPriceInput}}" userInput="{{priceRange}}"
56+
stepKey="fillPriceRange"/>
57+
</actionGroup>
58+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Data/StoreLabelData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,12 @@
9292
<data key="store_id">1</data>
9393
<data key="label">36</data>
9494
</entity>
95+
<entity name="Store2Group" type="group">
96+
<data key="name">Store 2</data>
97+
<data key="code">store2_group</data>
98+
</entity>
99+
<entity name="Store2View" type="store">
100+
<data key="name">Store View 2</data>
101+
<data key="code">store_view_2</data>
102+
</entity>
95103
</entities>

0 commit comments

Comments
 (0)