8 use Magento\Mtf\Constraint\AbstractConstraint;
9 use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
10 use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
21 private $canceledAmountPattern =
'/^Canceled order online Amount: \w*\W{1,2}%s. Transaction ID: "[\w\-]*"/';
30 public function processAssert(
31 SalesOrderView $salesOrderView,
32 OrderIndex $salesOrder,
37 $salesOrder->getSalesOrderGrid()->searchAndOpen([
'id' => $orderId]);
40 $infoTab = $salesOrderView->getOrderForm()->openTab(
'info')->getTab(
'info');
41 $comments = $infoTab->getCommentsHistoryBlock()->getComments();
42 $commentsMessages = array_column(
$comments,
'comment');
44 \PHPUnit\Framework\Assert::assertRegExp(
45 sprintf($this->canceledAmountPattern,
$prices[
'grandTotal']),
46 implode(
'. ', $commentsMessages),
47 'Incorrect canceled amount value for the order #' . $orderId
58 return "Message about canceled amount is available in Comments History section.";