|
163 | 163 | <waitForPageLoad stepKey="waitForStorefront2"/>
|
164 | 164 | <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('large')}}" stepKey="seeLarge2"/>
|
165 | 165 | </test>
|
| 166 | + |
| 167 | + <test name="AdminSimpleProductRemoveImagesTest"> |
| 168 | + <annotations> |
| 169 | + <features value="Catalog"/> |
| 170 | + <stories value="Add/remove images and videos for all product types and category"/> |
| 171 | + <title value="Admin should be able to remove Product Images assigned as Base, Small and Thumbnail from Simple Product"/> |
| 172 | + <description value="Admin should be able to remove Product Images assigned as Base, Small and Thumbnail from Simple Product"/> |
| 173 | + <severity value="CRITICAL"/> |
| 174 | + <testCaseId value="MC-191"/> |
| 175 | + <group value="Catalog"/> |
| 176 | + </annotations> |
| 177 | + |
| 178 | + <before> |
| 179 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 180 | + <createData entity="_defaultProduct" stepKey="product"> |
| 181 | + <requiredEntity createDataKey="category"/> |
| 182 | + </createData> |
| 183 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 184 | + </before> |
| 185 | + |
| 186 | + <after> |
| 187 | + <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> |
| 188 | + <deleteData createDataKey="product" stepKey="deleteProduct"/> |
| 189 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 190 | + </after> |
| 191 | + |
| 192 | + <!-- Go to the product edit page --> |
| 193 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> |
| 194 | + <waitForPageLoad stepKey="wait1"/> |
| 195 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/> |
| 196 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku"> |
| 197 | + <argument name="product" value="$$product$$"/> |
| 198 | + </actionGroup> |
| 199 | + <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct"/> |
| 200 | + |
| 201 | + <!-- Set url key --> |
| 202 | + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/> |
| 203 | + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$product.name$$" stepKey="fillUrlKey"/> |
| 204 | + |
| 205 | + <!-- Expand images section --> |
| 206 | + <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages"/> |
| 207 | + |
| 208 | + <!-- Upload and set Base image --> |
| 209 | + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="adobe-base.jpg" stepKey="attach1"/> |
| 210 | + <waitForPageLoad stepKey="waitForUpload1"/> |
| 211 | + <click selector="{{AdminProductImagesSection.nthProductImage('1')}}" stepKey="openImageDetails1"/> |
| 212 | + <waitForPageLoad stepKey="waitForSlideout1"/> |
| 213 | + <conditionalClick selector="{{AdminProductImagesSection.roleBase}}" dependentSelector="{{AdminProductImagesSection.isBaseSelected}}" visible="false" stepKey="base1"/> |
| 214 | + <conditionalClick selector="{{AdminProductImagesSection.roleSmall}}" dependentSelector="{{AdminProductImagesSection.isSmallSelected}}" visible="true" stepKey="small1"/> |
| 215 | + <conditionalClick selector="{{AdminProductImagesSection.roleThumbnail}}" dependentSelector="{{AdminProductImagesSection.isThumbnailSelected}}" visible="true" stepKey="thumbnail1"/> |
| 216 | + <conditionalClick selector="{{AdminProductImagesSection.roleSwatch}}" dependentSelector="{{AdminProductImagesSection.isSwatchSelected}}" visible="true" stepKey="swatch1"/> |
| 217 | + <pressKey selector="{{AdminProductImagesSection.altText}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ESCAPE]" stepKey="pressEsc1"/> |
| 218 | + <waitForPageLoad stepKey="waitForHide1"/> |
| 219 | + |
| 220 | + <!-- Upload and set Small image --> |
| 221 | + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="adobe-small.jpg" stepKey="attach2"/> |
| 222 | + <waitForPageLoad stepKey="waitForUpload2"/> |
| 223 | + <click selector="{{AdminProductImagesSection.nthProductImage('2')}}" stepKey="openImageDetails2"/> |
| 224 | + <waitForPageLoad stepKey="waitForSlideout2"/> |
| 225 | + <conditionalClick selector="{{AdminProductImagesSection.roleBase}}" dependentSelector="{{AdminProductImagesSection.isBaseSelected}}" visible="true" stepKey="base2"/> |
| 226 | + <conditionalClick selector="{{AdminProductImagesSection.roleSmall}}" dependentSelector="{{AdminProductImagesSection.isSmallSelected}}" visible="false" stepKey="small2"/> |
| 227 | + <conditionalClick selector="{{AdminProductImagesSection.roleThumbnail}}" dependentSelector="{{AdminProductImagesSection.isThumbnailSelected}}" visible="true" stepKey="thumbnail2"/> |
| 228 | + <conditionalClick selector="{{AdminProductImagesSection.roleSwatch}}" dependentSelector="{{AdminProductImagesSection.isSwatchSelected}}" visible="true" stepKey="swatch2"/> |
| 229 | + <pressKey selector="{{AdminProductImagesSection.altText}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ESCAPE]" stepKey="pressEsc2"/> |
| 230 | + <waitForPageLoad stepKey="waitForHide2"/> |
| 231 | + |
| 232 | + <!-- Upload and set Thumbnail image --> |
| 233 | + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="adobe-thumb.jpg" stepKey="attach3"/> |
| 234 | + <waitForPageLoad stepKey="waitForUpload3"/> |
| 235 | + <click selector="{{AdminProductImagesSection.nthProductImage('3')}}" stepKey="openImageDetails3"/> |
| 236 | + <waitForPageLoad stepKey="waitForSlideout3"/> |
| 237 | + <conditionalClick selector="{{AdminProductImagesSection.roleBase}}" dependentSelector="{{AdminProductImagesSection.isBaseSelected}}" visible="true" stepKey="base3"/> |
| 238 | + <conditionalClick selector="{{AdminProductImagesSection.roleSmall}}" dependentSelector="{{AdminProductImagesSection.isSmallSelected}}" visible="true" stepKey="small3"/> |
| 239 | + <conditionalClick selector="{{AdminProductImagesSection.roleThumbnail}}" dependentSelector="{{AdminProductImagesSection.isThumbnailSelected}}" visible="false" stepKey="thumbnail3"/> |
| 240 | + <conditionalClick selector="{{AdminProductImagesSection.roleSwatch}}" dependentSelector="{{AdminProductImagesSection.isSwatchSelected}}" visible="true" stepKey="swatch3"/> |
| 241 | + <pressKey selector="{{AdminProductImagesSection.altText}}" parameterArray="[\Facebook\WebDriver\WebDriverKeys::ESCAPE]" stepKey="pressEsc3"/> |
| 242 | + <waitForPageLoad stepKey="waitForHide3"/> |
| 243 | + |
| 244 | + <!-- Save the product with all 3 images --> |
| 245 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> |
| 246 | + |
| 247 | + <!-- Go to the admin grid and see the Thumbnail image --> |
| 248 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> |
| 249 | + <waitForPageLoad stepKey="wait2"/> |
| 250 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> |
| 251 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> |
| 252 | + <argument name="product" value="$$product$$"/> |
| 253 | + </actionGroup> |
| 254 | + <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="seeBaseInGrid"/> |
| 255 | + |
| 256 | + <!-- Go to the category page and see the Small image --> |
| 257 | + <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage"/> |
| 258 | + <waitForPageLoad stepKey="wait3"/> |
| 259 | + <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="seeThumb"/> |
| 260 | + |
| 261 | + <!-- Go to the product page and see the Base image --> |
| 262 | + <amOnPage url="$$product.name$$.html" stepKey="goToProductPage"/> |
| 263 | + <waitForPageLoad stepKey="wait4"/> |
| 264 | + <seeElement selector="{{StorefrontProductMediaSection.imageFile('/adobe-base')}}" stepKey="seeBase"/> |
| 265 | + |
| 266 | + <!-- Go to the product edit page again --> |
| 267 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> |
| 268 | + <waitForPageLoad stepKey="wait5"/> |
| 269 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> |
| 270 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> |
| 271 | + <argument name="product" value="$$product$$"/> |
| 272 | + </actionGroup> |
| 273 | + <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProduct3"/> |
| 274 | + <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> |
| 275 | + |
| 276 | + <!-- Remove all images --> |
| 277 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('1')}}" stepKey="removeImage1"/> |
| 278 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('2')}}" stepKey="removeImage2"/> |
| 279 | + <click selector="{{AdminProductImagesSection.nthRemoveImageBtn('3')}}" stepKey="removeImage3"/> |
| 280 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/> |
| 281 | + |
| 282 | + <!-- Check admin grid for placeholder --> |
| 283 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex4"/> |
| 284 | + <waitForPageLoad stepKey="wait6"/> |
| 285 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid4"/> |
| 286 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku4"> |
| 287 | + <argument name="product" value="$$product$$"/> |
| 288 | + </actionGroup> |
| 289 | + <dontSeeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/adobe-thumb')}}" stepKey="dontSeeBaseInGrid"/> |
| 290 | + <seeElement selector="{{AdminProductGridSection.productThumbnailBySrc('/placeholder/thumbnail')}}" stepKey="seePlaceholderThumb"/> |
| 291 | + |
| 292 | + <!-- Check category page for placeholder --> |
| 293 | + <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage2"/> |
| 294 | + <waitForPageLoad stepKey="wait7"/> |
| 295 | + <dontSeeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('/adobe-small')}}" stepKey="dontSeeThumb"/> |
| 296 | + <seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc('placeholder/small_image')}}" stepKey="seePlaceholderSmall"/> |
| 297 | + |
| 298 | + <!-- Check product page for placeholder --> |
| 299 | + <amOnPage url="$$product.name$$.html" stepKey="goToProductPage2"/> |
| 300 | + <waitForPageLoad stepKey="wait8"/> |
| 301 | + <dontSeeElement selector="{{StorefrontProductMediaSection.imageFile('/adobe-base')}}" stepKey="dontSeeBase"/> |
| 302 | + <seeElement selector="{{StorefrontProductMediaSection.imageFile('placeholder/image')}}" stepKey="seePlaceholderBase"/> |
| 303 | + </test> |
166 | 304 | </tests>
|
0 commit comments