Skip to content

Commit ff2bd6e

Browse files
committed
Merge remote-tracking branch 'remotes/origin/MAGETWO-69112' into MPI-PR-Bugfixes
2 parents 99da6e2 + 6de30cd commit ff2bd6e

File tree

6 files changed

+151
-14
lines changed

6 files changed

+151
-14
lines changed

app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
140140
*/
141141
order.addExcludedPaymentMethod('<?php /* @noEscape */ echo $code; ?>');
142142

143-
<?php if (!$block->isAjaxRequest()): ?>
144-
document.observe('dom:loaded', function(){
145-
<?php endif; ?>
146-
147143
directPostModel = new directPost(
148144
'<?php /* @noEscape */ echo $code; ?>',
149145
'directpost-iframe',
@@ -153,9 +149,5 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
153149
'<?php echo $block->escapeUrl($block->getUrl('*/*/save', [
154150
'_secure' => $block->getRequest()->isSecure()
155151
]));?>');
156-
157-
<?php if (!$block->isAjaxRequest()): ?>
158-
});
159-
<?php endif; ?>
160152
});
161153
</script>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
9+
<testCase name="Magento\Sales\Test\TestCase\ReorderOrderEntityTest" summary="Reorder Order from Admin using Authorize.Net Direct Post payment method." ticketId="MAGETWO-69939">
10+
<variation name="ReorderOrderEntityAuthorizenetTestVariation1">
11+
<data name="tag" xsi:type="string">test_type:3rd_party_test, severity:S2</data>
12+
<data name="description" xsi:type="string">Reorder placed order using Authorize.Net payment method (update products, billing address).</data>
13+
<data name="order/dataset" xsi:type="string">default</data>
14+
<data name="customer/dataset" xsi:type="string">default</data>
15+
<data name="billingAddress/dataset" xsi:type="string">US_address_1_without_email</data>
16+
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
17+
<data name="shipping/shipping_method" xsi:type="string">Fixed</data>
18+
<data name="prices" xsi:type="array">
19+
<item name="grandTotal" xsi:type="string">565.00</item>
20+
</data>
21+
<data name="payment/method" xsi:type="string">authorizenet_directpost</data>
22+
<data name="configData" xsi:type="string">authorizenet</data>
23+
<data name="creditCard/dataset" xsi:type="string">visa_default_admin</data>
24+
<data name="previousOrderStatus" xsi:type="string">Processing</data>
25+
<data name="status" xsi:type="string">Processing</data>
26+
<data name="orderButtonsAvailable" xsi:type="string">Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit</data>
27+
<constraint name="Magento\Sales\Test\Constraint\AssertOrderSuccessCreateMessage" />
28+
<constraint name="Magento\Sales\Test\Constraint\AssertReorderStatusIsCorrect" />
29+
<constraint name="Magento\Sales\Test\Constraint\AssertOrderButtonsAvailable" />
30+
<constraint name="Magento\Sales\Test\Constraint\AssertOrderGrandTotal" />
31+
</variation>
32+
</testCase>
33+
</config>

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class ReorderOrderEntityTest extends Scenario
2828
{
2929
/* tags */
3030
const MVP = 'yes';
31+
const TEST_TYPE = '3rd_party_test';
32+
const SEVERITY = 'S2';
3133
/* end tags */
3234

3335
/**

dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/ReorderOrderEntityTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Sales\Test\TestCase\ReorderOrderEntityTest" summary="Reorder Order from Admin for Offline Payment Methods" ticketId="MAGETWO-29007">
1010
<variation name="ReorderOrderEntityTestVariation1">
11-
<data name="tag" xsi:type="string">to_maintain:yes</data>
1211
<data name="description" xsi:type="string">Reorder placed order (update products, billing address).</data>
1312
<data name="order/dataset" xsi:type="string">two_simple_product</data>
1413
<data name="salesRule" xsi:type="string">active_sales_rule_with_fixed_price_discount_coupon</data>
@@ -17,7 +16,7 @@
1716
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
1817
<data name="shipping/shipping_method" xsi:type="string">Fixed</data>
1918
<data name="prices" xsi:type="array">
20-
<item name="grandTotal" xsi:type="string">1,030.00</item>
19+
<item name="grandTotal" xsi:type="string">1030.00</item>
2120
</data>
2221
<data name="payment/method" xsi:type="string">checkmo</data>
2322
<data name="previousOrderStatus" xsi:type="string">Pending</data>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\TestStep;
8+
9+
use Magento\Customer\Test\Fixture\Address;
10+
use Magento\Customer\Test\Fixture\Customer;
11+
use Magento\Mtf\Fixture\FixtureFactory;
12+
use Magento\Mtf\TestStep\TestStepInterface;
13+
use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex;
14+
use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
15+
16+
/**
17+
* Submit Order without additional info step.
18+
*/
19+
class SubmitOrderWithoutAdditionalInfoStep implements TestStepInterface
20+
{
21+
/**
22+
* Sales order create index page.
23+
*
24+
* @var OrderCreateIndex
25+
*/
26+
private $orderCreateIndex;
27+
28+
/**
29+
* Sales order view.
30+
*
31+
* @var SalesOrderView
32+
*/
33+
private $salesOrderView;
34+
35+
/**
36+
* Factory for fixtures.
37+
*
38+
* @var FixtureFactory
39+
*/
40+
private $fixtureFactory;
41+
42+
/**
43+
* Customer fixture.
44+
*
45+
* @var Customer
46+
*/
47+
private $customer;
48+
49+
/**
50+
* Billing Address fixture.
51+
*
52+
* @var Address
53+
*/
54+
private $billingAddress;
55+
56+
/**
57+
* Products fixtures.
58+
*
59+
* @var array|\Magento\Mtf\Fixture\FixtureInterface[]
60+
*/
61+
private $products;
62+
63+
/**
64+
* @param OrderCreateIndex $orderCreateIndex
65+
* @param SalesOrderView $salesOrderView
66+
* @param FixtureFactory $fixtureFactory
67+
* @param Customer $customer
68+
* @param \Magento\Mtf\Fixture\FixtureInterface[] $products
69+
* @param Address|null $billingAddress
70+
*/
71+
public function __construct(
72+
OrderCreateIndex $orderCreateIndex,
73+
SalesOrderView $salesOrderView,
74+
FixtureFactory $fixtureFactory,
75+
Customer $customer,
76+
array $products,
77+
Address $billingAddress = null
78+
) {
79+
$this->orderCreateIndex = $orderCreateIndex;
80+
$this->salesOrderView = $salesOrderView;
81+
$this->fixtureFactory = $fixtureFactory;
82+
$this->customer = $customer;
83+
$this->billingAddress = $billingAddress;
84+
$this->products = $products;
85+
}
86+
87+
/**
88+
* Fill Sales Data.
89+
*
90+
* @return array
91+
*/
92+
public function run()
93+
{
94+
$this->orderCreateIndex->getCreateBlock()->submitOrder();
95+
$this->salesOrderView->getMessagesBlock()->waitSuccessMessage();
96+
$orderId = trim($this->salesOrderView->getTitleBlock()->getTitle(), '#');
97+
$order = $this->fixtureFactory->createByCode(
98+
'orderInjectable',
99+
[
100+
'data' => [
101+
'id' => $orderId,
102+
'customer_id' => ['customer' => $this->customer],
103+
'entity_id' => ['products' => $this->products],
104+
'billing_address_id' => ['billingAddress' => $this->billingAddress],
105+
]
106+
]
107+
);
108+
109+
return ['orderId' => $orderId, 'order' => $order];
110+
}
111+
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<step name="openOrder" module="Magento_Sales" next="reorder" />
1313
<step name="reorder" module="Magento_Sales" next="fillBillingAddress" />
1414
<step name="fillBillingAddress" module="Magento_Sales" next="fillShippingAddress" />
15-
<step name="fillShippingAddress" module="Magento_Sales" next="selectPaymentMethodForOrder" />
16-
<step name="selectPaymentMethodForOrder" module="Magento_Sales" next="selectShippingMethodForOrder" />
17-
<step name="selectShippingMethodForOrder" module="Magento_Sales" next="submitOrder" />
18-
<step name="submitOrder" module="Magento_Sales" />
15+
<step name="fillShippingAddress" module="Magento_Sales" next="selectShippingMethodForOrder" />
16+
<step name="selectShippingMethodForOrder" module="Magento_Sales" next="selectPaymentMethodForOrder" />
17+
<step name="selectPaymentMethodForOrder" module="Magento_Sales" next="submitOrderWithoutAdditionalInfo" />
18+
<step name="submitOrderWithoutAdditionalInfo" module="Magento_Sales" />
1919
</scenario>
2020
<scenario name="FrontendOrderPagerTest" firstStep="createOrder">
2121
<step name="createOrder" module="Magento_Sales" />

0 commit comments

Comments
 (0)