Skip to content

Commit 00a44ff

Browse files
committed
MC-13769: Add Missing P0-P1 MFTF Tests For PageBuilder On CMS Block - Render Content Through Block
- Fixing Row in block tests - Adding products in block test - Adding/Fixing product action groups, data, sections, affected tests
1 parent f804a0d commit 00a44ff

File tree

7 files changed

+297
-144
lines changed

7 files changed

+297
-144
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeProductsActionGroup.xml

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,48 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="validateProduct">
11+
<actionGroup name="validateProductInProductsStage">
1212
<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"/>
3014
<argument name="productsIndex" defaultValue="1" type="string"/>
3115
<argument name="productIndex" defaultValue="1" type="string"/>
3216
<argument name="product" defaultValue="_defaultProduct"/>
17+
<argument name="isClickable" defaultValue="none" type="string"/>
3318
</arguments>
3419
<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"/>
4126
<executeJS function="return getComputedStyle(document.evaluate(&quot;{{page.productName(productIndex, product.name)}}&quot;, document.body).iterateNext()).pointerEvents" stepKey="getProductNamePointerEvents"/>
42-
<assertEquals expected="none" expectedType="string" actualType="variable" actual="getProductNamePointerEvents" stepKey="assertProductNameNotClickable"/>
4327
<executeJS function="return getComputedStyle(document.evaluate(&quot;{{page.productAddToCart(productIndex)}}&quot;, 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(&quot;{{page.productAddToWishList(productIndex)}}&quot;, 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(&quot;{{page.productAddToWishList(productIndex)}}&quot;, document.body).iterateNext()).pointerEvents" stepKey="getWishListPointerEvents"/>
4729
<executeJS function="return getComputedStyle(document.evaluate(&quot;{{page.productAddToCompare(productIndex)}}&quot;, 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>
4946
</actionGroup>
50-
<actionGroup name="validateProductInProducts">
47+
<actionGroup name="validateProductInProductsStorefront" extends="validateProductInProductsStage">
5148
<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"/>
5651
</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"/>
6653
</actionGroup>
6754
<actionGroup name="validateProductCountInProducts">
6855
<arguments>

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeRowActionGroup.xml

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,7 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<!-- Validate Row All Background Attributes -->
12-
<actionGroup name="validateRowBackgroundAttributesWithAllUpdated">
13-
<arguments>
14-
<argument name="page" defaultValue=""/>
15-
<argument name="index" defaultValue="1" type="string"/>
16-
<argument name="backgroundColor" defaultValue=""/>
17-
<argument name="backgroundImage" defaultValue=""/>
18-
<argument name="backgroundPosition" defaultValue="PageBuilderRowBackgroundPosition_Default"/>
19-
<argument name="backgroundSize" defaultValue="PageBuilderRowBackgroundSize_Default"/>
20-
<argument name="backgroundRepeat" defaultValue="PageBuilderRowBackgroundRepeat_Default"/>
21-
<argument name="backgroundAttachment" defaultValue="PageBuilderRowBackgroundAttachment_Default"/>
22-
</arguments>
23-
<waitForElementVisible selector="{{page.base(index)}}" stepKey="waitForRow"/>
24-
<waitForElementVisible selector="{{page.backgroundColor(index, backgroundColor.rgb)}}" stepKey="waitForBackgroundColor"/>
25-
<waitForElementVisible selector="{{page.backgroundImage(index, backgroundImage.fileName, backgroundImage.extension)}}" stepKey="waitForBackgroundImage"/>
26-
<waitForElementVisible selector="{{page.backgroundPosition(index, backgroundPosition.styleValue)}}" stepKey="waitForBackgroundPosition"/>
27-
<waitForElementVisible selector="{{page.backgroundSize(index, backgroundSize.value)}}" stepKey="waitForBackgroundSize"/>
28-
<waitForElementVisible selector="{{page.backgroundRepeat(index, backgroundRepeat.styleValue)}}" stepKey="waitForBackgroundRepeat"/>
29-
<waitForElementVisible selector="{{page.backgroundAttachment(index, backgroundAttachment.value)}}" stepKey="waitForBackgroundAttachment"/>
30-
</actionGroup>
11+
<!-- Validate Row Parallax Background -->
3112
<actionGroup name="validateRowBackgroundAttributesWithAllUpdatedAndParallaxEnabled">
3213
<arguments>
3314
<argument name="page" defaultValue=""/>
@@ -47,7 +28,6 @@
4728
<waitForElementVisible selector="{{page.backgroundRepeat(index, backgroundRepeat.styleValue)}}" stepKey="waitForBackgroundRepeat"/>
4829
<waitForElementVisible selector="{{page.backgroundAttachment(index, backgroundAttachment.value)}}" stepKey="waitForBackgroundAttachment"/>
4930
</actionGroup>
50-
<!-- Validate Row Parallax Background -->
5131
<actionGroup name="validateRowParallaxBackgroundAttributes">
5232
<arguments>
5333
<argument name="page" defaultValue=""/>
@@ -59,6 +39,10 @@
5939
<waitForElementVisible selector="{{page.parallaxState(index, parallaxStateValue.value)}}" stepKey="waitForParallaxBackgroundState"/>
6040
<waitForElementVisible selector="{{page.parallaxSpeed(index, parallaxSpeedValue.value)}}" stepKey="waitForParallaxBackgroundSpeed"/>
6141
</actionGroup>
42+
<actionGroup name="validateBackgroundImageContainerForParallaxRow" extends="validateBackgroundImageContainer">
43+
<comment userInput="validateBackgroundImageContainerForParallaxRow" stepKey="comment"/>
44+
<executeJS function="return window.getComputedStyle({{section.parallaxJS(index)}}).backgroundImage" stepKey="backgroundImageValue"/>
45+
</actionGroup>
6246
<!-- Validate Contained Row Appearance on stage -->
6347
<actionGroup name="validateContainedRowAppearanceOnStage">
6448
<comment userInput="Increase window size to see varying widths for rows" stepKey="commentResizeWindow"/>

