Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteCustomerStep.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Customer\Test\Page\Adminhtml\CustomerIndex;
10 use Magento\Customer\Test\Page\Adminhtml\CustomerIndexEdit;
11 use Magento\Mtf\TestStep\TestStepInterface;
12 
16 class DeleteCustomerStep implements TestStepInterface
17 {
21  private $customer;
22 
26  private $customerIndexPage;
27 
31  private $customerIndexEditPage;
32 
38  public function __construct(
39  Customer $customer,
40  CustomerIndex $customerIndexPage,
41  CustomerIndexEdit $customerIndexEditPage
42  ) {
43  $this->customer = $customer;
44  $this->customerIndexPage = $customerIndexPage;
45  $this->customerIndexEditPage = $customerIndexEditPage;
46  }
47 
51  public function run()
52  {
53  $filter = ['email' => $this->customer->getEmail()];
54  $this->customerIndexPage->open();
55  $this->customerIndexPage->getCustomerGridBlock()->searchAndOpen($filter);
56  $this->customerIndexEditPage->getPageActionsBlock()->delete();
57  $this->customerIndexEditPage->getModalBlock()->acceptAlert();
58  }
59 }
$customer
Definition: customers.php:11
__construct(Customer $customer, CustomerIndex $customerIndexPage, CustomerIndexEdit $customerIndexEditPage)