Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertCustomerLogout.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Customer\Test\Page\CustomerAccountIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 
16 class AssertCustomerLogout extends AbstractConstraint
17 {
21  const LOGOUT_PAGE_TITLE = 'You are signed out';
22 
26  const HOME_PAGE_TITLE = 'Home Page';
27 
35  public function processAssert(CustomerAccountIndex $customerAccountIndex, CmsIndex $cmsIndex)
36  {
37  $customerAccountIndex->open();
38  $cmsIndex->getCmsPageBlock()->waitPageInit();
39 
40  $cmsIndex->getLinksBlock()->openLink('Sign Out');
41  $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::LOGOUT_PAGE_TITLE);
42  $cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible(self::HOME_PAGE_TITLE);
43  $cmsIndex->getCmsPageBlock()->waitPageInit();
44  \PHPUnit\Framework\Assert::assertTrue(
45  $cmsIndex->getLinksBlock()->isLinkVisible('Sign In'),
46  "Customer wasn't logged out."
47  );
48  }
49 
55  public function toString()
56  {
57  return "Customer is successfully log out.";
58  }
59 }
processAssert(CustomerAccountIndex $customerAccountIndex, CmsIndex $cmsIndex)