Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AddGiftMessageStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Checkout\Test\Page\CheckoutCart;
11 use Magento\Mtf\TestStep\TestStepInterface;
12 
17 class AddGiftMessageStep implements TestStepInterface
18 {
24  protected $checkoutCart;
25 
31  protected $giftMessage;
32 
38  protected $products;
39 
46  public function __construct(CheckoutCart $checkoutCart, GiftMessage $giftMessage, array $products = [])
47  {
48  $this->checkoutCart = $checkoutCart;
49  $this->giftMessage = $giftMessage;
50  $this->products = $products;
51  }
52 
58  public function run()
59  {
60  $this->checkoutCart->open();
61  $this->checkoutCart->getGiftMessagesItemBlock()->fillGiftMessageItem($this->giftMessage, $this->products);
62  $this->checkoutCart->getGiftMessagesOrderBlock()->fillGiftMessageOrder($this->giftMessage, $this->products);
63 
64  return ['giftMessage' => $this->giftMessage];
65  }
66 }
__construct(CheckoutCart $checkoutCart, GiftMessage $giftMessage, array $products=[])