Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddCompareProductsTest.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Catalog\Test\Page\Product\CatalogProductCompare;
11 
29 {
30  /* tags */
31  const MVP = 'yes';
32  const TO_MAINTAIN = 'yes';
33  /* end tags */
34 
41 
51  public function test(
52  $products,
53  $isCustomerLoggedIn,
54  AssertProductCompareSuccessAddMessage $assertProductCompareSuccessAddMessage,
55  CatalogProductCompare $catalogProductCompare
56  ) {
57  //Steps
58  $this->catalogProductCompare = $catalogProductCompare;
59  $this->cmsIndex->open();
60  if ($isCustomerLoggedIn == 'Yes') {
61  $this->loginCustomer();
62  }
63  $this->products = $this->createProducts($products);
64  $this->addProducts($this->products, $assertProductCompareSuccessAddMessage);
65  $this->cmsIndex->getLinksBlock()->openLink("Compare Products");
66 
67  return ['products' => $this->products];
68  }
69 
75  public function tearDown()
76  {
77  $this->cmsIndex->open();
78  $this->cmsIndex->getLinksBlock()->openLink("Compare Products");
79  for ($i = 1; $i <= count($this->products); $i++) {
80  $this->catalogProductCompare->getCompareProductsBlock()->removeProduct();
81  }
82  }
83 }
test( $products, $isCustomerLoggedIn, AssertProductCompareSuccessAddMessage $assertProductCompareSuccessAddMessage, CatalogProductCompare $catalogProductCompare)
$i
Definition: gallery.phtml:31