|
8 | 8 |
|
9 | 9 | <actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
10 | 10 | xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
|
11 |
| - <actionGroup name="validateProduct"> |
| 11 | + <actionGroup name="validateProductInProductsStage"> |
12 | 12 | <arguments>
|
13 |
| - <argument name="page" defaultValue=""/> |
14 |
| - <argument name="index" defaultValue="1" type="string"/> |
15 |
| - <argument name="product" defaultValue="_defaultProduct"/> |
16 |
| - </arguments> |
17 |
| - <waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForProduct"/> |
18 |
| - <waitForElementVisible selector="{{page.image(index)}}" stepKey="waitForProductImage"/> |
19 |
| - <waitForElementVisible selector="{{page.name(index, product.name)}}" stepKey="waitForProductName"/> |
20 |
| - <waitForElementVisible selector="{{page.price(index, product.price)}}" stepKey="waitForProductPrice"/> |
21 |
| - <!-- Must mouse over for elements to appear on storefront --> |
22 |
| - <moveMouseOver selector="{{page.image(index)}}" stepKey="moveMouseOverProduct"/> |
23 |
| - <waitForElementVisible selector="{{page.addToCart(index)}}" stepKey="waitForProductAddToCart"/> |
24 |
| - <waitForElementVisible selector="{{page.addToWishList(index)}}" stepKey="waitForProductAddToWishList"/> |
25 |
| - <waitForElementVisible selector="{{page.addToCompare(index)}}" stepKey="waitForProductAddToCompare"/> |
26 |
| - </actionGroup> |
27 |
| - <actionGroup name="validateProductInProductsOnStage"> |
28 |
| - <arguments> |
29 |
| - <argument name="page" defaultValue=""/> |
| 13 | + <argument name="page" defaultValue="ProductsOnStage"/> |
30 | 14 | <argument name="productsIndex" defaultValue="1" type="string"/>
|
31 | 15 | <argument name="productIndex" defaultValue="1" type="string"/>
|
32 | 16 | <argument name="product" defaultValue="_defaultProduct"/>
|
| 17 | + <argument name="isClickable" defaultValue="none" type="string"/> |
33 | 18 | </arguments>
|
34 | 19 | <waitForElementVisible selector="{{page.base(productsIndex)}}" stepKey="waitForProducts"/>
|
35 |
| - <waitForElementVisible selector="{{page.productImage(productIndex)}}" stepKey="waitForProductImage"/> |
36 |
| - <waitForElementVisible selector="{{page.productName(productIndex, product.name)}}" stepKey="waitForProductName"/> |
37 |
| - <waitForElementVisible selector="{{page.productPrice(productIndex, product.price)}}" stepKey="waitForProductPrice"/> |
38 |
| - <waitForElementVisible selector="{{page.productAddToCart(productIndex)}}" stepKey="waitForProductAddToCart"/> |
39 |
| - <waitForElementVisible selector="{{page.productAddToWishList(productIndex)}}" stepKey="waitForProductAddToWishList"/> |
40 |
| - <waitForElementVisible selector="{{page.productAddToCompare(productIndex)}}" stepKey="waitForProductAddToCompare"/> |
| 20 | + <seeElement selector="{{page.productImage(productIndex)}}" stepKey="seeProductImage"/> |
| 21 | + <seeElement selector="{{page.productName(productIndex, product.name)}}" stepKey="seeProductName"/> |
| 22 | + <seeElement selector="{{page.productPrice(productIndex, product.price)}}" stepKey="seeProductPrice"/> |
| 23 | + <seeElement selector="{{page.productAddToCart(productIndex)}}" stepKey="seeProductAddToCart"/> |
| 24 | + <seeElement selector="{{page.productAddToWishList(productIndex)}}" stepKey="seeProductAddToWishList"/> |
| 25 | + <seeElement selector="{{page.productAddToCompare(productIndex)}}" stepKey="seeProductAddToCompare"/> |
41 | 26 | <executeJS function="return getComputedStyle(document.evaluate("{{page.productName(productIndex, product.name)}}", document.body).iterateNext()).pointerEvents" stepKey="getProductNamePointerEvents"/>
|
42 |
| - <assertEquals expected="none" expectedType="string" actualType="variable" actual="getProductNamePointerEvents" stepKey="assertProductNameNotClickable"/> |
43 | 27 | <executeJS function="return getComputedStyle(document.evaluate("{{page.productAddToCart(productIndex)}}", document.body).iterateNext()).pointerEvents" stepKey="getAddToCartPointerEvents"/>
|
44 |
| - <assertEquals expected="none" expectedType="string" actualType="variable" actual="getAddToCartPointerEvents" stepKey="assertAddToCartNotClickable"/> |
45 |
| - <executeJS function="return getComputedStyle(document.evaluate("{{page.productAddToWishList(productIndex)}}", document.body).iterateNext()).pointerEvents" stepKey="getWishlistPointerEvents"/> |
46 |
| - <assertEquals expected="none" expectedType="string" actualType="variable" actual="getWishlistPointerEvents" stepKey="assertWishlistNotClickable"/> |
| 28 | + <executeJS function="return getComputedStyle(document.evaluate("{{page.productAddToWishList(productIndex)}}", document.body).iterateNext()).pointerEvents" stepKey="getWishListPointerEvents"/> |
47 | 29 | <executeJS function="return getComputedStyle(document.evaluate("{{page.productAddToCompare(productIndex)}}", document.body).iterateNext()).pointerEvents" stepKey="getAddToComparePointerEvents"/>
|
48 |
| - <assertEquals expected="none" expectedType="string" actualType="variable" actual="getAddToComparePointerEvents" stepKey="assertAddToCompareNotClickable"/> |
| 30 | + <assertEquals stepKey="assertWhetherProductNameIsClickable"> |
| 31 | + <expectedResult type="string">{{isClickable}}</expectedResult> |
| 32 | + <actualResult type="variable">getProductNamePointerEvents</actualResult> |
| 33 | + </assertEquals> |
| 34 | + <assertEquals stepKey="assertWhetherAddToCartIsClickable"> |
| 35 | + <expectedResult type="string">{{isClickable}}</expectedResult> |
| 36 | + <actualResult type="variable">getAddToCartPointerEvents</actualResult> |
| 37 | + </assertEquals> |
| 38 | + <assertEquals stepKey="assertWhetherWishListIsClickable"> |
| 39 | + <expectedResult type="string">{{isClickable}}</expectedResult> |
| 40 | + <actualResult type="variable">getWishListPointerEvents</actualResult> |
| 41 | + </assertEquals> |
| 42 | + <assertEquals stepKey="assertWhetherAddToCompareIsClickable"> |
| 43 | + <expectedResult type="string">{{isClickable}}</expectedResult> |
| 44 | + <actualResult type="variable">getAddToComparePointerEvents</actualResult> |
| 45 | + </assertEquals> |
49 | 46 | </actionGroup>
|
50 |
| - <actionGroup name="validateProductInProducts"> |
| 47 | + <actionGroup name="validateProductInProductsStorefront" extends="validateProductInProductsStage"> |
51 | 48 | <arguments>
|
52 |
| - <argument name="page" defaultValue=""/> |
53 |
| - <argument name="productsIndex" defaultValue="1" type="string"/> |
54 |
| - <argument name="productIndex" defaultValue="1" type="string"/> |
55 |
| - <argument name="product" defaultValue="_defaultProduct"/> |
| 49 | + <argument name="page" defaultValue="ProductsOnStorefront"/> |
| 50 | + <argument name="isClickable" defaultValue="auto" type="string"/> |
56 | 51 | </arguments>
|
57 |
| - <waitForElementVisible selector="{{page.base(productsIndex)}}" stepKey="waitForProducts"/> |
58 |
| - <waitForElementVisible selector="{{page.productImage(productIndex)}}" stepKey="waitForProductImage"/> |
59 |
| - <waitForElementVisible selector="{{page.productName(productIndex, product.name)}}" stepKey="waitForProductName"/> |
60 |
| - <waitForElementVisible selector="{{page.productPrice(productIndex, product.price)}}" stepKey="waitForProductPrice"/> |
61 |
| - <!-- Must mouse over for elements to appear on storefront --> |
62 |
| - <moveMouseOver selector="{{page.productImage(productIndex)}}" stepKey="moveMouseOverProduct"/> |
63 |
| - <waitForElementVisible selector="{{page.productAddToCart(productIndex)}}" stepKey="waitForProductAddToCart"/> |
64 |
| - <waitForElementVisible selector="{{page.productAddToWishList(productIndex)}}" stepKey="waitForProductAddToWishList"/> |
65 |
| - <waitForElementVisible selector="{{page.productAddToCompare(productIndex)}}" stepKey="waitForProductAddToCompare"/> |
| 52 | + <moveMouseOver selector="{{page.productImage(productIndex)}}" stepKey="moveMouseOverProduct" after="seeProductPrice"/> |
66 | 53 | </actionGroup>
|
67 | 54 | <actionGroup name="validateProductCountInProducts">
|
68 | 55 | <arguments>
|
|
0 commit comments