Skip to content

Commit b9034c1

Browse files
committed
Merge remote-tracking branch 'mavericks/MTA-3787' into develop
Conflicts: dev/tests/functional/tests/app/Magento/Braintree/Test/Repository/ConfigData.xml dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php
2 parents 66cf895 + b8cc80d commit b9034c1

File tree

6 files changed

+83
-17
lines changed

6 files changed

+83
-17
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@
204204
</dataset>
205205

206206
<dataset name="braintree_paypal_sale">
207+
<field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
208+
<item name="scope" xsi:type="string">payment</item>
209+
<item name="scope_id" xsi:type="number">1</item>
210+
<item name="label" xsi:type="string">Yes</item>
211+
<item name="value" xsi:type="number">1</item>
212+
</field>
207213
<field name="payment/braintree_section/braintree/braintree_paypal/payment_action" xsi:type="array">
208214
<item name="scope" xsi:type="string">payment</item>
209215
<item name="scope_id" xsi:type="number">1</item>
@@ -212,6 +218,15 @@
212218
</field>
213219
</dataset>
214220

221+
<dataset name="braintree_paypal_sale_rollback">
222+
<field name="payment/braintree_section/braintree/active_braintree_paypal" xsi:type="array">
223+
<item name="scope" xsi:type="string">payment</item>
224+
<item name="scope_id" xsi:type="number">1</item>
225+
<item name="label" xsi:type="string">No</item>
226+
<item name="value" xsi:type="number">0</item>
227+
</field>
228+
</dataset>
229+
215230
<dataset name="braintree_paypal_skip_order_review">
216231
<field name="payment/braintree_section/braintree/braintree_paypal/skip_order_review" xsi:type="array">
217232
<item name="scope" xsi:type="string">payment</item>

dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Checkout\Test\Block\Onepage;
77

88
use Magento\Checkout\Test\Fixture\Checkout;
9+
use Magento\Customer\Test\Fixture\Customer;
910
use Magento\Mtf\Block\Form;
1011
use Magento\Mtf\Fixture\FixtureInterface;
1112

@@ -93,14 +94,15 @@ public function loginCustomer(FixtureInterface $customer)
9394
/**
9495
* Fill required fields for guest checkout.
9596
*
96-
* @param FixtureInterface $customer
97+
* @param Customer $customer
9798
* @return void
9899
*/
99-
public function fillGuestFields(FixtureInterface $customer)
100+
public function fillGuestFields(Customer $customer)
100101
{
101102
$mapping = $this->dataMapping();
102103
$this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy'])
103104
->setValue($customer->getEmail());
105+
$this->waitForElementNotVisible($this->loadingMask);
104106
}
105107

106108
/**

dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,36 +51,26 @@ class SelectCheckoutMethodStep implements TestStepInterface
5151
*/
5252
private $clickProceedToCheckoutStep;
5353

54-
/**
55-
* Shipping carrier and method.
56-
*
57-
* @var array
58-
*/
59-
protected $shipping;
60-
6154
/**
6255
* @constructor
6356
* @param CheckoutOnepage $checkoutOnepage
6457
* @param Customer $customer
6558
* @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend
6659
* @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep
6760
* @param string $checkoutMethod
68-
* @param array $shipping
6961
*/
7062
public function __construct(
7163
CheckoutOnepage $checkoutOnepage,
7264
Customer $customer,
7365
LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend,
7466
ClickProceedToCheckoutStep $clickProceedToCheckoutStep,
75-
$checkoutMethod,
76-
array $shipping = []
67+
$checkoutMethod
7768
) {
7869
$this->checkoutOnepage = $checkoutOnepage;
7970
$this->customer = $customer;
8071
$this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend;
8172
$this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep;
8273
$this->checkoutMethod = $checkoutMethod;
83-
$this->shipping = $shipping;
8474
}
8575

8676
/**
@@ -98,9 +88,7 @@ public function run()
9888
$this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer);
9989
}
10090
} elseif ($this->checkoutMethod === 'guest') {
101-
if (empty($this->shipping)) {
102-
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
103-
}
91+
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
10492
}
10593
}
10694

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/View/Tab/Invoices/Grid.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Invoices grid on order view page.
1111
*/
12-
class Grid extends \Magento\Backend\Test\Block\Widget\Grid
12+
class Grid extends \Magento\Ui\Test\Block\Adminhtml\DataGrid
1313
{
1414
/**
1515
* Locator value for link in action column.
@@ -34,6 +34,9 @@ class Grid extends \Magento\Backend\Test\Block\Widget\Grid
3434
'id' => [
3535
'selector' => 'input[name="increment_id"]',
3636
],
37+
'order_id' => [
38+
'selector' => 'input[name="order_increment_id"]',
39+
],
3740
'status' => [
3841
'selector' => 'select[name="state"]',
3942
'input' => 'select',
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Constraint;
8+
9+
use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
10+
use Magento\Mtf\Constraint\AbstractConstraint;
11+
12+
/**
13+
* Assert invoice status on order page in Admin.
14+
*/
15+
class AssertInvoiceStatusInOrdersGrid extends AbstractConstraint
16+
{
17+
/**
18+
* Assert invoice status on order page in Admin.
19+
*
20+
* @param SalesOrderView $salesOrderView
21+
* @param string $invoiceStatus
22+
* @param string $orderId
23+
* @return void
24+
*/
25+
public function processAssert(
26+
SalesOrderView $salesOrderView,
27+
$invoiceStatus,
28+
$orderId
29+
) {
30+
$salesOrderView->open(['order_id' => $orderId]);
31+
$salesOrderView->getOrderForm()->openTab('invoices');
32+
/** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Invoices\Grid $grid */
33+
$grid = $salesOrderView->getOrderForm()->getTab('invoices')->getGridBlock();
34+
$filter = [
35+
'order_id' => $orderId,
36+
'status' => $invoiceStatus,
37+
];
38+
\PHPUnit_Framework_Assert::assertTrue(
39+
$grid->isRowVisible($filter),
40+
'Invoice status is incorrect.'
41+
);
42+
}
43+
44+
/**
45+
* Returns a string representation of the object.
46+
*
47+
* @return string
48+
*/
49+
public function toString()
50+
{
51+
return 'Invoice status is correct.';
52+
}
53+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<argument name="severity" xsi:type="string">S0</argument>
1212
</arguments>
1313
</type>
14+
<type name="Magento\Sales\Test\Constraint\AssertInvoiceStatusInOrdersGrid">
15+
<arguments>
16+
<argument name="severity" xsi:type="string">S1</argument>
17+
</arguments>
18+
</type>
1419
<type name="Magento\Sales\Test\Constraint\AssertOrderStatusDuplicateStatus">
1520
<arguments>
1621
<argument name="severity" xsi:type="string">S0</argument>

0 commit comments

Comments
 (0)