Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertProductAttributeDisplayingOnSearchForm.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
10 use Magento\CatalogSearch\Test\Page\AdvancedSearch;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertProductAttributeDisplayingOnSearchForm extends AbstractConstraint
17 {
18  /* tags */
19  const SEVERITY = 'low';
20  /* end tags */
21 
29  public function processAssert(CatalogProductAttribute $attribute, AdvancedSearch $advancedSearch)
30  {
31  $advancedSearch->open();
32  $formLabels = $advancedSearch->getForm()->getFormlabels();
33  $label = $attribute->hasData('manage_frontend_label')
34  ? $attribute->getManageFrontendLabel()
35  : $attribute->getFrontendLabel();
36  \PHPUnit\Framework\Assert::assertTrue(
37  in_array($label, $formLabels),
38  'Attribute is absent on advanced search form.'
39  );
40  }
41 
47  public function toString()
48  {
49  return 'Attribute is present on advanced search form.';
50  }
51 }
$label
Definition: details.phtml:21