/** * Select how to perform checkout whether guest or registered customer * * @param FixtureInterface $fixture * @return void */ public function checkoutMethod(FixtureInterface $fixture) { /** @var Checkout $fixture */ if ($fixture->isRegisteredCustomer()) { $this->loginCustomer($fixture->getCustomer()); } elseif ($fixture->getCustomer()) { $this->registerCustomer(); $this->clickContinue(); } else { $this->guestCheckout(); $this->clickContinue(); } }
/** * Execute handler * * @param FixtureInterface $fixture [optional] * @return mixed */ public function persist(FixtureInterface $fixture = null) { /** @var \Magento\Customer\Test\Fixture\Address $fixture */ // Pages $loginPage = Factory::getPageFactory()->getCustomerAccountLogin(); $addressPage = Factory::getPageFactory()->getCustomerAddressEdit(); $loginPage->open(); if ($loginPage->getLoginBlock()->isVisible()) { $loginPage->getLoginBlock()->login($fixture->getCustomer()); } $addressPage->open(); $addressPage->getEditForm()->editCustomerAddress($fixture); }