Skip to content

Commit c700f91

Browse files
ACQE-9002: Verify not existed simple products
- Created new ActionGroups for category and product page
1 parent 541caa8 commit c700f91

File tree

3 files changed

+72
-28
lines changed

3 files changed

+72
-28
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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+
<!--Select a swatch option on category page with hover - handles overlapping swatches-->
12+
<actionGroup name="StorefrontSelectSwatchOptionOnCategoryPageWithHoverActionGroup">
13+
<annotations>
14+
<description>Scrolls to and clicks a swatch option by label on the category page with hover behavior for overlapping swatch elements.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="optionLabel" type="string"/>
18+
</arguments>
19+
<scrollTo selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel(optionLabel)}}" stepKey="scrollToSwatchOption"/>
20+
<moveMouseOver selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel(optionLabel)}}" stepKey="hoverOverSwatchOption"/>
21+
<waitForElementClickable selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel(optionLabel)}}" stepKey="waitForSwatchOptionClickable"/>
22+
<click selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel(optionLabel)}}" stepKey="clickSwatchOption"/>
23+
<waitForPageLoad stepKey="waitAfterSwatchClick"/>
24+
</actionGroup>
25+
</actionGroups>
26+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright 2025 Adobe
5+
* All Rights Reserved.
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+
<!--Select a swatch option on product page with scroll and hover - handles overlapping swatches-->
12+
<actionGroup name="StorefrontSelectSwatchOptionOnProductPageWithScrollAndHoverActionGroup" extends="StorefrontSelectSwatchOptionOnProductPageActionGroup">
13+
<annotations>
14+
<description>Extends StorefrontSelectSwatchOptionOnProductPageActionGroup to add scroll, hover behavior for overlapping swatch elements.</description>
15+
</annotations>
16+
<scrollTo selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="scrollToSwatchOption" before="waitForCreateConfigurationsButtonToBeClickable"/>
17+
<moveMouseOver selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="hoverOverSwatchOption" after="scrollToSwatchOption"/>
18+
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(optionName)}}" stepKey="waitForSwatchOptionClickable" after="hoverOverSwatchOption"/>
19+
<waitForPageLoad stepKey="waitAfterSwatchClick" after="clickSwatchOption"/>
20+
</actionGroup>
21+
</actionGroups>
22+

