Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
LogoutCustomerOnFrontendStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Cms\Test\Page\CmsIndex;
10 use Magento\Mtf\TestStep\TestStepInterface;
11 use Magento\Customer\Test\Page\CustomerAccountIndex;
12 
16 class LogoutCustomerOnFrontendStep implements TestStepInterface
17 {
23  protected $cmsIndex;
24 
30  protected $customerAccount;
31 
37  public function __construct(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccount)
38  {
39  $this->cmsIndex = $cmsIndex;
40  $this->customerAccount = $customerAccount;
41  }
42 
48  public function run()
49  {
50  $this->customerAccount->open();
51  $this->cmsIndex->getCmsPageBlock()->waitPageInit();
52  if ($this->cmsIndex->getTitleBlock()->getTitle() === 'My Account') {
53  $this->cmsIndex->getLinksBlock()->openLink('Sign Out');
54  $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
55  $this->cmsIndex->getCmsPageBlock()->waitPageInit();
56  }
57  }
58 }
__construct(CmsIndex $cmsIndex, CustomerAccountIndex $customerAccount)