diff --git a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php index cae85fea49c4579d701229e1153e4ad4f912816c..d61e2fff6337a4ddc3c616bd9dbc1ad2c8e0540e 100644 --- a/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php +++ b/dev/tests/functional/tests/app/Magento/Braintree/Test/TestStep/PlaceOrderWithPaypalStep.php @@ -10,7 +10,6 @@ use Magento\Checkout\Test\Constraint\AssertBillingAddressAbsentInPayment; use Magento\Checkout\Test\Page\CheckoutOnepage; use Magento\Checkout\Test\Page\CheckoutOnepageSuccess; use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Customer\Test\Fixture\Customer; use Magento\Mtf\TestStep\TestStepInterface; /** @@ -53,39 +52,14 @@ class PlaceOrderWithPaypalStep implements TestStepInterface */ private $products; - /** - * Customer fixture. - * - * @var Customer - */ - protected $customer; - - /** - * Checkout method. - * - * @var string - */ - protected $checkoutMethod; - - /** - * Shipping carrier and method. - * - * @var array - */ - protected $shipping; - /** * @param CheckoutOnepage $checkoutOnepage * @param AssertGrandTotalOrderReview $assertGrandTotalOrderReview * @param AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment * @param CheckoutOnepageSuccess $checkoutOnepageSuccess * @param FixtureFactory $fixtureFactory - * @param Customer $customer - * @param string $checkoutMethod * @param array $products * @param array $prices - * @param array $shipping - * */ public function __construct( CheckoutOnepage $checkoutOnepage, @@ -93,24 +67,16 @@ class PlaceOrderWithPaypalStep implements TestStepInterface AssertBillingAddressAbsentInPayment $assertBillingAddressAbsentInPayment, CheckoutOnepageSuccess $checkoutOnepageSuccess, FixtureFactory $fixtureFactory, - Customer $customer = null, - $checkoutMethod, - array $products, - array $prices = [], - array $shipping = [] - + array $prices = [] ) { $this->checkoutOnepage = $checkoutOnepage; $this->assertGrandTotalOrderReview = $assertGrandTotalOrderReview; $this->assertBillingAddressAbsentInPayment = $assertBillingAddressAbsentInPayment; $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; $this->fixtureFactory = $fixtureFactory; - $this->customer = $customer; - $this->checkoutMethod = $checkoutMethod; $this->products = $products; $this->prices = $prices; - $this->shipping = $shipping; } /** @@ -124,10 +90,6 @@ class PlaceOrderWithPaypalStep implements TestStepInterface $this->assertBillingAddressAbsentInPayment->processAssert($this->checkoutOnepage); - if ($this->checkoutMethod === 'guest' && empty($this->shipping)) { - $this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer); - } - $parentWindow = $this->checkoutOnepage->getPaymentBlock() ->getSelectedPaymentMethodBlock() ->clickPayWithPaypal(); diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php index fe1eda337581a686f6a7df5ef609960bf7f9e699..49b900e4eedce313df7809a574e150f3c63c4787 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/Block/Onepage/Login.php @@ -99,7 +99,8 @@ class Login extends Form public function fillGuestFields(FixtureInterface $customer) { $mapping = $this->dataMapping(); - $this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy'])->setValue($customer->getEmail()); + $this->_rootElement->find($mapping['email']['selector'], $mapping['email']['strategy']) + ->setValue($customer->getEmail()); } /** diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php index 444b98adb7f836b140a52d6c3644b6ee9e7c3c72..eef5f2fbdd03a9b7325b01aa8b5d4293e566ffbb 100644 --- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/SelectCheckoutMethodStep.php @@ -51,6 +51,13 @@ class SelectCheckoutMethodStep implements TestStepInterface */ private $clickProceedToCheckoutStep; + /** + * Shipping carrier and method. + * + * @var array + */ + protected $shipping; + /** * @constructor * @param CheckoutOnepage $checkoutOnepage @@ -58,19 +65,22 @@ class SelectCheckoutMethodStep implements TestStepInterface * @param LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend * @param ClickProceedToCheckoutStep $clickProceedToCheckoutStep * @param string $checkoutMethod + * @param array $shipping */ public function __construct( CheckoutOnepage $checkoutOnepage, Customer $customer, LogoutCustomerOnFrontendStep $logoutCustomerOnFrontend, ClickProceedToCheckoutStep $clickProceedToCheckoutStep, - $checkoutMethod + $checkoutMethod, + array $shipping = [] ) { $this->checkoutOnepage = $checkoutOnepage; $this->customer = $customer; $this->logoutCustomerOnFrontend = $logoutCustomerOnFrontend; $this->clickProceedToCheckoutStep = $clickProceedToCheckoutStep; $this->checkoutMethod = $checkoutMethod; + $this->shipping = $shipping; } /** @@ -87,6 +97,10 @@ class SelectCheckoutMethodStep implements TestStepInterface } else { $this->checkoutOnepage->getLoginBlock()->loginCustomer($this->customer); } + } elseif ($this->checkoutMethod === 'guest') { + if (empty($this->shipping)) { + $this->checkoutOnepage->getLoginBlock()->fillGuestFields($this->customer); + } } }