Skip to content

Commit 3d098bb

Browse files
committed
Merge remote-tracking branch 'github-magento2ce/MAGETWO-98947' into EPAM-PR-51
2 parents c224526 + 153591c commit 3d098bb

File tree

9 files changed

+289
-123
lines changed

9 files changed

+289
-123
lines changed

app/code/Magento/Ups/Model/Carrier.php

Lines changed: 173 additions & 122 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ShippingMethodsUpsTypeSetDefault" type="shipping_methods_ups_type_config">
12+
<requiredEntity type="ups_type_inherit">ShippingMethodsUpsTypeDefault</requiredEntity>
13+
</entity>
14+
<entity name="ShippingMethodsUpsTypeDefault" type="ups_type_inherit">
15+
<data key="inherit">true</data>
16+
</entity>
17+
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
10+
<operation name="ShippingMethodsUpsTypeConfig" dataType="shipping_methods_ups_type_config" type="create" auth="adminFormKey" url="admin/system_config/save/section/carriers/" method="POST">
11+
<object key="groups" dataType="shipping_methods_ups_type_config">
12+
<object key="ups" dataType="shipping_methods_ups_type_config">
13+
<object key="fields" dataType="shipping_methods_ups_type_config">
14+
<object key="type" dataType="ups_type_inherit">
15+
<field key="inherit">boolean</field>
16+
</object>
17+
</object>
18+
</object>
19+
</object>
20+
</operation>
21+
</operations>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminShippingMethodsConfigPage" url="admin/system_config/edit/section/carriers/" area="admin" module="Magento_Ups">
12+
<section name="AdminShippingMethodsUpsSection"/>
13+
</page>
14+
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminShippingMethodsUpsSection">
12+
<element name="carriersUpsTab" type="button" selector="#carriers_ups-head"/>
13+
<element name="carriersUpsType" type="select" selector="#carriers_ups_type"/>
14+
<element name="selectedUpsType" type="text" selector="#carriers_ups_type option[selected]"/>
15+
</section>
16+
</sections>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="DefaultConfigForUPSTypeTest">
11+
<annotations>
12+
<title value="Default Configuration for UPS Type"/>
13+
<description value="Default Configuration for UPS Type"/>
14+
<features value="Ups"/>
15+
<severity value="MAJOR"/>
16+
<testCaseId value="MAGETWO-99012"/>
17+
<useCaseId value="MAGETWO-98947"/>
18+
<group value="ups"/>
19+
</annotations>
20+
<before>
21+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
22+
</before>
23+
<after>
24+
<!--Collapse UPS tab and logout-->
25+
<comment userInput="Collapse UPS tab and logout" stepKey="collapseTabAndLogout"/>
26+
<click selector="{{AdminShippingMethodsUpsSection.carriersUpsTab}}" stepKey="collapseTab"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
</after>
29+
<!-- Set shipping methods UPS type to default -->
30+
<comment userInput="Set shipping methods UPS type to default" stepKey="setToDefaultShippingMethodsUpsType"/>
31+
<createData entity="ShippingMethodsUpsTypeSetDefault" stepKey="setShippingMethodsUpsTypeToDefault"/>
32+
<!-- Navigate to Stores -> Configuration -> Sales -> Shipping Methods Page -->
33+
<comment userInput="Navigate to Stores -> Configuration -> Sales -> Shipping Methods Page" stepKey="goToAdminShippingMethodsPage"/>
34+
<amOnPage url="{{AdminShippingMethodsConfigPage.url}}" stepKey="navigateToAdminShippingMethodsPage"/>
35+
<waitForPageLoad stepKey="waitPageToLoad"/>
36+
<!-- Expand 'UPS' tab -->
37+
<comment userInput="Expand UPS tab" stepKey="expandUpsTab"/>
38+
<conditionalClick selector="{{AdminShippingMethodsUpsSection.carriersUpsTab}}" dependentSelector="{{AdminShippingMethodsUpsSection.carriersUpsType}}" visible="false" stepKey="expandTab"/>
39+
<waitForElementVisible selector="{{AdminShippingMethodsUpsSection.carriersUpsType}}" stepKey="waitTabToExpand"/>
40+
<!-- Assert that selected UPS type by default is 'United Parcel Service XML' -->
41+
<comment userInput="Check that selected UPS type by default is 'United Parcel Service XML'" stepKey="assertDefUpsType"/>
42+
<grabTextFrom selector="{{AdminShippingMethodsUpsSection.selectedUpsType}}" stepKey="grabSelectedOptionText"/>
43+
<assertEquals expected='United Parcel Service XML' expectedType="string" actual="($grabSelectedOptionText)" stepKey="assertDefaultUpsType"/>
44+
</test>
45+
</tests>

app/code/Magento/Ups/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<negotiated_active>0</negotiated_active>
3838
<include_taxes>0</include_taxes>
3939
<mode_xml>1</mode_xml>
40-
<type>UPS</type>
40+
<type>UPS_XML</type>
4141
<is_account_live>0</is_account_live>
4242
<active_rma>0</active_rma>
4343
<is_online>1</is_online>

dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
$configWriter = $objectManager->get(WriterInterface::class);
1616

1717
$configWriter->save('carriers/ups/active', 1);
18+
$configWriter->save('carriers/ups/type', "UPS");
1819

1920
$scopeConfig = $objectManager->get(ScopeConfigInterface::class);
2021
$scopeConfig->clean();

dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method_rollback.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
$configWriter = $objectManager->create(WriterInterface::class);
1515

1616
$configWriter->delete('carriers/ups/active');
17+
$configWriter->delete('carriers/ups/type');

0 commit comments

Comments
 (0)