app/code/Magento/PageBuilder/Test/Mftf/Data/ProductsData.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,25 @@
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<!-- Product Entity -->
12+
<entity name="PageBuilderProductsSubCategory" type="category">
13+
<data key="name" unique="suffix">PageBuilderProductsSubCategory</data>
14+
<data key="is_active">true</data>
15+
<data key="include_in_menu">true</data>
16+
</entity>
17+
<!-- Number of Products to Display -->
1118
<entity name="PageBuilderProductsCountPropertyOne" type="pagebuilder_content_type">
1219
<data key="name">Number of Products to Display</data>
1320
<data key="section">general</data>
1421
<data key="fieldName">products_count</data>
1522
<data key="value">1</data>
1623
</entity>
24+
<entity name="PageBuilderProductsCountPropertyTwo" type="pagebuilder_content_type">
25+
<data key="name">Number of Products to Display</data>
26+
<data key="section">general</data>
27+
<data key="fieldName">products_count</data>
28+
<data key="value">2</data>
29+
</entity>
1730
<entity name="PageBuilderProductsCountPropertyFour" type="pagebuilder_content_type">
1831
<data key="name">Number of Products to Display</data>
1932
<data key="section">general</data>
@@ -26,7 +39,6 @@
2639
<data key="fieldName">products_count</data>
2740
<data key="value">999</data>
2841
</entity>
29-
3042
<entity name="PageBuilderProductsInvalidMinCountProperty" type="pagebuilder_content_type">
3143
<data key="name">Number of Products to Display</data>
3244
<data key="section">general</data>
@@ -55,9 +67,4 @@
5567
<data key="value"/>
5668
<data key="errorMessage">This is a required field.</data>
5769
</entity>
58-
<entity name="PageBuilderProductsSubCategory" type="category">
59-
<data key="name" unique="suffix">PageBuilderProductsSubCategory</data>
60-
<data key="is_active">true</data>
61-
<data key="include_in_menu">true</data>
62-
</entity>
6370
</entities>

