Skip to content

Commit

Permalink
Merge pull request #1 from bitbag-commerce/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
damonsson authored Oct 23, 2017
2 parents 4813392 + b99ebec commit 24351e3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ script:
- composer validate --strict

- vendor/bin/phpspec run
- vendor/bin/behat --strict -vvv --no-interaction --tags ~@javascript

- vendor/bin/behat --strict -vvv --no-interaction --tags ~@javascript
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,13 @@ To see which forms you may want to extend, run `$ bin/console debug:container |

## Testing
```bash
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install
$ yarn install
$ yarn run gulp
$ php bin/console sylius:install --env test
$ php bin/console server:start --env test
$ open http://localhost:8000
$ bin/behat features/*
$ bin/phpspec run
$ composer install
$ bin/console assets:install web -e test
$ bin/console doctrine:database:create -e test
$ bin/console server:run 127.0.0.1:8080 -d web -e test
$ open http://localhost:8080
$ vendor/bin/behat
$ vendor/bin/phpspec run
```

## Contribution
Expand Down
16 changes: 16 additions & 0 deletions tests/Behat/Behaviour/GenericPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

namespace Tests\BitBag\CmsPlugin\Behat\Behaviour;

use Behat\Mink\Driver\Selenium2Driver;
use Sylius\Behat\Behaviour\DocumentAccessor;
use Sylius\Behat\Service\SlugGenerationHelper;

/**
* @author Mikołaj Król <[email protected]>
Expand All @@ -25,6 +27,10 @@ trait GenericPage
public function fillName($name)
{
$this->getDocument()->fillField('Name', $name);

if ($this->getDriver() instanceof Selenium2Driver) {
SlugGenerationHelper::waitForSlugGeneration($this->getSession(), $this->getElement('slug'));
}
}

/**
Expand Down Expand Up @@ -67,4 +73,14 @@ public function fillField($field, $value)
{
$this->getDocument()->fillField($field, $value);
}

/**
* {@inheritdoc}
*/
protected function getDefinedElements()
{
return array_merge(parent::getDefinedElements(), [
'slug' => '#bitbag_plugin_page_translations_en_US_slug',
]);
}
}

0 comments on commit 24351e3

Please sign in to comment.