|
16 | 16 | <group value="Catalog"/>
|
17 | 17 | </annotations>
|
18 | 18 | <before>
|
19 |
| - <!-- Create category --> |
20 | 19 | <createData entity="_defaultCategory" stepKey="createCategory"/>
|
21 | 20 |
|
22 |
| - <!-- Create product --> |
23 | 21 | <createData entity="ApiSimpleProduct" stepKey="createProduct">
|
24 | 22 | <requiredEntity createDataKey="createCategory"/>
|
25 | 23 | <field key="price">100.00</field>
|
26 | 24 | </createData>
|
27 | 25 |
|
28 |
| - <!-- Add tier price to product --> |
29 | 26 | <createData entity="tierProductPriceDiscount" stepKey="addTierPrice">
|
30 | 27 | <requiredEntity createDataKey="createProduct"/>
|
31 | 28 | </createData>
|
32 | 29 |
|
33 |
| - <!-- Add special price to product --> |
34 | 30 | <createData entity="specialProductPrice2" stepKey="addSpecialToSimpleProduct">
|
35 | 31 | <requiredEntity createDataKey="createProduct"/>
|
36 | 32 | <field key="price">65.00</field>
|
|
40 | 36 | <deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/>
|
41 | 37 | <deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
|
42 | 38 | </after>
|
43 |
| - <!-- Open product page --> |
44 |
| - <amOnPage url="{{StorefrontProductPage.url($createProduct.sku$)}}" stepKey="openProductPage"/> |
| 39 | + |
| 40 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 41 | + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> |
| 42 | + </actionGroup> |
45 | 43 | <waitForPageLoad stepKey="waitForProductPageLoad"/>
|
46 | 44 |
|
47 |
| - <!-- Assert product name on product page --> |
48 |
| - <grabTextFrom selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="productNameText"/> |
49 |
| - <assertEquals stepKey="assertProductNameOnProductPage"> |
50 |
| - <expectedResult type="string">$createProduct.name$</expectedResult> |
51 |
| - <actualResult type="variable">productNameText</actualResult> |
52 |
| - </assertEquals> |
| 45 | + <actionGroup ref="AssertStorefrontProductDetailPageNameActionGroup" stepKey="assertProductNameText"> |
| 46 | + <argument name="productName" value="$createProduct.name$"/> |
| 47 | + </actionGroup> |
53 | 48 |
|
54 |
| - <!-- Assert product tier price on product page --> |
55 |
| - <grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="tierPriceText"/> |
56 |
| - <assertEquals stepKey="assertTierPriceTextOnProductPage"> |
57 |
| - <expectedResult type="string">Buy {{tierProductPriceDiscount.quantity}} for $64.00 each and save 2%</expectedResult> |
58 |
| - <actualResult type="variable">tierPriceText</actualResult> |
59 |
| - </assertEquals> |
| 49 | + <actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText"> |
| 50 | + <argument name="tierProductPriceDiscountQuantity" value="{{tierProductPriceDiscount.quantity}}"/> |
| 51 | + <argument name="productPriceWithAppliedTierPriceDiscount" value="64.00"/> |
| 52 | + <argument name="productSavedPricePercent" value="2"/> |
| 53 | + </actionGroup> |
60 | 54 |
|
61 |
| - <!-- Assert final product price on product page --> |
62 |
| - <grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="productPriceText"/> |
63 |
| - <assertEquals stepKey="assertProductPriceOnProductPage"> |
64 |
| - <expectedResult type="string">$65.00</expectedResult> |
65 |
| - <actualResult type="variable">productPriceText</actualResult> |
66 |
| - </assertEquals> |
| 55 | + <actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceText"> |
| 56 | + <argument name="finalProductPrice" value="65.00"/> |
| 57 | + </actionGroup> |
67 | 58 | </test>
|
68 | 59 | </tests>
|
0 commit comments