/** * Delete Catalog Price Rule test. * * @param CatalogRule $catalogPriceRule * @return void */ public function test(CatalogRule $catalogPriceRule) { // Precondition $catalogPriceRule->persist(); $filter = ['name' => $catalogPriceRule->getName(), 'rule_id' => $catalogPriceRule->getId()]; // Steps $this->catalogRuleIndex->open(); $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); $this->catalogRuleEdit->getFormPageActions()->delete(); }
/** * Assert that Catalog Price Rule is not presented in grid and cannot be found using ID, Rule name. * * @param CatalogRule $catalogPriceRule * @param CatalogRuleIndex $catalogRuleIndex * @return void */ public function processAssert(CatalogRule $catalogPriceRule, CatalogRuleIndex $catalogRuleIndex) { $filter = ['rule_id' => $catalogPriceRule->getId(), 'name' => $catalogPriceRule->getName()]; $catalogRuleIndex->open(); \PHPUnit_Framework_Assert::assertFalse($catalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), "Catalog Price Rule {$filter['rule_id']} with name {$filter['name']} is present in Catalog Price Rule grid."); }