Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CheckoutWithPaypalFromMinicartStep.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Mtf\Client\BrowserInterface;
9 use Magento\Mtf\Fixture\FixtureInterface;
10 use Magento\Mtf\TestStep\TestStepInterface;
11 use Magento\Catalog\Test\Page\Product\CatalogProductView;
12 
16 class CheckoutWithPaypalFromMinicartStep implements TestStepInterface
17 {
23  protected $products;
24 
31 
37  protected $browser;
38 
45  public function __construct(
46  CatalogProductView $catalogProductView,
47  BrowserInterface $browser,
48  array $products
49  ) {
50  $this->catalogProductView = $catalogProductView;
51  $this->browser = $browser;
52  $this->products = $products;
53  }
54 
60  public function run()
61  {
62  $product = reset($this->products);
63  $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
64  $parentWindow = $this->catalogProductView->getViewBlock()->braintreePaypalCheckout();
65  $this->catalogProductView->getBraintreePaypalBlock()->process($parentWindow);
66  }
67 }
__construct(CatalogProductView $catalogProductView, BrowserInterface $browser, array $products)