Skip to content

Commit 9f45236

Browse files
committed
MC-4117: Update banner to use new background images logic
- fix overlay ratio math to allow a few pixels buffer
1 parent ca4608c commit 9f45236

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
</arguments>
1616
<!-- Validate overlay position is left -->
1717
<comment userInput="Validate overlay position is left" stepKey="commentValidateOverlayPositionIsLeft"/>
18-
<executeJS function="return Math.round({{page.wrapperJS('1')}}.getBoundingClientRect().right) - Math.round({{page.wrapperJS('1')}}.getBoundingClientRect().width / 2)" stepKey="wrapperRightPositionMinusWidth50Percent"/>
19-
<executeJS function="return Math.round({{page.overlayJS('1')}}.getBoundingClientRect().right)" stepKey="overlayRightPosition"/>
20-
<assertEquals stepKey="assertOverlayIsPositionedLeftBeforeSave">
21-
<expectedResult type="variable">wrapperRightPositionMinusWidth50Percent</expectedResult>
22-
<actualResult type="variable">overlayRightPosition</actualResult>
18+
<executeJS function="return {{page.wrapperJS('1')}}.getBoundingClientRect().right-{{page.wrapperJS('1')}}.getBoundingClientRect().width/2" stepKey="wrapperRightPositionMinusWidth50Percent"/>
19+
<executeJS function="return {{page.overlayJS('1')}}.getBoundingClientRect().right" stepKey="overlayRightPosition"/>
20+
<executeJS function="return Math.round(({$wrapperRightPositionMinusWidth50Percent}/{$overlayRightPosition})*100)/100" stepKey="overlayRatio"/>
21+
<assertEquals stepKey="assertOverlayRatioIsCorrect">
22+
<expectedResult type="int">1</expectedResult>
23+
<actualResult type="variable">overlayRatio</actualResult>
2324
</assertEquals>
2425
</actionGroup>
2526
</actionGroups>

0 commit comments

Comments
 (0)