Skip to content

Commit 5042b9d

Browse files
ACQE-8028: [MFTF TESTS] StorefrontButtonsInlineTranslationOnProductPageTest
- Fixed element click intercepted error with targeted scrolling and JS positioning
1 parent 4c928fa commit 5042b9d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AddToCartFromStorefrontProductPageActionGroup.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@
1818
</arguments>
1919
<waitForElementNotVisible selector="{{StorefrontProductActionSection.addToCartDisabled}}" stepKey="waitForAddToCartButtonToRemoveDisabledState"/>
2020
<!-- Scroll to button to prevent overlapping elements from intercepting click -->
21-
<scrollToTopOfPage stepKey="scrollToAddToCartButton"/>
21+
<scrollTo selector="{{StorefrontProductActionSection.addToCart}}" stepKey="scrollToAddToCartButton"/>
22+
<wait time="1" stepKey="waitForScrollToComplete"/>
23+
<!-- Additional scroll with JS to ensure element is in viewport and not intercepted -->
24+
<executeJS function="
25+
var element = document.querySelector('#product-addtocart-button');
26+
if (element) {
27+
element.scrollIntoView({behavior: 'smooth', block: 'center'});
28+
}
29+
" stepKey="scrollToAddToCartButtonWithJS"/>
2230
<waitForElementClickable selector="{{StorefrontProductActionSection.addToCart}}" stepKey="waitForAddToCartButton"/>
2331
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
2432
<waitForPageLoad stepKey="waitForAddToCart"/>

0 commit comments

Comments
 (0)