Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerGroupOnCartPriceRuleForm.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex;
13 use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew;
14 
18 class AssertCustomerGroupOnCartPriceRuleForm extends AbstractConstraint
19 {
28  public function processAssert(
29  PromoQuoteIndex $promoQuoteIndex,
30  PromoQuoteNew $promoQuoteNew,
31  CustomerGroup $customerGroup
32  ) {
33  $promoQuoteIndex->open();
34  $promoQuoteIndex->getGridPageActions()->addNew();
35  $promoQuoteNew->getSalesRuleForm()->openSection('rule_information');
36 
38  $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getSection('rule_information');
39  \PHPUnit\Framework\Assert::assertTrue(
40  $ruleInformationTab->isVisibleCustomerGroup($customerGroup),
41  "Customer group {$customerGroup->getCustomerGroupCode()} not in cart price rule page."
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Customer group find on cart price rule page.';
53  }
54 }