Skip to content

Commit 690cd60

Browse files
committed
Merge branch 'MAGETWO-60572' into MAGETWO-60453
2 parents c14c46c + 4aa3ccf commit 690cd60

File tree

3 files changed

+18
-41
lines changed

3 files changed

+18
-41
lines changed

dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\Checkout\Test\Page\CheckoutOnepage;
1111
use Magento\Checkout\Test\Page\CheckoutOnepageSuccess;
1212
use Magento\Mtf\Fixture\FixtureFactory;
13-
use Magento\Customer\Test\Fixture\Customer;
1413
use Magento\Mtf\TestStep\TestStepInterface;
1514

1615
/**
@@ -53,64 +52,31 @@ class PlaceOrderWithPaypalStep implements TestStepInterface
5352
*/
5453
private $products;
5554

56-
/**
57-
* Customer fixture.
58-
*
59-
* @var Customer
60-
*/
61-
protected $customer;
62-
63-
/**
64-
* Checkout method.
65-
*
66-
* @var string
67-
*/
68-
protected $checkoutMethod;
69-
70-
/**
71-
* Shipping carrier and method.
72-
*
73-
* @var array
74-
*/
75-
protected $shipping;
76-
7755
/**
7856
* @param CheckoutOnepage $checkoutOnepage
7957
* @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview
8058
* @param AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment
8159
* @param CheckoutOnepageSuccess $checkoutOnepageSuccess
8260
* @param FixtureFactory $fixtureFactory
83-
* @param Customer $customer
84-
* @param string $checkoutMethod
8561
* @param array $products
8662
* @param array $prices
87-
* @param array $shipping
88-
*
8963
*/
9064
public function __construct(
9165
CheckoutOnepage $checkoutOnepage,
9266
AssertGrandTotalOrderReview $assertGrandTotalOrderReview,
9367
AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment,
9468
CheckoutOnepageSuccess $checkoutOnepageSuccess,
9569
FixtureFactory $fixtureFactory,
96-
Customer $customer = null,
97-
$checkoutMethod,
98-
9970
array $products,
100-
array $prices = [],
101-
array $shipping = []
102-
71+
array $prices = []
10372
) {
10473
$this->checkoutOnepage = $checkoutOnepage;
10574
$this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview;
10675
$this->assertBillingAddressAbsentInPayment = $assertBillingAddressAbsentInPayment;
10776
$this->checkoutOnepageSuccess = $checkoutOnepageSuccess;
10877
$this->fixtureFactory = $fixtureFactory;
109-
$this->customer = $customer;
110-
$this->checkoutMethod = $checkoutMethod;
11178
$this->products = $products;
11279
$this->prices = $prices;
113-
$this->shipping = $shipping;
11480
}
11581

11682
/**
@@ -124,10 +90,6 @@ public function run()
12490

12591
$this->assertBillingAddressAbsentInPayment->processAssert($this->checkoutOnepage);
12692

127-
if ($this->checkoutMethod === 'guest' && empty($this->shipping)) {
128-
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
129-
}
130-
13193
$parentWindow = $this->checkoutOnepage->getPaymentBlock()
13294
->getSelectedPaymentMethodBlock()
13395
->clickPayWithPaypal();

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public function loginCustomer(FixtureInterface $customer)
9999
public function fillGuestFields(FixtureInterface $customer)
100100
{
101101
$mapping = $this->dataMapping();
102-
$this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy'])->setValue($customer->getEmail());
102+
$this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy'])
103+
->setValue($customer->getEmail());
103104
}
104105

105106
/**

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

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

54+
/**
55+
* Shipping carrier and method.
56+
*
57+
* @var array
58+
*/
59+
protected $shipping;
60+
5461
/**
5562
* @constructor
5663
* @param CheckoutOnepage $checkoutOnepage
5764
* @param Customer $customer
5865
* @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend
5966
* @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep
6067
* @param string $checkoutMethod
68+
* @param array $shipping
6169
*/
6270
public function __construct(
6371
CheckoutOnepage $checkoutOnepage,
6472
Customer $customer,
6573
LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend,
6674
ClickProceedToCheckoutStep $clickProceedToCheckoutStep,
67-
$checkoutMethod
75+
$checkoutMethod,
76+
array $shipping = []
6877
) {
6978
$this->checkoutOnepage = $checkoutOnepage;
7079
$this->customer = $customer;
7180
$this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend;
7281
$this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep;
7382
$this->checkoutMethod = $checkoutMethod;
83+
$this->shipping = $shipping;
7484
}
7585

7686
/**
@@ -87,6 +97,10 @@ public function run()
8797
} else {
8898
$this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer);
8999
}
100+
} elseif ($this->checkoutMethod === 'guest') {
101+
if (empty($this->shipping)) {
102+
$this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer);
103+
}
90104
}
91105
}
92106

0 commit comments

Comments
 (0)