Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Context/DebugContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public function iSaveAScreenshotIn($filename)
public function failScreenshots(AfterStepScope $scope)
{
if (! $scope->getTestResult()->isPassed()) {
$this->displayProfilerLink();

$suiteName = urlencode(str_replace(' ', '_', $scope->getSuite()->getName()));
$featureName = urlencode(str_replace(' ', '_', $scope->getFeature()->getTitle()));
if ($this->getBackground($scope)) {
Expand All @@ -66,6 +68,16 @@ public function failScreenshots(AfterStepScope $scope)
}
}

private function displayProfilerLink()
{
try {
$headers = $this->getMink()->getSession()->getResponseHeaders();
echo "The debug profile URL {$headers['X-Debug-Token-Link'][0]}";
} catch (\Exception $e) {
/* Intentionally leave blank */
}
}

/**
* @param AfterStepScope $scope
* @return \Behat\Gherkin\Node\ScenarioInterface
Expand Down