Skip to content

Commit bd8629d

Browse files
author
Roman Liukshyn
committed
MTA-561: Re-factor Tests for Onepage Checkout with Online Shipping Carrier
1 parent 307c045 commit bd8629d

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

dev/tests/functional/tests/app/Magento/Checkout/Test/etc/testcase.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,18 @@
2020
<step name="selectPaymentMethod" module="Magento_Checkout" next="placeOrder"/>
2121
<step name="placeOrder" module="Magento_Checkout"/>
2222
</scenario>
23+
24+
<scenario name="OnePageCheckoutWithOnlineShippingMethodsTest" firstStep="setupConfiguration">
25+
<step name="setupConfiguration" module="Magento_Core" next="createProducts"/>
26+
<step name="createProducts" module="Magento_Catalog" next="addProductsToTheCart"/>
27+
<step name="addProductsToTheCart" module="Magento_Checkout" next="estimateShippingAndTax"/>
28+
<step name="estimateShippingAndTax" module="Magento_Checkout" next="proceedToCheckout"/>
29+
<step name="proceedToCheckout" module="Magento_Checkout" next="createCustomer"/>
30+
<step name="createCustomer" module="Magento_Customer" next="selectCheckoutMethod"/>
31+
<step name="selectCheckoutMethod" module="Magento_Checkout" next="fillBillingInformation"/>
32+
<step name="fillBillingInformation" module="Magento_Checkout" next="fillShippingMethod"/>
33+
<step name="fillShippingMethod" module="Magento_Checkout" next="selectPaymentMethod"/>
34+
<step name="selectPaymentMethod" module="Magento_Checkout" next="placeOrder"/>
35+
<step name="placeOrder" module="Magento_Checkout"/>
36+
</scenario>
2337
</config>

dev/tests/functional/tests/app/Magento/Core/Test/Handler/ConfigData/Curl.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,24 @@ protected function prepareConfigPath(array $input)
8080
$path = explode('/', $input['path']);
8181
foreach ($path as $position => $subPath) {
8282
if ($position === 0) {
83-
$resultArray.= $subPath;
83+
$resultArray .= $subPath;
8484
continue;
8585
} elseif ($position === (count($path) - 1)) {
86-
$resultArray.= '[fields]';
86+
$resultArray .= '[fields]';
8787
} else {
88-
$resultArray.= '[groups]';
88+
$resultArray .= '[groups]';
8989
}
90-
$resultArray.= '[' . $subPath .']';
90+
$resultArray .= '[' . $subPath . ']';
9191
}
92-
$resultArray.= '[value]';
92+
$resultArray .= '[value]';
9393
if (is_array($input['value'])) {
94-
$resultArray.= '[' . key($input['value']) . ']';
95-
$resultArray.= '=' . current($input['value']);
94+
$values = [];
95+
foreach ($input['value'] as $key => $value) {
96+
$values[] = $resultArray . "[$key]=$value";
97+
}
98+
$resultArray = implode('&', $values);
9699
} else {
97-
$resultArray.= '=' . $input['value'];
100+
$resultArray .= '=' . $input['value'];
98101
}
99102
return $resultArray;
100103
}

dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertOrderInOrdersGrid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function assert(OrderInjectable $order, OrderIndex $orderIndex, $statu
4848
];
4949
$errorMessage = implode(', ', $filter);
5050
\PHPUnit_Framework_Assert::assertTrue(
51-
$orderIndex->getSalesOrderGrid()->isRowVisible($filter),
51+
$orderIndex->getSalesOrderGrid()->isRowVisible(array_filter($filter)),
5252
'Order with following data \'' . $errorMessage . '\' is absent in Orders grid.'
5353
);
5454
}

dev/tests/functional/tests/app/Magento/Ups/Test/Repository/ConfigData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<field path="carriers/ups/password" scope="carriers" scope_id="1" label="" xsi:type="string">CARRIERS_UPS_PASSWORD</field>
2020
<field path="carriers/ups/username" scope="carriers" scope_id="1" label="" xsi:type="string">CARRIERS_UPS_USERNAME</field>
2121
<field path="carriers/ups/mode_xml" scope="carriers" scope_id="1" label="Development" xsi:type="string">0</field>
22-
<field path="carriers/ups/gateway_url" scope="carriers" scope_id="1" label="" xsi:type="string">https://wwwcie.ups.com/ups.app/xml/Rate</field>
22+
<field path="carriers/ups/gateway_xml_url" scope="carriers" scope_id="1" label="" xsi:type="string">https://wwwcie.ups.com/ups.app/xml/Rate</field>
2323
<field path="carriers/ups/origin_shipment" scope="carriers" scope_id="1" label="" xsi:type="string">Shipments Originating in United States</field>
2424
<field path="carriers/ups/access_license_number" scope="carriers" scope_id="1" label="" xsi:type="string">CARRIERS_UPS_ACCESS_LICENSE_NUMBER</field>
2525
<field path="carriers/ups/negotiated_active" scope="carriers" scope_id="1" label="No" xsi:type="string">0</field>

0 commit comments

Comments
 (0)