mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Replaced all references to ScenarioEvent with BaseScenarioEvent so that Scenario Outlines do not break
This commit is contained in:
parent
bca133254c
commit
d1cb9ff038
@ -7,9 +7,9 @@ use Behat\Behat\Context\ClosuredContextInterface,
|
||||
Behat\Behat\Context\BehatContext,
|
||||
Behat\Behat\Context\Step,
|
||||
Behat\Behat\Event\StepEvent,
|
||||
Behat\Behat\Event\ScenarioEvent,
|
||||
Behat\Behat\Exception\PendingException;
|
||||
|
||||
use Behat\Behat\Event\BaseScenarioEvent;
|
||||
use Behat\Mink\Driver\Selenium2Driver;
|
||||
|
||||
use Behat\Gherkin\Node\PyStringNode,
|
||||
@ -241,7 +241,7 @@ JS;
|
||||
*
|
||||
* @AfterScenario
|
||||
*/
|
||||
public function closeModalDialog(ScenarioEvent $event) {
|
||||
public function closeModalDialog(BaseScenarioEvent $event) {
|
||||
try{
|
||||
// Only for failed tests on CMS page
|
||||
if (4 === $event->getResult()) {
|
||||
@ -266,7 +266,7 @@ JS;
|
||||
*
|
||||
* @AfterScenario @assets
|
||||
*/
|
||||
public function cleanAssetsAfterScenario(ScenarioEvent $event) {
|
||||
public function cleanAssetsAfterScenario(BaseScenarioEvent $event) {
|
||||
foreach(\File::get() as $file) {
|
||||
if(file_exists($file->getFullPath())) $file->delete();
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ Behat\Behat\Context\TranslatedContextInterface,
|
||||
Behat\Behat\Context\BehatContext,
|
||||
Behat\Behat\Context\Step,
|
||||
Behat\Behat\Event\FeatureEvent,
|
||||
Behat\Behat\Event\ScenarioEvent,
|
||||
Behat\Behat\Exception\PendingException;
|
||||
use Behat\Behat\Event\BaseScenarioEvent;
|
||||
use Behat\Gherkin\Node\PyStringNode,
|
||||
Behat\Gherkin\Node\TableNode;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
@ -54,7 +54,7 @@ class EmailContext extends BehatContext
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*/
|
||||
public function before(ScenarioEvent $event)
|
||||
public function before(BaseScenarioEvent $event)
|
||||
{
|
||||
// Also set through the 'supportbehat' extension
|
||||
// to ensure its available both in CLI execution and the tested browser session
|
||||
|
@ -8,11 +8,11 @@ use Behat\Behat\Context\ClosuredContextInterface,
|
||||
Behat\Behat\Context\Step,
|
||||
Behat\Behat\Event\StepEvent,
|
||||
Behat\Behat\Event\FeatureEvent,
|
||||
Behat\Behat\Event\ScenarioEvent,
|
||||
Behat\Behat\Exception\PendingException,
|
||||
Behat\Mink\Driver\Selenium2Driver,
|
||||
Behat\Gherkin\Node\PyStringNode,
|
||||
Behat\Gherkin\Node\TableNode;
|
||||
use Behat\Behat\Event\BaseScenarioEvent;
|
||||
|
||||
// PHPUnit
|
||||
require_once 'PHPUnit/Autoload.php';
|
||||
@ -84,7 +84,7 @@ class FixtureContext extends BehatContext
|
||||
/**
|
||||
* @BeforeScenario @database-defaults
|
||||
*/
|
||||
public function beforeDatabaseDefaults(ScenarioEvent $event) {
|
||||
public function beforeDatabaseDefaults(BaseScenarioEvent $event) {
|
||||
\SapphireTest::empty_temp_db();
|
||||
\DB::getConn()->quiet();
|
||||
$dataClasses = \ClassInfo::subclassesFor('DataObject');
|
||||
@ -97,14 +97,14 @@ class FixtureContext extends BehatContext
|
||||
/**
|
||||
* @AfterScenario
|
||||
*/
|
||||
public function afterResetDatabase(ScenarioEvent $event) {
|
||||
public function afterResetDatabase(BaseScenarioEvent $event) {
|
||||
\SapphireTest::empty_temp_db();
|
||||
}
|
||||
|
||||
/**
|
||||
* @AfterScenario
|
||||
*/
|
||||
public function afterResetAssets(ScenarioEvent $event) {
|
||||
public function afterResetAssets(BaseScenarioEvent $event) {
|
||||
if (is_array($this->createdFilesPaths)) {
|
||||
$createdFiles = array_reverse($this->createdFilesPaths);
|
||||
foreach ($createdFiles as $path) {
|
||||
|
@ -4,8 +4,8 @@ namespace SilverStripe\BehatExtension\Context;
|
||||
|
||||
use Behat\Behat\Context\Step,
|
||||
Behat\Behat\Event\FeatureEvent,
|
||||
Behat\Behat\Event\ScenarioEvent,
|
||||
Behat\Behat\Event\SuiteEvent;
|
||||
use Behat\Behat\Event\BaseScenarioEvent;
|
||||
use Behat\Gherkin\Node\PyStringNode;
|
||||
use Behat\MinkExtension\Context\MinkContext;
|
||||
use Behat\Mink\Driver\GoutteDriver,
|
||||
@ -183,7 +183,7 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
|
||||
/**
|
||||
* @BeforeScenario
|
||||
*/
|
||||
public function before(ScenarioEvent $event) {
|
||||
public function before(BaseScenarioEvent $event) {
|
||||
if (!isset($this->databaseName)) {
|
||||
throw new \LogicException(
|
||||
'Context\'s $databaseName has to be set when implementing SilverStripeAwareContextInterface.'
|
||||
|
Loading…
Reference in New Issue
Block a user