|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + /** |
| 4 | + * Copyright 2025 Adobe |
| 5 | + * All Rights Reserved. |
| 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="StorefrontVerifyConfigurableChildImagesOrderTest"> |
| 12 | + <annotations> |
| 13 | + <features value="ConfigurableProduct"/> |
| 14 | + <stories value="Admin adds images to a configurable child and verifies storefront order"/> |
| 15 | + <title value="Verify configurable child images order on product page"/> |
| 16 | + <description value="This test case verifies the order of the images in the frontend of the configurable product"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="AC-8347"/> |
| 19 | + <group value="configurableProduct"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Step 2,3,4: Create color attribute (dropdown) with options and add to default set --> |
| 23 | + <createData entity="productDropDownAttribute" stepKey="createColorAttribute"/> |
| 24 | + <createData entity="productAttributeOption1" stepKey="createColorOption1"> |
| 25 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 26 | + </createData> |
| 27 | + <createData entity="productAttributeOption2" stepKey="createColorOption2"> |
| 28 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 29 | + </createData> |
| 30 | + <createData entity="AddToDefaultSet" stepKey="addColorToDefaultSet"> |
| 31 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 32 | + </createData> |
| 33 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getColorOption1"> |
| 34 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 35 | + </getData> |
| 36 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getColorOption2"> |
| 37 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 38 | + </getData> |
| 39 | + <!-- Step 2,3,4: Create size attribute (dropdown) with options and add to default set --> |
| 40 | + <createData entity="productDropDownAttribute" stepKey="createSizeAttribute"/> |
| 41 | + <createData entity="productAttributeOption1" stepKey="createSizeOption1"> |
| 42 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 43 | + </createData> |
| 44 | + <createData entity="productAttributeOption2" stepKey="createSizeOption2"> |
| 45 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 46 | + </createData> |
| 47 | + <createData entity="AddToDefaultSet" stepKey="addSizeToDefaultSet"> |
| 48 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 49 | + </createData> |
| 50 | + <getData entity="ProductAttributeOptionGetter" index="1" stepKey="getSizeOption1"> |
| 51 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 52 | + </getData> |
| 53 | + <getData entity="ProductAttributeOptionGetter" index="2" stepKey="getSizeOption2"> |
| 54 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 55 | + </getData> |
| 56 | + <!-- Precondition 1: Create configurable product --> |
| 57 | + <createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigProduct"/> |
| 58 | + <!-- Create two child products with both attributes assigned --> |
| 59 | + <createData entity="ApiSimpleOne" stepKey="createChildOne"> |
| 60 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 61 | + <requiredEntity createDataKey="getColorOption1"/> |
| 62 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 63 | + <requiredEntity createDataKey="getSizeOption1"/> |
| 64 | + </createData> |
| 65 | + <createData entity="ApiSimpleOne" stepKey="createChildTwo"> |
| 66 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 67 | + <requiredEntity createDataKey="getColorOption2"/> |
| 68 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 69 | + <requiredEntity createDataKey="getSizeOption2"/> |
| 70 | + </createData> |
| 71 | + <!-- Add both attributes as configurable options to the parent --> |
| 72 | + <createData entity="ConfigurableProductTwoOptions" stepKey="addColorOptionsToConfig"> |
| 73 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 74 | + <requiredEntity createDataKey="createColorAttribute"/> |
| 75 | + <requiredEntity createDataKey="getColorOption1"/> |
| 76 | + <requiredEntity createDataKey="getColorOption2"/> |
| 77 | + </createData> |
| 78 | + <createData entity="ConfigurableProductTwoOptions" stepKey="addSizeOptionsToConfig"> |
| 79 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 80 | + <requiredEntity createDataKey="createSizeAttribute"/> |
| 81 | + <requiredEntity createDataKey="getSizeOption1"/> |
| 82 | + <requiredEntity createDataKey="getSizeOption2"/> |
| 83 | + </createData> |
| 84 | + <!-- Associate children to configurable --> |
| 85 | + <createData entity="ConfigurableProductAddChild" stepKey="attachChildOneToConfig"> |
| 86 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 87 | + <requiredEntity createDataKey="createChildOne"/> |
| 88 | + </createData> |
| 89 | + <createData entity="ConfigurableProductAddChild" stepKey="attachChildTwoToConfig"> |
| 90 | + <requiredEntity createDataKey="createConfigProduct"/> |
| 91 | + <requiredEntity createDataKey="createChildTwo"/> |
| 92 | + </createData> |
| 93 | + </before> |
| 94 | + <after> |
| 95 | + <!-- Delete products, attributes and logout from admin--> |
| 96 | + <deleteData createDataKey="createChildOne" stepKey="deleteChildOne"/> |
| 97 | + <deleteData createDataKey="createChildTwo" stepKey="deleteChildTwo"/> |
| 98 | + <deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/> |
| 99 | + <deleteData createDataKey="createColorAttribute" stepKey="deleteColorAttribute"/> |
| 100 | + <deleteData createDataKey="createSizeAttribute" stepKey="deleteSizeAttribute"/> |
| 101 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogoutAfter"/> |
| 102 | + </after> |
| 103 | + <!-- Login to admin --> |
| 104 | + <actionGroup ref="AdminLoginActionGroup" stepKey="adminLoginBefore"/> |
| 105 | + <!--Step 6: Open child product to upload images --> |
| 106 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openChildProductById"> |
| 107 | + <argument name="productId" value="$createChildOne.id$"/> |
| 108 | + </actionGroup> |
| 109 | + <!-- Step 7: Add 10 images to the child product --> |
| 110 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1"> |
| 111 | + <argument name="image" value="MagentoLogo"/> |
| 112 | + </actionGroup> |
| 113 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage2"> |
| 114 | + <argument name="image" value="TestImageNew"/> |
| 115 | + </actionGroup> |
| 116 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage3"> |
| 117 | + <argument name="image" value="TestImageAdobe"/> |
| 118 | + </actionGroup> |
| 119 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage4"> |
| 120 | + <argument name="image" value="AdobeSmallImage"/> |
| 121 | + </actionGroup> |
| 122 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage5"> |
| 123 | + <argument name="image" value="AdobeThumbImage"/> |
| 124 | + </actionGroup> |
| 125 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage6"> |
| 126 | + <argument name="image" value="JpgImage"/> |
| 127 | + </actionGroup> |
| 128 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage7"> |
| 129 | + <argument name="image" value="LargeImage"/> |
| 130 | + </actionGroup> |
| 131 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage8"> |
| 132 | + <argument name="image" value="MagentoImage"/> |
| 133 | + </actionGroup> |
| 134 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage9"> |
| 135 | + <argument name="image" value="Magento2"/> |
| 136 | + </actionGroup> |
| 137 | + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage10"> |
| 138 | + <argument name="image" value="Magento3"/> |
| 139 | + </actionGroup> |
| 140 | + <waitForElementClickable selector="{{AdminProductFormActionSection.saveButton}}" stepKey="waitToSaveChildProduct"/> |
| 141 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveChildProduct"/> |
| 142 | + <!-- Step 8,9: Go to storefront, open the configurable product and select size and color in which image you have upload --> |
| 143 | + <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openBundleProductPage"> |
| 144 | + <argument name="product" value="$createConfigProduct$"/> |
| 145 | + </actionGroup> |
| 146 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOptionValue"> |
| 147 | + <argument name="attributeLabel" value="$$createColorAttribute.default_frontend_label$$"/> |
| 148 | + <argument name="optionLabel" value="$$getColorOption2.label$$"/> |
| 149 | + </actionGroup> |
| 150 | + <actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOptionValueInDropDown2"> |
| 151 | + <argument name="attributeLabel" value="$$createSizeAttribute.default_frontend_label$$"/> |
| 152 | + <argument name="optionLabel" value="$$getSizeOption1.label$$"/> |
| 153 | + </actionGroup> |
| 154 | + <waitForElementVisible selector="{{StorefrontProductMediaSection.gallery}}" stepKey="waitGalleryOnPdp"/> |
| 155 | + <!-- Step 10: Verify the order of the images in the frontend --> |
| 156 | + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaImageThumbnailImgByNumber('5')}}" stepKey="waitForImagesToVisible"/> |
| 157 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage1"> |
| 158 | + <argument name="image" value="{{MagentoLogo.filename}}"/> |
| 159 | + <argument name="extension" value="{{MagentoLogo.file_extension}}"/> |
| 160 | + <argument name="position" value="1"/> |
| 161 | + </actionGroup> |
| 162 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage2"> |
| 163 | + <argument name="image" value="{{TestImageNew.filename}}"/> |
| 164 | + <argument name="extension" value="{{TestImageNew.file_extension}}"/> |
| 165 | + <argument name="position" value="2"/> |
| 166 | + </actionGroup> |
| 167 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage3"> |
| 168 | + <argument name="image" value="{{TestImageAdobe.filename}}"/> |
| 169 | + <argument name="extension" value="{{TestImageAdobe.file_extension}}"/> |
| 170 | + <argument name="position" value="3"/> |
| 171 | + </actionGroup> |
| 172 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage4"> |
| 173 | + <argument name="image" value="{{AdobeSmallImage.filename}}"/> |
| 174 | + <argument name="extension" value="{{AdobeSmallImage.file_extension}}"/> |
| 175 | + <argument name="position" value="4"/> |
| 176 | + </actionGroup> |
| 177 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage5"> |
| 178 | + <argument name="image" value="{{AdobeThumbImage.filename}}"/> |
| 179 | + <argument name="extension" value="{{AdobeThumbImage.file_extension}}"/> |
| 180 | + <argument name="position" value="5"/> |
| 181 | + </actionGroup> |
| 182 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage6"> |
| 183 | + <argument name="image" value="{{JpgImage.filename}}"/> |
| 184 | + <argument name="extension" value="{{JpgImage.file_extension}}"/> |
| 185 | + <argument name="position" value="6"/> |
| 186 | + </actionGroup> |
| 187 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage7"> |
| 188 | + <argument name="image" value="{{LargeImage.filename}}"/> |
| 189 | + <argument name="extension" value="{{LargeImage.file_extension}}"/> |
| 190 | + <argument name="position" value="7"/> |
| 191 | + </actionGroup> |
| 192 | + <!-- Shift ribbon then assert remaining images--> |
| 193 | + <waitForElementClickable selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="waitToShiftRibbonNext"/> |
| 194 | + <click selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="shiftRibbonNext"/> |
| 195 | + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaImageThumbnailImgByNumber('10')}}" stepKey="waitForTheImagesToVisible"/> |
| 196 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage8"> |
| 197 | + <argument name="image" value="{{MagentoImage.filename}}"/> |
| 198 | + <argument name="extension" value="{{MagentoImage.file_extension}}"/> |
| 199 | + <argument name="position" value="8"/> |
| 200 | + </actionGroup> |
| 201 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage9"> |
| 202 | + <argument name="image" value="{{Magento2.filename}}"/> |
| 203 | + <argument name="extension" value="{{Magento2.file_extension}}"/> |
| 204 | + <argument name="position" value="9"/> |
| 205 | + </actionGroup> |
| 206 | + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImage10"> |
| 207 | + <argument name="image" value="{{Magento3.filename}}"/> |
| 208 | + <argument name="extension" value="{{Magento3.file_extension}}"/> |
| 209 | + <argument name="position" value="10"/> |
| 210 | + </actionGroup> |
| 211 | + </test> |
| 212 | +</tests> |
0 commit comments