/** * Check that clicking "Place order" without setting checkbox for agreement will result in error message displayed * under condition. * * @param MultishippingCheckoutOverview $page * @param TestStepFactory $stepFactory * @param array $products * @param array $payment * @param array $shipping * @return void */ public function processAssert(MultishippingCheckoutOverview $page, TestStepFactory $stepFactory, $products, $payment, $shipping) { $customer = ['customer' => ['dataset' => 'johndoe_with_multiple_addresses']]; $customer = $stepFactory->create('\\Magento\\Customer\\Test\\TestStep\\CreateCustomerStep', $customer)->run(); $products = $stepFactory->create('\\Magento\\Catalog\\Test\\TestStep\\CreateProductsStep', ['products' => $products])->run(); $stepFactory->create('\\Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', $customer)->run(); $stepFactory->create('\\Magento\\Checkout\\Test\\TestStep\\AddProductsToTheCartStep', $products)->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\ProceedToMultipleAddressCheckoutStep')->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\FillCustomerAddressesStep', array_merge($products, $customer))->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\FillShippingInformationStep', array_merge(['shippingMethod' => $shipping], $customer))->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\SelectPaymentMethodStep', ['payment' => $payment])->run(); $stepFactory->create('\\Magento\\CheckoutAgreements\\Test\\TestStep\\CheckTermOnMultishippingStep', ['agreementValue' => 'No'])->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\PlaceOrderStep')->run(); \PHPUnit_Framework_Assert::assertEquals(self::NOTIFICATION_MESSAGE, $page->getAgreementReview()->getNotificationMassage(), 'Notification required message of Terms and Conditions is absent.'); $stepFactory->create('\\Magento\\CheckoutAgreements\\Test\\TestStep\\CheckTermOnMultishippingStep', ['agreementValue' => 'Yes'])->run(); $stepFactory->create('\\Magento\\Multishipping\\Test\\TestStep\\PlaceOrderStep')->run(); }
/** * Process Terms and Conditions checkbox on multiple addresses checkout overview step. * * @return void */ public function run() { $this->multishippingCheckoutOverview->getAgreementReview()->setAgreement($this->agreementValue); }
/** * Place order with multiple addresses checkout. * * @return void */ public function run() { $this->multishippingCheckoutOverview->getOverviewBlock()->placeOrder(); }