Last active
January 30, 2017 07:52
-
-
Save mustafaileri/2fe20ce42233dac30850dc00b50719b1 to your computer and use it in GitHub Desktop.
Base context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Behat\MinkExtension\Context\MinkContext; | |
class BaseContext extends MinkContext | |
{ | |
/** | |
* | |
* @BeforeScenario @resetDB | |
*/ | |
public function resetDB(BeforeScenarioScope $beforeScenarioScope = null) | |
{ | |
//Reset database | |
} | |
/** | |
* @param $selectorType | |
* @param $selector | |
* @throws \Behat\Mink\Exception\ElementNotFoundException | |
*/ | |
public function requiredElementExists($selectorType, $selector) | |
{ | |
$that = $this; | |
return $this->spins(function () use ($that, $selectorType, $selector) { | |
return $that->assertSession()->elementExists($selectorType, $selector); | |
}); | |
} | |
... | |
... | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment