File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
app/code/Magento/Catalog/Test/Mftf/ActionGroup Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 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" />
You can’t perform that action at this time.
0 commit comments