Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ContinuePaypalCheckoutStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\TestStep\TestStepInterface;
10 use Magento\Paypal\Test\Fixture\SandboxCustomer;
11 use Magento\Paypal\Test\Page\Sandbox\ExpressReview;
13 
17 class ContinuePaypalCheckoutStep implements TestStepInterface
18 {
24  protected $sandboxCustomer;
25 
31  protected $expressReview;
32 
38  private $assertTotalPaypalReview;
39 
45  private $paypalPrices;
46 
54  public function __construct(
55  SandboxCustomer $sandboxCustomer,
56  ExpressReview $expressReview,
57  AssertTotalPaypalReview $assertTotalPaypalReview,
58  array $paypalPrices = []
59  ) {
60  $this->sandboxCustomer = $sandboxCustomer;
61  $this->expressReview = $expressReview;
62  $this->assertTotalPaypalReview = $assertTotalPaypalReview;
63  $this->paypalPrices = $paypalPrices;
64  }
65 
71  public function run()
72  {
73  $this->expressReview->getExpressMainLoginBlock()->waitForFormLoaded();
74  if ($this->expressReview->getExpressMainLoginBlock()->isVisible()) {
75  $this->expressReview->getExpressMainLoginBlock()->getLoginBlock()->fill($this->sandboxCustomer);
76  $this->expressReview->getExpressMainLoginBlock()->getLoginBlock()->sandboxLogin();
77  }
78  if (isset($this->paypalPrices['total'])) {
79  $this->assertTotalPaypalReview->processAssert($this->expressReview, $this->paypalPrices['total']);
80  }
81  $this->expressReview->getExpressMainReviewBlock()->getReviewBlock()->reviewAndContinue();
82  }
83 }
__construct(SandboxCustomer $sandboxCustomer, ExpressReview $expressReview, AssertTotalPaypalReview $assertTotalPaypalReview, array $paypalPrices=[])