Skip to content

Commit 1bd7bf3

Browse files
committed
Merge remote-tracking branch 'magento-mpi/MC-21831' into MPI-PR-2019-10-31
2 parents bf1f01c + df5044c commit 1bd7bf3

18 files changed

+243
-157
lines changed

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/AdminSalesOrderActionGroup.xml

+13-14
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@
88
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<actionGroup name="AdminSalesOrderActionGroup">
11-
<waitForPageLoad stepKey="waitForAdminSalesPageToLoad"/>
12-
<click selector="{{AdminOrdersGridSection.firstRow}}" stepKey="clickOrderRowLink"/>
13-
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
14-
<waitForPageLoad stepKey="waitForCheckTotalActionGroup"/>
1511
<scrollTo selector="{{AdminOrderTotalSection.subTotal}}" stepKey="scrollToOrderTotalSection"/>
16-
<grabTextFrom selector="{{AdminOrderTotalSection.subTotal}}" stepKey="grabvalueForSubtotal"/>
17-
<grabTextFrom selector="{{AdminOrderTotalSection.shippingAndHandling}}" stepKey="grabvalueForShippingHandling"/>
18-
<grabTextFrom selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="grabvalueForGrandTotal"/>
19-
<executeJS stepKey="sum_TotalValue" function="
20-
var subtotal = '{$grabvalueForSubtotal}'.substr(1);
21-
var handling = '{$grabvalueForShippingHandling}'.substr(1);
22-
var subtotal_handling = (parseFloat(subtotal) + parseFloat(handling)).toFixed(2);
23-
return ('$' + subtotal_handling);"/>
12+
<grabTextFrom selector="{{AdminOrderTotalSection.subTotal}}" stepKey="grabValueForSubtotal"/>
13+
<grabTextFrom selector="{{AdminOrderTotalSection.shippingAndHandling}}" stepKey="grabValueForShippingHandling"/>
14+
<grabTextFrom selector="{{AdminOrderTotalSection.grandTotal}}" stepKey="grabValueForGrandTotal"/>
15+
<executeJS function="
16+
var grandTotal = '{$grabValueForGrandTotal}'.substr(1);
17+
return (grandTotal);" stepKey="grandTotalValue"/>
18+
<executeJS function="
19+
var subtotal = '{$grabValueForSubtotal}'.substr(1);
20+
var handling = '{$grabValueForShippingHandling}'.substr(1);
21+
var subtotalHandling = (parseFloat(subtotal) + parseFloat(handling)).toFixed(2);
22+
return (subtotalHandling);" stepKey="sumTotalValue"/>
2423
<assertEquals stepKey="assertSubTotalPrice">
25-
<expectedResult type="string">$sum_TotalValue</expectedResult>
26-
<actualResult type="string">$grabvalueForGrandTotal</actualResult>
24+
<expectedResult type="variable">$sumTotalValue</expectedResult>
25+
<actualResult type="variable">$grandTotalValue</actualResult>
2726
</assertEquals>
2827
</actionGroup>
2928
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<actionGroup name="AssertStorefrontSalesOrderMatchesGrandTotalActionGroup">
12+
<arguments>
13+
<argument name="dataHref" type="string"/>
14+
</arguments>
15+
<!--Click on View Order Link-->
16+
<click selector="{{StorefrontSalesOrderSection.viewOrderLink(dataHref)}}" stepKey="viewOrderAction"/>
17+
<waitForPageLoad stepKey="waitForViewOrderPageToLoad"/>
18+
<grabTextFrom selector="{{StorefrontSalesOrderSection.salesOrderPrice('subtotal')}}" stepKey="grabValueForSubtotal"/>
19+
<grabTextFrom selector="{{StorefrontSalesOrderSection.salesOrderPrice('shipping')}}" stepKey="grabValueForShippingHandling"/>
20+
<grabTextFrom selector="{{StorefrontSalesOrderSection.salesOrderPrice('grand_total')}}" stepKey="grabValueForGrandTotal"/>
21+
<executeJS function="
22+
var grandTotal = '{$grabValueForGrandTotal}'.substr(1);
23+
return (grandTotal);" stepKey="grandTotalValue"/>
24+
<executeJS function="
25+
var subtotal = '{$grabValueForSubtotal}'.substr(1);
26+
var handling = '{$grabValueForShippingHandling}'.substr(1);
27+
var subtotalHandling = (parseFloat(subtotal) + parseFloat(handling)).toFixed(2);
28+
return (subtotalHandling);" stepKey="sumTotalValue"/>
29+
<assertEquals stepKey="assertSubTotalPrice">
30+
<expectedResult type="variable">$sumTotalValue</expectedResult>
31+
<actualResult type="variable">$grandTotalValue</actualResult>
32+
</assertEquals>
33+
</actionGroup>
34+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMinicartActionGroup.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<actionGroup name="CheckingWithMinicartActionGroup">
12-
<waitForPageLoad stepKey="waitForCheckoutCartPageLoad"/>
13-
<click stepKey="clickOnCollapsibleDiv" selector="{{MinicartSection.clickOnCollapsibleDiv}}"/>
14-
<click stepKey="clickOnShippingMethodRadioButton" selector="{{MinicartSection.shippingMethodRadioButton}}"/>
12+
<click selector="{{MinicartSection.clickOnCollapsibleDiv}}" stepKey="clickOnCollapsibleDiv"/>
13+
<click selector="{{MinicartSection.shippingMethodRadioButton}}" stepKey="clickOnShippingMethodRadioButton"/>
1514
<waitForPageLoad stepKey="waitForShippingPriceToBeChanged"/>
1615
<grabTextFrom selector="{{MinicartSection.shippingMethodRadioText}}" stepKey="shippingMethodRadioText"/>
1716
<grabTextFrom selector="{{MinicartSection.shippingMethodSubtotalPrice}}" stepKey="shippingMethodSubtotalPrice"/>

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/CheckingWithMultipleAddressesActionGroup.xml

