10 use Magento\Catalog\Test\Page\Category\CatalogCategoryView;
11 use Magento\Catalog\Test\Page\Product\CatalogProductView;
12 use Magento\Checkout\Test\Page\CheckoutCart;
13 use Magento\Cms\Test\Page\CmsIndex;
14 use Magento\Customer\Test\Fixture\Address;
16 use Magento\Customer\Test\Page\CustomerAccountLogin;
18 use Magento\Mtf\Constraint\AbstractConstraint;
103 abstract protected function assert();
152 SalesRule $salesRuleOrigin,
153 array $productQuantity,
160 array $shipping = [],
175 $isLoggedIn ? $this->
login() : $this->customerAccountLogout->open();
176 $this->checkoutCart->open()->getCartBlock()->clearShoppingCart();
178 $this->checkoutCart->open();
180 $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax(
$address);
181 $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping);
186 }
elseif ($salesRuleOrigin->getCouponCode()) {
191 $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode(
$couponCode);
203 $this->objectManager->create(
204 \
Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
205 [
'customer' => $this->customer]
217 foreach ($productQuantity as
$product => $quantity) {
219 $categoryName = $this->
$product->getCategoryIds()[0];
220 $this->cmsIndex->getTopmenu()->selectCategoryByName($categoryName);
221 $this->catalogCategoryView->getListProductBlock()->getProductItem($this->
$product)->open();
222 $this->catalogProductView->getViewBlock()->setQtyAndClickAddToCart($quantity);
223 $this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
elseif(isset( $params[ 'redirect_parent']))
addProductsToCart(array $productQuantity)
processAssert(CheckoutCart $checkoutCart, CmsIndex $cmsIndex, CustomerAccountLogin $customerAccountLogin, CustomerAccountLogout $customerAccountLogout, CatalogCategoryView $catalogCategoryView, CatalogProductView $catalogProductView, SalesRule $salesRule, SalesRule $salesRuleOrigin, array $productQuantity, CatalogProductSimple $productForSalesRule1, CatalogProductSimple $productForSalesRule2=null, Customer $customer=null, Address $address=null, $isLoggedIn=null, $couponCode=null, array $shipping=[], array $cartPrice=[])