10 use Magento\Catalog\Test\Page\Product\CatalogProductView;
12 use Magento\Checkout\Test\Page\CheckoutCart;
13 use Magento\Mtf\Client\BrowserInterface;
14 use Magento\Mtf\Fixture\FixtureFactory;
15 use Magento\Mtf\TestCase\Injectable;
105 $this->checkoutCart->open();
106 $this->checkoutCart->getCartBlock()->clearShoppingCart();
109 $this->browser->open($_ENV[
'app_frontend_url'] .
$product->getUrlKey() .
'.html');
110 $productView = $this->catalogProductView->getViewBlock();
111 $productView->fillOptions(
$product);
112 $productView->setQty(
$product->getCheckoutData()[
'qty']);
113 $productView->clickAddToCart();
114 $this->catalogProductView->getMessagesBlock()->waitSuccessMessage();
116 $qty =
$product->getCheckoutData()[
'qty'];
117 $this->checkoutCart->open();
118 $this->checkoutCart->getCartBlock()->getCartItem(
$product)->setQty($qty);
119 $this->checkoutCart->getCartBlock()->updateShoppingCart();
122 return [
'cart' => $this->fixtureFactory->createByCode(
'cart',
$cart)];