Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractAssertOrderOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Customer\Test\Page\CustomerAccountIndex;
10 use Magento\Cms\Test\Page\CmsIndex;
12 use Magento\Mtf\Constraint\AbstractConstraint;
13 use Magento\Mtf\ObjectManager;
14 use Magento\Mtf\System\Event\EventManagerInterface;
15 
19 abstract class AbstractAssertOrderOnFrontend extends AbstractConstraint
20 {
26  protected $cmsIndex;
27 
34 
42  public function __construct(
43  ObjectManager $objectManager,
44  EventManagerInterface $eventManager,
45  CmsIndex $cmsIndex,
46  CustomerAccountIndex $customerAccountIndex
47  ) {
48  parent::__construct($objectManager, $eventManager);
49  $this->cmsIndex = $cmsIndex;
50  $this->customerAccountIndex = $customerAccountIndex;
51  }
52 
59  protected function loginCustomerAndOpenOrderPage(Customer $customer)
60  {
61  $this->cmsIndex->open();
62  $loginCustomerOnFrontendStep = $this->objectManager->create(
63  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
64  ['customer' => $customer]
65  );
66  $loginCustomerOnFrontendStep->run();
67  $this->cmsIndex->getLinksBlock()->openLink('My Account');
68  $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
69  }
70 }
$objectManager
Definition: bootstrap.php:17
$customer
Definition: customers.php:11
__construct(ObjectManager $objectManager, EventManagerInterface $eventManager, CmsIndex $cmsIndex, CustomerAccountIndex $customerAccountIndex)