Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Commit 516a73b

Browse files
committed
Merge branch 'behatch-debug-display-profiler-url'
2 parents c17b5be + a44ff3c commit 516a73b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Context/DebugContext.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function failScreenshots(AfterStepScope $scope)
5353
return;
5454
}
5555

56+
$this->displayProfilerLink();
57+
5658
$suiteName = urlencode(str_replace(' ', '_', $scope->getSuite()->getName()));
5759
$featureName = urlencode(str_replace(' ', '_', $scope->getFeature()->getTitle()));
5860

@@ -67,6 +69,16 @@ public function failScreenshots(AfterStepScope $scope)
6769
$this->saveScreenshot($filename, $this->screenshotDir);
6870
}
6971

72+
private function displayProfilerLink()
73+
{
74+
try {
75+
$headers = $this->getMink()->getSession()->getResponseHeaders();
76+
echo "The debug profile URL {$headers['X-Debug-Token-Link'][0]}";
77+
} catch (\Exception $e) {
78+
/* Intentionally leave blank */
79+
}
80+
}
81+
7082
/**
7183
* @param AfterStepScope $scope
7284
* @return \Behat\Gherkin\Node\ScenarioInterface

0 commit comments

Comments
 (0)