app/code/Magento/PageBuilder/Test/Mftf/Section/PageBuilderRowSection.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
<element name="parallaxState" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][@data-enable-parallax='{{arg2}}']" parameterized="true"/>
5151
<element name="parallaxSpeed" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][@data-parallax-speed='{{arg2}}']" parameterized="true"/>
5252
<element name="parallaxBackgroundImage" type="button" selector='(//div[contains(@class,"pagebuilder-content-type") and contains(@class,"pagebuilder-row")])[{{arg1}}]/descendant::div[contains(@id,"jarallax-container")]/div[contains(@style,"background-image: url(") and contains(@style,"{{arg2}}") and contains(@style,"{{arg3}}")]' parameterized="true"/>
53+
<element name="parallaxJS" type="text" selector="document.querySelectorAll('[data-content-type=row] [id*=jarallax-container] > div')[{{arg1}} - 1]" parameterized="true"/>
5354
<!-- Layout Configuration -->
5455
<element name="minHeight" type="button" selector="(//div[contains(@class,'pagebuilder-content-type') and contains(@class,'pagebuilder-row')])[{{arg1}}][contains(@style,'min-height: {{arg2}}px;')]" parameterized="true"/>
5556
<element name="verticalAlignContainer" type="button" selector="(//div[contains(@class, 'pagebuilder-row')])[{{arg1}}]//div[contains(@class, 'element-children') and contains(@class, 'row-container')][contains(@style,'justify-content: {{arg2}};')]" parameterized="true"/>
@@ -101,6 +102,7 @@
101102
<element name="parallaxState" type="button" selector="(//div[@data-content-type='row'])[{{arg1}}]/div[@data-enable-parallax='{{arg2}}']" parameterized="true"/>
102103
<element name="parallaxSpeed" type="button" selector="(//div[@data-content-type='row'])[{{arg1}}]/div[@data-parallax-speed='{{arg2}}']" parameterized="true"/>
103104
<element name="parallaxBackgroundImage" type="button" selector='(//div[@data-content-type="row"])[{{arg1}}]/descendant::div[contains(@id,"jarallax-container")]/div[contains(@style,"background-image: url(") and contains(@style,"{{arg2}}") and contains(@style,"{{arg3}}")]' parameterized="true"/>
105+
<element name="parallaxJS" type="text" selector="document.querySelectorAll('[data-content-type=row] [id*=jarallax-container] > div')[{{arg1}} - 1]" parameterized="true"/>
104106
<!-- Layout Configuration -->
105107
<element name="minHeight" type="button" selector="(//div[@data-content-type='row'])[{{arg1}}]/div[contains(@style, 'min-height: {{arg2}}px;')]" parameterized="true"/>
106108
<element name="verticalAlignContainer" type="button" selector="(//div[@data-content-type='row'])[{{arg1}}]/div[contains(@style, 'justify-content: {{arg2}};')]" parameterized="true"/>
@@ -154,8 +156,4 @@
154156
<element name="margins" type="text" selector="(//div[@data-content-type='row'])[{{arg1}}][contains(@style,'margin: {{arg2}}px;')]" parameterized="true"/>
155157
<element name="padding" type="text" selector="(//div[@data-content-type='row'])[{{arg1}}][contains(@style,'padding: {{arg2}}px;')]" parameterized="true"/>
156158
</section>
157-
<section name="ParallaxForm">
158-
<element name="sectionName" type="button" selector="//div[@data-index='parallax_background']"/>
159-
<element name="sectionExpanded" type="button" selector="//div[@data-index='parallax_background' and contains(@class,'_show')]"/>
160-
</section>
161159
</sections>

0 commit comments

Comments
 (0)