app/code/Magento/Swatches/Test/Mftf/Test/AdminVerifySwatchOptionFilteringOnFrontendTest.xml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -169,23 +169,23 @@
169169
<waitForPageLoad stepKey="waitForCategoryPage"/>
170170
<seeElement selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="seeProductInCategory"/>
171171
<!-- Step 4: Click A swatch on category page -->
172-
<scrollTo selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('A')}}" stepKey="scrollToSwatchA"/>
173-
<click selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('A')}}" stepKey="clickSwatchA"/>
174-
<waitForPageLoad stepKey="waitAfterClickA"/>
172+
<actionGroup ref="StorefrontSelectSwatchOptionOnCategoryPageWithHoverActionGroup" stepKey="selectSwatchA">
173+
<argument name="optionLabel" value="A"/>
174+
</actionGroup>
175175
<!-- Step 5: Click 2 swatch on category page -->
176-
<scrollTo selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('2')}}" stepKey="scrollToSwatch2"/>
177-
<click selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('2')}}" stepKey="clickSwatch2"/>
178-
<waitForPageLoad stepKey="waitAfterClick2"/>
176+
<actionGroup ref="StorefrontSelectSwatchOptionOnCategoryPageWithHoverActionGroup" stepKey="selectSwatch2">
177+
<argument name="optionLabel" value="2"/>
178+
</actionGroup>
179179
<!-- Step 5 Expected Result: Swatch Z is crossed on category page -->
180180
<grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('Z')}}" userInput="disabled" stepKey="grabZDisabled_A2"/>
181181
<assertEquals stepKey="assertZDisabled_A2">
182182
<expectedResult type="string">true</expectedResult>
183183
<actualResult type="string">{$grabZDisabled_A2}</actualResult>
184184
</assertEquals>
185185
<!-- Step 6: Click X swatch on category page -->
186-
<scrollTo selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('X')}}" stepKey="scrollToSwatchX"/>
187-
<click selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('X')}}" stepKey="clickSwatchX"/>
188-
<waitForPageLoad stepKey="waitAfterClickX"/>
186+
<actionGroup ref="StorefrontSelectSwatchOptionOnCategoryPageWithHoverActionGroup" stepKey="selectSwatchX">
187+
<argument name="optionLabel" value="X"/>
188+
</actionGroup>
189189
<!-- Step 6 Expected Result: Swatches B, 3, Z are crossed on category page -->
190190
<grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A2X"/>
191191
<assertEquals stepKey="assertBDisabled_A2X">
@@ -203,11 +203,9 @@
203203
<actualResult type="string">{$grabZDisabled_A2X}</actualResult>
204204
</assertEquals>
205205
<!-- Step 7: Click on the 1 on category page -->
206-
<scrollTo selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('1')}}" stepKey="scrollToSwatch1"/>
207-
<moveMouseOver selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('1')}}" stepKey="hoverOverSwatch1"/>
208-
<waitForElementClickable selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('1')}}" stepKey="waitForSwatch1Clickable"/>
209-
<click selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('1')}}" stepKey="clickSwatch1"/>
210-
<waitForPageLoad stepKey="waitAfterClick1"/>
206+
<actionGroup ref="StorefrontSelectSwatchOptionOnCategoryPageWithHoverActionGroup" stepKey="selectSwatch1">
207+
<argument name="optionLabel" value="1"/>
208+
</actionGroup>
211209
<!-- Step 7 Expected Result: Swatch B is crossed on category page -->
212210
<grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A1X"/>
213211
<assertEquals stepKey="assertBDisabled_A1X">
@@ -218,23 +216,23 @@
218216
<click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openProductPage"/>
219217
<waitForPageLoad stepKey="waitForPDP"/>
220218
<!-- Repeat Step 4: Click A swatch -->
221-
<scrollTo selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('A')}}" stepKey="scrollToSwatchA_PDP"/>
222-
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('A')}}" stepKey="clickSwatchA_PDP"/>
223-
<waitForPageLoad stepKey="waitAfterClickA_PDP"/>
219+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageWithScrollAndHoverActionGroup" stepKey="selectSwatchA_PDP">
220+
<argument name="optionName" value="A"/>
221+
</actionGroup>
224222
<!-- Repeat Step 5: Click 2 swatch -->
225-
<scrollTo selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('2')}}" stepKey="scrollToSwatch2_PDP"/>
226-
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('2')}}" stepKey="clickSwatch2_PDP"/>
227-
<waitForPageLoad stepKey="waitAfterClick2_PDP"/>
223+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageWithScrollAndHoverActionGroup" stepKey="selectSwatch2_PDP">
224+
<argument name="optionName" value="2"/>
225+
</actionGroup>
228226
<!-- Step 5 Expected Result on PDP: Swatch Z is crossed -->
229227
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Z')}}" userInput="disabled" stepKey="grabZDisabled_A2_PDP"/>
230228
<assertEquals stepKey="assertZDisabled_A2_PDP">
231229
<expectedResult type="string">true</expectedResult>
232230
<actualResult type="string">{$grabZDisabled_A2_PDP}</actualResult>
233231
</assertEquals>
234232
<!-- Repeat Step 6: Click X swatch -->
235-
<scrollTo selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('X')}}" stepKey="scrollToSwatchX_PDP"/>
236-
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('X')}}" stepKey="clickSwatchX_PDP"/>
237-
<waitForPageLoad stepKey="waitAfterClickX_PDP"/>
233+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageWithScrollAndHoverActionGroup" stepKey="selectSwatchX_PDP">
234+
<argument name="optionName" value="X"/>
235+
</actionGroup>
238236
<!-- Step 6 Expected Result on PDP: Swatches B, 3, Z are crossed -->
239237
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A2X_PDP"/>
240238
<assertEquals stepKey="assertBDisabled_A2X_PDP">
@@ -252,11 +250,9 @@
252250
<actualResult type="string">{$grabZDisabled_A2X_PDP}</actualResult>
253251
</assertEquals>
254252
<!-- Repeat Step 7: Click on the 1 -->
255-
<scrollTo selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('1')}}" stepKey="scrollToSwatch1_PDP"/>
256-
<moveMouseOver selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('1')}}" stepKey="hoverOverSwatch1_PDP"/>
257-
<waitForElementClickable selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('1')}}" stepKey="waitForSwatch1Clickable_PDP"/>
258-
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('1')}}" stepKey="clickSwatch1_PDP"/>
259-
<waitForPageLoad stepKey="waitAfterClick1_PDP"/>
253+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageWithScrollAndHoverActionGroup" stepKey="selectSwatch1_PDP">
254+
<argument name="optionName" value="1"/>
255+
</actionGroup>
260256
<!-- Step 7 Expected Result on PDP: Swatch B is crossed -->
261257
<grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A1X_PDP"/>
262258
<assertEquals stepKey="assertBDisabled_A1X_PDP">

0 commit comments

Comments
 (0)