Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FillShippingMethodStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutOnepage;
10 use Magento\Mtf\TestStep\TestStepInterface;
11 
16 class FillShippingMethodStep implements TestStepInterface
17 {
23  protected $checkoutOnepage;
24 
30  protected $shipping;
31 
37  public function __construct(CheckoutOnepage $checkoutOnepage, array $shipping = [])
38  {
39  $this->checkoutOnepage = $checkoutOnepage;
40  $this->shipping = $shipping;
41  }
42 
48  public function run()
49  {
50  if (!empty($this->shipping)) {
51  $this->checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($this->shipping);
52  $this->checkoutOnepage->getShippingMethodBlock()->clickContinue();
53  }
54  }
55 }
__construct(CheckoutOnepage $checkoutOnepage, array $shipping=[])