Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductSkuAutoGenerated.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Page\Adminhtml\CatalogProductIndex;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 use Magento\Mtf\Fixture\FixtureInterface;
12 
16 class AssertProductSkuAutoGenerated extends AbstractConstraint
17 {
25  public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid)
26  {
27  $filter = ['sku' => $product->getName()];
28  $productGrid->open();
29  \PHPUnit\Framework\Assert::assertTrue(
30  $productGrid->getProductGrid()->isRowVisible($filter),
31  'SKU is not automatically generated for a product.'
32  );
33  }
34 
40  public function toString()
41  {
42  return 'Sku successfully generated.';
43  }
44 }
processAssert(FixtureInterface $product, CatalogProductIndex $productGrid)