8 use Magento\Mtf\TestStep\TestStepFactory;
9 use Magento\Mtf\TestStep\TestStepInterface;
11 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
12 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
41 private $salesOrderView;
48 private $testStepFactory;
57 OrderIndex $orderIndex,
58 OrderInjectable $order,
59 SalesOrderView $salesOrderView,
60 TestStepFactory $testStepFactory
62 $this->orderIndex = $orderIndex;
64 $this->salesOrderView = $salesOrderView;
65 $this->testStepFactory = $testStepFactory;
73 $this->orderIndex->open();
74 $this->orderIndex->getSalesOrderGrid()
75 ->searchAndOpen([
'id' => $this->order->getId()]);
77 switch ($this->salesOrderView->getOrderInfoBlock()->getOrderStatus()) {
78 case 'Suspected Fraud':
79 $this->getStepInstance(DenyPaymentStep::class)->run();
82 $this->getStepInstance(UnholdOrderStep::class)->run();
83 $this->getStepInstance(CancelOrderStep::class)->run();
88 $this->getStepInstance(CancelOrderStep::class)->run();
98 private function getStepInstance(
$class)
100 return $this->testStepFactory->create(
102 [
'order' => $this->order]
$_option $_optionId $class
__construct(OrderIndex $orderIndex, OrderInjectable $order, SalesOrderView $salesOrderView, TestStepFactory $testStepFactory)