|
19 | 19 | </annotations>
|
20 | 20 |
|
21 | 21 | <before>
|
22 |
| - <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin1"/> |
23 |
| - <actionGroup ref="GoToProductPage" stepKey="goToProductPage"/> |
24 |
| - <actionGroup ref="AdminCreateSimpleProduct" stepKey="adminCreateSimpleProduct"/> |
| 22 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 23 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 24 | + <requiredEntity createDataKey="createCategory"/> |
| 25 | + </createData> |
25 | 26 | </before>
|
26 | 27 |
|
27 |
| - <!--Navigate to a category page --> |
28 |
| - <amOnPage url="/{{SimpleProductOne.urlKey}}.html" stepKey="GoToProductPage"/> |
29 |
| - |
| 28 | + <!--Navigate to a category page --> |
| 29 | + <amOnPage url="$$createSimpleProduct.name$$.html" stepKey="goToProductPage"/> |
30 | 30 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
31 | 31 |
|
32 | 32 | <!-- Remove PHPSESSID and form_key to replicate an expired session-->
|
33 |
| - <executeJS function="var delete_cookie = function(name) { |
34 |
| - document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 UTC; path=/;';}; |
35 |
| - delete_cookie('PHPSESSID'); |
36 |
| - delete_cookie('form_key');" stepKey="removeCookies" after="waitForPageLoad"/> |
| 33 | + <resetCookie userInput="PHPSESSID" stepKey="resetCookieForCart"/> |
| 34 | + <resetCookie userInput="form_key" stepKey="resetCookieForCart2"/> |
37 | 35 |
|
38 | 36 | <!-- "Add to Cart" any product-->
|
39 |
| - <actionGroup ref="FindAndAddProductToCardActGr" stepKey="addProductToCard"/> |
40 |
| - |
| 37 | + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="addToCart"/> |
| 38 | + <waitForElementVisible selector="{{StorefrontProductPageSection.errorMsg}}" time="30" stepKey="assertErrorMessage"/> |
41 | 39 | <after>
|
42 | 40 | <!--Delete created product-->
|
43 |
| - <amOnPage url="/admin" stepKey="GoToDashboard"/> |
44 |
| - <actionGroup ref="GoToProductPage" stepKey="againGoToProductPage"/> |
45 |
| - <actionGroup ref="DeleteCreatedProductActionGroup" stepKey="deleteCreatedProduct"/> |
| 41 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 42 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
46 | 43 | </after>
|
47 | 44 |
|
48 | 45 | </test>
|
|
0 commit comments