Skip to content

Commit e6e913f

Browse files
committed
B2B-2117: Prepare AWS Aurora Functional Test CI Build for Handing Off to GL Team
- Fixing flaky tests - Fixing failing tests
1 parent 77bdc33 commit e6e913f

7 files changed

+32
-9
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<element name="orderSummarySubtotal" type="text" selector="//tr[@class='totals sub']//span[@class='price']" />
4040
<element name="orderSummaryShippingTotal" type="text" selector="//tr[@class='totals shipping excl']//span[@class='price']" />
4141
<element name="orderSummaryShippingMethod" type="text" selector="//tr[@class='totals shipping excl']//span[@class='value']" />
42-
<element name="orderSummaryTotal" type="text" selector="//tr[@class='grand totals']//span[@class='price']" />
42+
<element name="orderSummaryTotal" type="text" selector="tr.grand.totals span.price" />
4343
<element name="ProductItemByName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']" parameterized="true" />
4444
<element name="ProductOptionsByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options']" parameterized="true" />
4545
<element name="ProductOptionsActiveByProductItemName" type="text" selector="//div[@class='product-item-details']//strong[@class='product-item-name'][text()='{{var1}}']//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true" />

app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
4242
<see selector="{{StorefrontMinicartSection.quantity}}" userInput="1" stepKey="seeCartQuantity"/>
4343
<!-- open the minicart -->
44-
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickShowMinicart1"/>
45-
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="editProductFromMiniCart"/>
44+
<comment userInput="BIC workaround" stepKey="clickShowMinicart1"/>
45+
<comment userInput="BIC workaround" stepKey="editProductFromMiniCart"/>
46+
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openCartFromMiniCart"/>
4647
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickShowMinicart2"/>
4748
<click selector="{{StorefrontMinicartSection.deleteMiniCartItem}}" stepKey="deleteMiniCartItem"/>
4849
<waitForElementVisible selector="{{StoreFrontRemoveItemModalSection.message}}" stepKey="waitFortheConfirmationModal"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontProductNameMinicartOnCheckoutPageDifferentStoreViewsTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@
8484
</assertStringContainsString>
8585

8686
<!--Check product name in Shopping Cart page-->
87-
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="clickViewAndEdit"/>
87+
<comment userInput="BIC workaround" stepKey="clickViewAndEdit"/>
88+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/>
8889
<waitForPageLoad stepKey="waitForShoppingCartPageLoad"/>
8990
<grabTextFrom selector="{{CheckoutCartProductSection.productName}}" stepKey="grabProductNameCart"/>
9091
<assertStringContainsString stepKey="assertProductNameCart">

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyGuestCheckoutUsingFreeShippingAndTaxesTest.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@
8282
<requiredEntity createDataKey="secondBundleChildProduct"/>
8383
</createData>
8484
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
85-
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
86-
<argument name="indices" value="cataloginventory_stock"/>
85+
<magentoCron groups="index" stepKey="reindex"/>
86+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
87+
<argument name="tags" value="config full_page"/>
8788
</actionGroup>
8889
<comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/>
8990
</before>
@@ -101,7 +102,12 @@
101102
<createData entity="DefaultShippingMethodsConfig" stepKey="defaultShippingMethodsConfig"/>
102103
<createData entity="DefaultMinimumOrderAmount" stepKey="defaultMinimumOrderAmount"/>
103104
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdminPanel"/>
104-
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
105+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindexInvalidatedIndices">
106+
<argument name="indices" value=""/>
107+
</actionGroup>
108+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
109+
<argument name="tags" value="config full_page"/>
110+
</actionGroup>
105111
</after>
106112
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPageAndVerifyProduct">
107113
<argument name="product" value="$simpleProduct$"/>

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontVerifyMapMessagePopupOnCartViewPageTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
</actionGroup>
5656

5757
<!-- Navigate to the cart edit page -->
58-
<actionGroup ref="clickViewAndEditCartFromMiniCartActionGroup" stepKey="goToCartViewAndEditPage"/>
58+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartViewAndEditPage"/>
5959

6060
<!-- Check if MAP message and link are present and functioning -->
6161
<actionGroup ref="StorefrontCartPageCheckMapMessagePresentAndClickableActionGroup" stepKey="checkFormMapFunctioning"/>

app/code/Magento/Tax/Test/Mftf/Section/AdminTaxReportsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
<element name="goTodayButton" type="input" selector="//button[contains(text(),'Go Today')]"/>
1717
<element name="showReportButton" type="button" selector="#filter_form_submit"/>
1818
<element name="taxRuleAmount" type="textarea" selector="//*[contains(text(),'{{var1}}')]/following-sibling::td[contains(@class, 'col-tax-amount')]" parameterized="true"/>
19+
<element name="allTaxRuleAmounts" type="textarea" selector="#container tbody tr:not(.subtotals) td.col-tax-amount"/>
1920
</section>
2021
</sections>

app/code/Magento/Tax/Test/Mftf/Test/AdminCheckingTaxReportGridTest.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@
204204
<!--Tax Report Grid displays Tax amount in rows. "Total" and "Subtotal" is a sum of all tax amounts-->
205205
<see selector="{{AdminTaxReportsSection.taxRuleAmount(TaxRateTexas.code)}}" userInput="$amountOfTaxOnFirstProduct" stepKey="assertSubtotalFirstField"/>
206206
<see selector="{{AdminTaxReportsSection.taxRuleAmount(SecondTaxRateTexas.code)}}" userInput="$amountOfTaxOnSecondProduct" stepKey="assertSubtotalSecondField"/>
207-
<see selector="{{AdminTaxReportsSection.taxRuleAmount('Subtotal')}}" userInput="$amountOfTotalTax" stepKey="assertSubtotalField"/>
207+
<!-- Return sum of all amounts on report except subtotal -->
208+
<executeJS function="
209+
return (
210+
function() {
211+
var elements = document.querySelectorAll('{{AdminTaxReportsSection.allTaxRuleAmounts}}');
212+
213+
var amounts = [];
214+
for (let i = 0; i &lt; elements.length; i++) {
215+
amounts.push(Number(elements[i].innerText.replace(/[^0-9.-]+/g,&quot;&quot;)));
216+
};
217+
218+
return Math.round(amounts.reduce((a, b) =&gt; a + b, 0) * 100) / 100;
219+
}()
220+
)" stepKey="sumOfEachAmount"/>
221+
<see selector="{{AdminTaxReportsSection.taxRuleAmount('Subtotal')}}" userInput="{$sumOfEachAmount}" stepKey="assertSubtotalField"/>
208222
</test>
209223
</tests>

0 commit comments

Comments
 (0)