+16-12
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<actionGroup name="CheckingWithSingleAddressActionGroup">
12-
<click stepKey="clickOnCheckoutWithMultipleAddresses" selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}"/>
12+
<click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/>
1313
<waitForPageLoad stepKey="waitForMultipleAddressPageLoad"/>
14-
<click stepKey="goToShippingInformation" selector="{{SingleShippingSection.goToShippingInfo}}"/>
14+
<click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/>
1515
<waitForPageLoad stepKey="waitForShippingPageLoad"/>
1616
</actionGroup>
1717
<actionGroup name="CheckingWithMultipleAddressesActionGroup" extends="CheckingWithSingleAddressActionGroup">
18-
<grabTextFrom stepKey="firstShippingAddressValue" selector="{{MultishippingSection.firstShippingAddressValue}}" after="waitForMultipleAddressPageLoad" />
19-
<selectOption selector="{{MultishippingSection.firstShippingAddressOption}}" userInput="{$firstShippingAddressValue}" stepKey="selectFirstShippingMethod" after="firstShippingAddressValue" />
20-
<waitForPageLoad stepKey="waitForSecondShippingAddresses" after="selectFirstShippingMethod" />
21-
<grabTextFrom stepKey="secondShippingAddressValue" selector="{{MultishippingSection.secondShippingAddressValue}}" after="waitForSecondShippingAddresses" />
22-
<selectOption selector="{{MultishippingSection.secondShippingAddressOption}}" userInput="{$secondShippingAddressValue}" stepKey="selectSecondShippingMethod" after="secondShippingAddressValue" />
23-
<click stepKey="clickOnUpdateAddress" selector="{{SingleShippingSection.updateAddress}}" after="selectSecondShippingMethod" />
24-
<waitForPageLoad stepKey="waitForShippingInformation" after="clickOnUpdateAddress" />
18+
<arguments>
19+
<argument name="addressOption1" type="string" defaultValue="1"/>
20+
<argument name="addressOption2" type="string" defaultValue="2"/>
21+
</arguments>
22+
<grabTextFrom selector="{{MultishippingSection.shippingAddressOptions(addressOption1,addressOption1)}}" after="waitForMultipleAddressPageLoad" stepKey="firstShippingAddressValue"/>
23+
<selectOption selector="{{MultishippingSection.shippingAddressSelector(addressOption1)}}" userInput="{$firstShippingAddressValue}" after="firstShippingAddressValue" stepKey="selectFirstShippingMethod"/>
24+
<waitForPageLoad after="selectFirstShippingMethod" stepKey="waitForSecondShippingAddresses"/>
25+
<grabTextFrom selector="{{MultishippingSection.shippingAddressOptions(addressOption2,addressOption2)}}" after="waitForSecondShippingAddresses" stepKey="secondShippingAddressValue"/>
26+
<selectOption selector="{{MultishippingSection.shippingAddressSelector(addressOption2)}}" userInput="{$secondShippingAddressValue}" after="secondShippingAddressValue" stepKey="selectSecondShippingMethod"/>
27+
<click selector="{{SingleShippingSection.updateAddress}}" after="selectSecondShippingMethod" stepKey="clickOnUpdateAddress"/>
28+
<waitForPageLoad after="clickOnUpdateAddress" stepKey="waitForShippingInformation"/>
2529
</actionGroup>
2630
<actionGroup name="StorefrontCheckoutWithMultipleAddressesActionGroup">
2731
<click selector="{{SingleShippingSection.checkoutWithMultipleAddresses}}" stepKey="clickOnCheckoutWithMultipleAddresses"/>
@@ -35,9 +39,9 @@
3539
<selectOption selector="{{MultishippingSection.selectShippingAddress(sequenceNumber)}}" userInput="{{option}}" stepKey="selectShippingAddress"/>
3640
</actionGroup>
3741
<actionGroup name="StorefrontSaveAddressActionGroup">
38-
<click stepKey="clickOnUpdateAddress" selector="{{SingleShippingSection.updateAddress}}"/>
39-
<waitForPageLoad stepKey="waitForShippingInformationAfterUpdated" time="90"/>
40-
<click stepKey="goToShippingInformation" selector="{{SingleShippingSection.goToShippingInfo}}"/>
42+
<click selector="{{SingleShippingSection.updateAddress}}" stepKey="clickOnUpdateAddress"/>
43+
<waitForPageLoad time="90" stepKey="waitForShippingInformationAfterUpdated"/>
44+
<click selector="{{SingleShippingSection.goToShippingInfo}}" stepKey="goToShippingInformation"/>
4145
<waitForPageLoad stepKey="waitForShippingPageLoad"/>
4246
</actionGroup>
4347
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/PlaceOrderActionGroup.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<actionGroup name="PlaceOrderActionGroup">
12-
<waitForPageLoad stepKey="waitForPlaceOrderPageLoad"/>
13-
<!-- place order and check the order number-->
14-
<click stepKey="checkoutMultishipmentPlaceOrder" selector="{{SingleShippingSection.placeOrder}}" />
12+
<click selector="{{SingleShippingSection.placeOrder}}" stepKey="checkoutMultiShipmentPlaceOrder"/>
1513
<waitForPageLoad stepKey="waitForSuccessfullyPlacedOrder"/>
1614
<see selector="{{CheckoutSuccessMainSection.successTitle}}" userInput="Thank you for your purchase!" stepKey="waitForLoadSuccessPage"/>
17-
1815
</actionGroup>
19-
</actionGroups>
16+
<actionGroup name="StorefrontPlaceOrderForMultipleAddressesActionGroup" extends="PlaceOrderActionGroup">
17+
<arguments>
18+
<argument name="firstOrderPosition" type="string" defaultValue="1"/>
19+
<argument name="secondOrderPosition" type="string" defaultValue="2"/>
20+
</arguments>
21+
<grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" after="waitForLoadSuccessPage" stepKey="getFirstOrderId"/>
22+
<grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(firstOrderPosition)}}" userInput="href" after="getFirstOrderId" stepKey="dataHrefForFirstOrder"/>
23+
<grabTextFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" after="dataHrefForFirstOrder" stepKey="getSecondOrderId"/>
24+
<grabAttributeFrom selector="{{StorefrontSalesOrderSection.orderLinkByPosition(secondOrderPosition)}}" userInput="href" after="getSecondOrderId" stepKey="dataHrefForSecondOrder"/>
25+
</actionGroup>
26+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/ReviewOrderActionGroup.xml

