Skip to content

Commit 770ca2a

Browse files
committed
#635: User Access Column Action Panel with 2+ Level Nesting - Mftf changes
1 parent f1cbfa5 commit 770ca2a

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

app/code/Magento/PageBuilder/Test/Mftf/ActionGroup/ContentTypeColumnActionGroup/ValidateColumnWidthActionGroup.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
</arguments>
1919
<executeJS function="return Math.round(window.getComputedStyle(document.evaluate('{{section.columnConfigurationPath(index)}}', document.body).iterateNext()).width.replace(/px/g, &quot;&quot;))" stepKey="grabColumnWidthValue"/>
2020
<executeJS function="return Math.round(window.getComputedStyle(document.evaluate('{{section.columnGroupPath(parentIndex)}}', document.body).iterateNext()).width.replace(/px/g, &quot;&quot;) * {{columnWidth}})" stepKey="grabCalculatedColumnWidthValue"/>
21-
<assertEquals stepKey="assertColumnWidthValue">
22-
<expectedResult type="variable">grabColumnWidthValue</expectedResult>
23-
<actualResult type="variable">grabCalculatedColumnWidthValue</actualResult>
24-
</assertEquals>
21+
<executeJS function="return Math.abs({$grabColumnWidthValue}-{$grabCalculatedColumnWidthValue})" stepKey="columnWidthDifference"/>
22+
<assertLessThanOrEqual stepKey="assertColumnWidthValue">
23+
<expectedResult type="int">2</expectedResult>
24+
<actualResult type="variable">columnWidthDifference</actualResult>
25+
</assertLessThanOrEqual>
2526
</actionGroup>
2627
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@
472472
<data key="fieldName">margins_and_padding</data>
473473
<data key="value">0 1 0 0</data>
474474
<data key="marginTop">0</data>
475-
<data key="marginRight">0</data>
475+
<data key="marginRight">1</data>
476476
<data key="marginBottom">0</data>
477477
<data key="marginLeft">0</data>
478478
</entity>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderBlockRenderLayoutContentTypesTest/BlockRenderColumnDragAndDropMultipleColumnsResizingThroughBlockContentTypeTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<actualResult type="variable">columnRatio3CMSBlockStage</actualResult>
8585
</assertEquals>
8686
<executeJS function="return Math.round({$columnOneWidthCMSBlockStage}+{$columnTwoWidthCMSBlockStage}+{$columnThreeWidthCMSBlockStage}+{$columnFourWidthCMSBlockStage})" stepKey="totalColumnWidthCMSBlockStage"/>
87-
<executeJS function="return Math.round({{RowOnStage.rowWidthJS('1')}}-{{PageBuilderPaddingPropertyRowDefault.paddingLeft}}-{{PageBuilderPaddingPropertyRowDefault.paddingRight}}-{{PageBuilderRowAffordanceWidth.value}})" stepKey="rowWidthCMSBlockStage"/>
87+
<executeJS function="return Math.round({{RowOnStage.rowWidthJS('1')}}-{{PageBuilderPaddingPropertyRowDefault.paddingLeft}}-{{PageBuilderPaddingPropertyRowDefault.paddingRight}}-{{PageBuilderRowAffordanceWidth.value}} - 4 * {{PageBuilderMarginsPropertyColumnDefault.marginRight}})" stepKey="rowWidthCMSBlockStage"/>
8888
<executeJS function="return Math.abs({$totalColumnWidthCMSBlockStage}-{$rowWidthCMSBlockStage})" stepKey="widthDifferenceCMSBlockStage"/>
8989
<assertLessThanOrEqual stepKey="assertWidthOfAllColumnsCMSBlockStage">
9090
<expectedResult type="int">2</expectedResult>

app/code/Magento/PageBuilder/Test/Mftf/Test/AdminPageBuilderColumnTest/DuplicatingColumnWillDivideSourceColumnTest.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
<waitForPageLoad stepKey="waitForDragAndDrop2"/>
5050
<!-- Check all columns have the same width -->
5151
<comment userInput="Validate column widths are as expected" stepKey="commentValidateWidthsAreCorrect"/>
52-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('1')}}').clientWidth" stepKey="columnOneWidth"/>
53-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('2')}}').clientWidth" stepKey="columnTwoWidth"/>
54-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('3')}}').clientWidth" stepKey="columnThreeWidth"/>
52+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('1')}}').offsetWidth" stepKey="columnOneWidth"/>
53+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('2')}}').offsetWidth" stepKey="columnTwoWidth"/>
54+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('3')}}').offsetWidth" stepKey="columnThreeWidth"/>
5555
<executeJS function="return Math.round({$columnOneWidth}/{$columnTwoWidth})" stepKey="columnRatio"/>
5656
<assertEquals stepKey="assertRatioIsCorrect">
5757
<expectedResult type="int">1</expectedResult>
@@ -70,8 +70,8 @@
7070
</actionGroup>
7171
<!-- Assert original 1st and 3rd column are unaffected -->
7272
<comment userInput="Assert duplication was successful" stepKey="commentAssertDuplicateSuccess"/>
73-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('1')}}').clientWidth" stepKey="columnOneWidthAfterDuplicate"/>
74-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('4')}}').clientWidth" stepKey="columnOriginalThreeWidthAfterDuplicate"/>
73+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('1')}}').offsetWidth" stepKey="columnOneWidthAfterDuplicate"/>
74+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('4')}}').offsetWidth" stepKey="columnOriginalThreeWidthAfterDuplicate"/>
7575
<assertEquals stepKey="assertColumnOneWidthUnaffected">
7676
<expectedResult type="variable">columnOneWidth</expectedResult>
7777
<actualResult type="variable">columnOneWidthAfterDuplicate</actualResult>
@@ -82,8 +82,8 @@
8282
</assertEquals>
8383
<!-- Assert source and duplicated column are the same width -->
8484
<comment userInput="Assert source and duplicate column as same width" stepKey="commentAssertDuplicateAndSourceWidth"/>
85-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('2')}}').clientWidth" stepKey="columnTwoAfterDuplicate"/>
86-
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('3')}}').clientWidth" stepKey="columnThreeAfterDuplicate"/>
85+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('2')}}').offsetWidth" stepKey="columnTwoAfterDuplicate"/>
86+
<executeJS function="return document.querySelector('{{ColumnOnBackend.columnX('3')}}').offsetWidth" stepKey="columnThreeAfterDuplicate"/>
8787
<executeJS function="return Math.round({$columnTwoAfterDuplicate}/{$columnThreeAfterDuplicate})" stepKey="columnAfterDuplicateRatio"/>
8888
<assertEquals stepKey="assertDuplicatedRatioIsCorrect">
8989
<expectedResult type="int">1</expectedResult>

0 commit comments

Comments
 (0)