Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DeleteStoredPaymentStep.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Customer\Test\Page\CustomerAccountIndex;
9 use Magento\Mtf\TestStep\TestStepInterface;
10 use Magento\Vault\Test\Page\StoredPaymentMethods;
11 
12 class DeleteStoredPaymentStep implements TestStepInterface
13 {
17  private $customerAccountIndex;
18 
22  private $storedPaymentMethodsPage;
23 
30  public function __construct(
31  StoredPaymentMethods $storedPaymentMethodsPage,
32  CustomerAccountIndex $customerAccountIndex
33  ) {
34  $this->storedPaymentMethodsPage = $storedPaymentMethodsPage;
35  $this->customerAccountIndex = $customerAccountIndex;
36  }
37 
43  public function run()
44  {
45  $this->customerAccountIndex->open();
46  $this->customerAccountIndex->getAccountMenuBlock()->openMenuItem('Stored Payment Methods');
47  $storedPaymentsBlock = $this->storedPaymentMethodsPage->getStoredPaymentsBlock();
48  $storedPaymentsBlock->deleteStoredPayment();
49  }
50 }
__construct(StoredPaymentMethods $storedPaymentMethodsPage, CustomerAccountIndex $customerAccountIndex)