Skip to content

Instantly share code, notes, and snippets.

@akuzemchak
Created March 7, 2014 14:18
Show Gist options
  • Select an option

  • Save akuzemchak/9412280 to your computer and use it in GitHub Desktop.

Select an option

Save akuzemchak/9412280 to your computer and use it in GitHub Desktop.

Revisions

  1. Aaron Kuzemchak created this gist Mar 7, 2014.
    20 changes: 20 additions & 0 deletions FeatureContext.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <?php

    use Behat\Behat\Event\StepEvent;
    use Behat\Behat\Event\SuiteEvent;
    use Behat\MinkExtension\Context\MinkContext;

    class FeatureContext extends MinkContext
    {
    /**
    * @AfterStep
    */
    public function after(StepEvent $event)
    {
    if ($event->hasException()) {
    $title = $event->getLogicalParent()->getTitle();

    $this->saveScreenshot($title . '.png', __DIR__ . '/../../logs');
    }
    }
    }