|
20 | 20 | </annotations>
|
21 | 21 |
|
22 | 22 | <before>
|
23 |
| - <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> |
24 |
| - <createData entity="_defaultProduct" stepKey="createPreReqProduct"> |
25 |
| - <requiredEntity createDataKey="createPreReqCategory"/> |
| 23 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 24 | + <createData entity="_defaultProduct" stepKey="firstProduct"> |
| 25 | + <requiredEntity createDataKey="category"/> |
| 26 | + </createData> |
| 27 | + <createData entity="_defaultProduct" stepKey="secondProduct"> |
| 28 | + <requiredEntity createDataKey="category"/> |
26 | 29 | </createData>
|
27 | 30 | <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
|
28 | 31 | </before>
|
29 | 32 |
|
30 | 33 | <after>
|
31 |
| - <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> |
32 |
| - <deleteData createDataKey="createPreReqProduct" stepKey="deletePreReqProduct"/> |
| 34 | + <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> |
| 35 | + <deleteData createDataKey="firstProduct" stepKey="deleteFirstProduct"/> |
| 36 | + <deleteData createDataKey="secondProduct" stepKey="deleteSecondProduct"/> |
33 | 37 | <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/>
|
34 | 38 | </after>
|
35 | 39 |
|
36 |
| - <!-- Go to the product edit page of the product that was created in the before block --> |
| 40 | + <!-- Go to the first product edit page --> |
37 | 41 | <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/>
|
38 | 42 | <waitForPageLoad stepKey="wait1"/>
|
39 | 43 | <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid"/>
|
40 | 44 | <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku">
|
41 |
| - <argument name="product" value="_defaultProduct"/> |
| 45 | + <argument name="product" value="$$firstProduct$$"/> |
42 | 46 | </actionGroup>
|
43 | 47 | <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/>
|
44 | 48 |
|
45 |
| - <!-- Set url key so that we can go to this product later --> |
| 49 | + <!-- Set url key --> |
46 | 50 | <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
|
47 |
| - <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="{{_defaultProduct.urlKey}}" stepKey="fillUrlKey"/> |
| 51 | + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$firstProduct.name$$" stepKey="fillUrlKey"/> |
48 | 52 |
|
49 | 53 | <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages"/>
|
50 | 54 |
|
|
102 | 106 | <waitForPageLoad stepKey="waitForUploadPng"/>
|
103 | 107 | <dontSeeElement selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="dontSeeErrorPng"/>
|
104 | 108 |
|
105 |
| - <!-- Save the product and go to the storefront --> |
| 109 | + <!-- Save the first product and go to the storefront --> |
106 | 110 | <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
|
107 |
| - <amOnPage url="{{_defaultProduct.urlkey}}.html" stepKey="goToStorefront"/> |
| 111 | + <amOnPage url="$$firstProduct.name$$.html" stepKey="goToStorefront"/> |
108 | 112 | <waitForPageLoad stepKey="waitForStorefront"/>
|
109 | 113 |
|
110 | 114 | <!-- See all of the images that we uploaded -->
|
|
114 | 118 | <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('gif')}}" stepKey="seeGif"/>
|
115 | 119 | <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('jpg')}}" stepKey="seeJpg"/>
|
116 | 120 | <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('png')}}" stepKey="seePng"/>
|
| 121 | + |
| 122 | + <!-- Go to the category page and see a placeholder image for the second product --> |
| 123 | + <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage"/> |
| 124 | + <seeElement selector=".products-grid img[src*='placeholder/small_image.jpg']" stepKey="seePlaceholder"/> |
| 125 | + |
| 126 | + <!-- Go to the second product edit page --> |
| 127 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex2"/> |
| 128 | + <waitForPageLoad stepKey="wait2"/> |
| 129 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid2"/> |
| 130 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku2"> |
| 131 | + <argument name="product" value="$$secondProduct$$"/> |
| 132 | + </actionGroup> |
| 133 | + <actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid2"/> |
| 134 | + |
| 135 | + <!-- Upload an image --> |
| 136 | + <click selector="{{AdminProductImagesSection.productImagesToggle}}" stepKey="expandImages2"/> |
| 137 | + <attachFile selector="{{AdminProductImagesSection.imageFileUpload}}" userInput="large.jpg" stepKey="attachLarge2"/> |
| 138 | + <waitForPageLoad stepKey="waitForUploadLarge2"/> |
| 139 | + <dontSeeElement selector="{{AdminProductMessagesSection.errorMessage}}" stepKey="dontSeeErrorLarge2"/> |
| 140 | + |
| 141 | + <!-- Set url key --> |
| 142 | + <click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection2"/> |
| 143 | + <fillField selector="{{AdminProductSEOSection.urlKeyInput}}" userInput="$$secondProduct.name$$" stepKey="fillUrlKey2"/> |
| 144 | + |
| 145 | + <!-- Save the second product --> |
| 146 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct2"/> |
| 147 | + |
| 148 | + <!-- Go to the admin grid and see the uploaded image --> |
| 149 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex3"/> |
| 150 | + <waitForPageLoad stepKey="wait3"/> |
| 151 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGrid3"/> |
| 152 | + <actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku3"> |
| 153 | + <argument name="product" value="$$secondProduct$$"/> |
| 154 | + </actionGroup> |
| 155 | + <seeElement selector="img.admin__control-thumbnail[src*='/large']" stepKey="seeImgInGrid"/> |
| 156 | + |
| 157 | + <!-- Go to the category page and see the uploaded image --> |
| 158 | + <amOnPage url="$$category.name$$.html" stepKey="goToCategoryPage2"/> |
| 159 | + <seeElement selector=".products-grid img[src*='/large']" stepKey="seeUploadedImg"/> |
| 160 | + |
| 161 | + <!-- Go to the product page and see the uploaded image --> |
| 162 | + <amOnPage url="$$secondProduct.name$$.html" stepKey="goToStorefront2"/> |
| 163 | + <waitForPageLoad stepKey="waitForStorefront2"/> |
| 164 | + <seeElementInDOM selector="{{StorefrontProductMediaSection.imageFile('large')}}" stepKey="seeLarge2"/> |
117 | 165 | </test>
|
118 | 166 | </tests>
|
0 commit comments