/**
  * Run test add products to shopping cart
  *
  * @param string $products
  * @param int $deletedProductIndex
  * @return array
  */
 public function test($products, $deletedProductIndex)
 {
     // Preconditions
     $products = $this->prepareProducts($products);
     $this->cartPage->open();
     $this->cartPage->getCartBlock()->clearShoppingCart();
     // Steps
     $this->addToCart($products);
     $this->cartPage->getMessagesBlock()->waitSuccessMessage();
     $this->removeProduct($products[$deletedProductIndex]);
     $deletedProduct = $products[$deletedProductIndex];
     unset($products[$deletedProductIndex]);
     return ['products' => $products, 'deletedProduct' => $deletedProduct];
 }
 /**
  * Assert that success message is correct.
  *
  * @param CheckoutCart $checkoutCart
  */
 public function processAssert(CheckoutCart $checkoutCart)
 {
     \PHPUnit_Framework_Assert::assertEquals(self::SUCCESS_MESSAGE, $checkoutCart->getMessagesBlock()->getSuccessMessage(), 'Success message about Express Checkout cancellation is not present or wrong.');
 }
 /**
  * Assert success message is appeared on Shopping Cart page
  *
  * @param CheckoutCart $checkoutCart
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CheckoutCart $checkoutCart, FixtureInterface $product)
 {
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::SUCCESS_MESSAGE, $product->getName()), $checkoutCart->getMessagesBlock()->getSuccessMessage());
 }