9 use Magento\Mtf\TestStep\TestStepInterface;
10 use Magento\Checkout\Test\Page\CheckoutOnepageSuccess;
23 private $checkoutOnepageSuccess;
37 CheckoutOnepageSuccess $checkoutOnepageSuccess,
40 $this->checkoutOnepageSuccess = $checkoutOnepageSuccess;
41 $this->decorator = $decorator;
51 $incrementId = $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId();
53 'entityId' => $this->getEntityId($incrementId),
54 'orderId' => $incrementId
64 private function getEntityId($incrementId)
66 $url = $_ENV[
'app_frontend_url'] .
'rest/V1/orders/';
67 $url .=
'?searchCriteria[filterGroups][0][filters][0][field]=increment_id';
68 $url .=
'&searchCriteria[filterGroups][0][filters][0][value]=' . $incrementId;
69 $this->decorator->write(
$url, [], WebapiDecorator::GET);
70 $response = json_decode($this->decorator->read(),
true);
71 $this->decorator->close();
72 return $response[
'items'][0][
'entity_id'];
__construct(CheckoutOnepageSuccess $checkoutOnepageSuccess, WebapiDecorator $decorator)