Skip to content

Commit

Permalink
Merge pull request #567 from lbajsarowicz/bugfix/544-missing-request-…
Browse files Browse the repository at this point in the history
…information

#544 Log Request sent even if Response failed
  • Loading branch information
okolesnyk authored Apr 17, 2020
2 parents 5ac5683 + 8d6c5d5 commit 4f1dd85
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ public function executeRequest($dependentEntities)
false
);

AllureHelper::addAttachmentToCurrentStep(json_encode($this->requestData, JSON_PRETTY_PRINT), 'Request Body');

if (($contentType === 'application/json') && ($authorization === 'adminOauth')) {
$this->isJson = true;
$executor = new WebapiExecutor($this->storeCode);
Expand Down Expand Up @@ -169,7 +171,6 @@ public function executeRequest($dependentEntities)
$response = $executor->read($successRegex, $returnRegex, $returnIndex);
$executor->close();

AllureHelper::addAttachmentToCurrentStep(json_encode($this->requestData, JSON_PRETTY_PRINT), 'Request Body');
AllureHelper::addAttachmentToCurrentStep(
json_encode(json_decode($response, true), JSON_PRETTY_PRINT+JSON_UNESCAPED_UNICODE+JSON_UNESCAPED_SLASHES),
'Response Data'
Expand Down Expand Up @@ -229,7 +230,7 @@ private function resolveUrlReference($urlIn, $entityObjects)
foreach ($entityObjects as $entityObject) {
$param = null;

if ($paramEntityParent === "" || $entityObject->getType() == $paramEntityParent) {
if ($paramEntityParent === "" || $entityObject->getType() === $paramEntityParent) {
$param = $entityObject->getDataByName(
$dataItem,
EntityDataObject::CEST_UNIQUE_VALUE
Expand Down

0 comments on commit 4f1dd85

Please sign in to comment.