Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertStoreFrontend.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
17 class AssertStoreFrontend extends AbstractConstraint
18 {
26  public function processAssert(Store $store, CmsIndex $cmsIndex)
27  {
28  $cmsIndex->open();
29  if ($cmsIndex->getFooterBlock()->isStoreGroupSwitcherVisible()
30  && $cmsIndex->getFooterBlock()->isStoreGroupVisible($store)
31  ) {
32  $cmsIndex->getFooterBlock()->selectStoreGroup($store);
33  }
34 
35  $isStoreViewVisible = !$cmsIndex->getStoreSwitcherBlock()->isStoreViewDropdownVisible()
36  ? true // if only one store view is assigned to store group
37  : $cmsIndex->getStoreSwitcherBlock()->isStoreViewVisible($store);
38 
39  \PHPUnit\Framework\Assert::assertTrue(
40  $isStoreViewVisible,
41  "Store view is not visible in dropdown on CmsIndex page"
42  );
43  }
44 
50  public function toString()
51  {
52  return 'Store view is visible in dropdown on CmsIndex page';
53  }
54 }