Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ConfigureProductsStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Sales\Test\Page\Adminhtml\OrderCreateIndex;
10 use Magento\Mtf\TestStep\TestStepInterface;
11 
15 class ConfigureProductsStep implements TestStepInterface
16 {
22  protected $products = [];
23 
29  protected $orderCreateIndex;
30 
36  public function __construct(array $products, OrderCreateIndex $orderCreateIndex)
37  {
38  $this->products = $products;
39  $this->orderCreateIndex = $orderCreateIndex;
40  }
41 
47  public function run()
48  {
49  $orderPage = $this->orderCreateIndex;
50  foreach ($this->products as $product) {
51  $orderPage->getCreateBlock()->getItemsBlock()->getItemProductByName($product->getName())->configure();
52  $orderPage->getConfigureProductBlock()->configProduct($product);
53  }
54  $orderPage->getCreateBlock()->updateItems();
55  }
56 }
__construct(array $products, OrderCreateIndex $orderCreateIndex)