|
169 | 169 | <waitForPageLoad stepKey="waitForCategoryPage"/> |
170 | 170 | <seeElement selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="seeProductInCategory"/> |
171 | 171 | <!-- 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> |
175 | 175 | <!-- 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> |
179 | 179 | <!-- Step 5 Expected Result: Swatch Z is crossed on category page --> |
180 | 180 | <grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('Z')}}" userInput="disabled" stepKey="grabZDisabled_A2"/> |
181 | 181 | <assertEquals stepKey="assertZDisabled_A2"> |
182 | 182 | <expectedResult type="string">true</expectedResult> |
183 | 183 | <actualResult type="string">{$grabZDisabled_A2}</actualResult> |
184 | 184 | </assertEquals> |
185 | 185 | <!-- 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> |
189 | 189 | <!-- Step 6 Expected Result: Swatches B, 3, Z are crossed on category page --> |
190 | 190 | <grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A2X"/> |
191 | 191 | <assertEquals stepKey="assertBDisabled_A2X"> |
|
203 | 203 | <actualResult type="string">{$grabZDisabled_A2X}</actualResult> |
204 | 204 | </assertEquals> |
205 | 205 | <!-- 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> |
211 | 209 | <!-- Step 7 Expected Result: Swatch B is crossed on category page --> |
212 | 210 | <grabAttributeFrom selector="{{StorefrontCategoryPageProductInfoSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A1X"/> |
213 | 211 | <assertEquals stepKey="assertBDisabled_A1X"> |
|
218 | 216 | <click selector="{{StorefrontCategoryMainSection.productLink}}" stepKey="openProductPage"/> |
219 | 217 | <waitForPageLoad stepKey="waitForPDP"/> |
220 | 218 | <!-- 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> |
224 | 222 | <!-- 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> |
228 | 226 | <!-- Step 5 Expected Result on PDP: Swatch Z is crossed --> |
229 | 227 | <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('Z')}}" userInput="disabled" stepKey="grabZDisabled_A2_PDP"/> |
230 | 228 | <assertEquals stepKey="assertZDisabled_A2_PDP"> |
231 | 229 | <expectedResult type="string">true</expectedResult> |
232 | 230 | <actualResult type="string">{$grabZDisabled_A2_PDP}</actualResult> |
233 | 231 | </assertEquals> |
234 | 232 | <!-- 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> |
238 | 236 | <!-- Step 6 Expected Result on PDP: Swatches B, 3, Z are crossed --> |
239 | 237 | <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A2X_PDP"/> |
240 | 238 | <assertEquals stepKey="assertBDisabled_A2X_PDP"> |
|
252 | 250 | <actualResult type="string">{$grabZDisabled_A2X_PDP}</actualResult> |
253 | 251 | </assertEquals> |
254 | 252 | <!-- 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> |
260 | 256 | <!-- Step 7 Expected Result on PDP: Swatch B is crossed --> |
261 | 257 | <grabAttributeFrom selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel('B')}}" userInput="disabled" stepKey="grabBDisabled_A1X_PDP"/> |
262 | 258 | <assertEquals stepKey="assertBDisabled_A1X_PDP"> |
|
0 commit comments