+17-10
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,37 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<actionGroup name="ReviewOrderForSingleShipmentActionGroup">
12-
<waitForPageLoad stepKey="waitForReviewOrderPageLoad"/>
13-
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice}}" stepKey="shippingMethodBasePrice"/>
14-
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice}}" stepKey="shippingMethodSubtotalPrice"/>
12+
<arguments>
13+
<argument name="totalName" type="string" defaultValue="Shipping &amp; Handling"/>
14+
<argument name="totalPosition" type="string" defaultValue="1"/>
15+
</arguments>
16+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPosition)}}" stepKey="shippingMethodBasePrice"/>
17+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPosition,totalName)}}" stepKey="shippingMethodSubtotalPrice"/>
1518
<assertEquals stepKey="assertShippingMethodPrice">
1619
<expectedResult type="string">$shippingMethodSubtotalPrice</expectedResult>
1720
<actualResult type="string">$shippingMethodBasePrice</actualResult>
1821
</assertEquals>
1922
</actionGroup>
2023
<actionGroup name="ReviewOrderForMultiShipmentActionGroup">
21-
<waitForPageLoad stepKey="waitForFirstShippingMethod" />
24+
<arguments>
25+
<argument name="totalNameForFirstOrder" type="string" defaultValue="Shipping &amp; Handling"/>
26+
<argument name="totalPositionForFirstOrder" type="string" defaultValue="1"/>
27+
<argument name="totalNameForSecondOrder" type="string" defaultValue="Shipping &amp; Handling"/>
28+
<argument name="totalPositionForSecondOrder" type="string" defaultValue="2"/>
29+
</arguments>
2230
<!--Check First Shipping Method Price-->
23-
<grabTextFrom selector="{{ReviewOrderSection.firstShippingMethodBasePrice}}" stepKey="firstShippingMethodBasePrice"/>
24-
<grabTextFrom selector="{{ReviewOrderSection.firstShippingMethodSubtotalPrice}}" stepKey="firstShippingMethodSubtotalPrice"/>
31+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForFirstOrder)}}" stepKey="firstShippingMethodBasePrice"/>
32+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForFirstOrder,totalNameForFirstOrder)}}" stepKey="firstShippingMethodSubtotalPrice"/>
2533
<assertEquals stepKey="assertShippingMethodPrice">
2634
<expectedResult type="string">$firstShippingMethodSubtotalPrice</expectedResult>
2735
<actualResult type="string">$firstShippingMethodBasePrice</actualResult>
2836
</assertEquals>
2937
<!--Check Second Shipping Method Price-->
30-
<grabTextFrom selector="{{ReviewOrderSection.secondShippingMethodBasePrice}}" stepKey="secondShippingMethodBasePrice" />
31-
<grabTextFrom selector="{{ReviewOrderSection.secondShippingMethodSubtotalPrice}}" stepKey="secondShippingMethodSubtotalPrice" />
38+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodBasePrice(totalPositionForSecondOrder)}}" stepKey="secondShippingMethodBasePrice"/>
39+
<grabTextFrom selector="{{ReviewOrderSection.shippingMethodSubtotalPrice(totalPositionForSecondOrder,totalNameForSecondOrder)}}" stepKey="secondShippingMethodSubtotalPrice"/>
3240
<assertEquals stepKey="assertSecondShippingMethodPrice" >
3341
<expectedResult type="string">$secondShippingMethodSubtotalPrice</expectedResult>
3442
<actualResult type="string">$secondShippingMethodBasePrice</actualResult>
3543
</assertEquals>
36-
3744
</actionGroup>
38-
</actionGroups>
45+
</actionGroups>

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SalesOrderActionGroup.xml

-38
This file was deleted.

app/code/Magento/Multishipping/Test/Mftf/ActionGroup/SelectBillingInfoActionGroup.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<actionGroup name="SelectBillingInfoActionGroup">
1212
<waitForPageLoad stepKey="waitForBillingInfoPageLoad"/>
13-
<click stepKey="goToReviewOrder" selector="{{PaymentMethodSection.goToReviewOrder}}"/>
13+
<click selector="{{PaymentMethodSection.goToReviewOrder}}" stepKey="goToReviewOrder"/>
1414
</actionGroup>
15-
</actionGroups>
15+
</actionGroups>

0 commit comments

Comments
 (0)