Skip to content

Instantly share code, notes, and snippets.

@mustafaileri
Last active January 30, 2017 07:52
Show Gist options
  • Save mustafaileri/2fe20ce42233dac30850dc00b50719b1 to your computer and use it in GitHub Desktop.
Save mustafaileri/2fe20ce42233dac30850dc00b50719b1 to your computer and use it in GitHub Desktop.
Base context
<?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