/** * Assert that product attribute can be used on promo rules conditions. * * @param CatalogRuleIndex $catalogRuleIndex * @param CatalogRuleNew $catalogRuleNew * @param CatalogProductAttribute $attribute * @return void */ public function processAssert(CatalogRuleIndex $catalogRuleIndex, CatalogRuleNew $catalogRuleNew, CatalogProductAttribute $attribute) { $catalogRuleIndex->open(); $catalogRuleIndex->getGridPageActions()->addNew(); $catalogRuleNew->getEditForm()->openTab('conditions'); \PHPUnit_Framework_Assert::assertTrue($catalogRuleNew->getEditForm()->isAttributeInConditions($attribute->getFrontendLabel()), 'Product attribute can\'t be used on promo rules conditions.'); }
/** * Assert that product attribute can be used on promo rules conditions. * * @param CatalogRuleIndex $catalogRuleIndex * @param CatalogRuleNew $catalogRuleNew * @param CatalogProductAttribute $attribute * @return void */ public function processAssert(CatalogRuleIndex $catalogRuleIndex, CatalogRuleNew $catalogRuleNew, CatalogProductAttribute $attribute) { $catalogRuleIndex->open(); $catalogRuleIndex->getGridPageActions()->addNew(); $catalogRuleNew->getEditForm()->openSection('conditions'); /** @var Conditions $conditionsSection */ $conditionsSection = $catalogRuleNew->getEditForm()->getSection('conditions'); \PHPUnit_Framework_Assert::assertTrue($conditionsSection->isAttributeInConditions($attribute), 'Product attribute can\'t be used on promo rules conditions.'); }
/** * Assert that customer group find on catalog price rule page. * * @param CatalogRuleIndex $catalogRuleIndex * @param CatalogRuleNew $catalogRuleNew * @param CustomerGroup $customerGroup * @return void */ public function processAssert(CatalogRuleIndex $catalogRuleIndex, CatalogRuleNew $catalogRuleNew, CustomerGroup $customerGroup) { $catalogRuleIndex->open(); $catalogRuleIndex->getGridPageActions()->addNew(); $catalogRuleNew->getEditForm()->openTab('rule_information'); /** @var RuleInformation $ruleInformationTab */ $ruleInformationTab = $catalogRuleNew->getEditForm()->getTab('rule_information'); \PHPUnit_Framework_Assert::assertTrue($ruleInformationTab->isVisibleCustomerGroup($customerGroup), "Customer group {$customerGroup->getCustomerGroupCode()} not in catalog price rule page."); }