Automating testing process
Behat and Lando
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Behat
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/5589058/pasted-from-clipboard.png)
php framework for autotesting your business expectations
Behat: BDD
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Behat is a behavior-driven development tool
What is BDD?
Development, based on examples of how the application should work
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: example
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Feature: Real business example of application use
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/5589162/pasted-from-clipboard.png)
- Title
- Benefit
- Role
- Feature itself
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: example
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Feature: Real business example of application use
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/5589184/pasted-from-clipboard.png)
- Additional information
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: example
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Scenario: Context - Action - Outcome
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/5589191/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: example
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Scenario: Context - Action - Outcome
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/5589203/pasted-from-clipboard.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: Real life
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Transformation: words to code
- use existing extensions
- drupal/drupal-extension
Example:
behat --config=/app/tests/behat-pantheon.yml --definitions i
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
BDD: Real life
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Transformation: words to code
- write your own contexts with Behat
Example:
behat --config=/app/tests/behat-pantheon.yml --dry-run --snippets-for FeatureContext
behat --config=/app/tests/behat-pantheon.yml --dry-run --append-snippets
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
Behat and Lando
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Example: nvz-jump
- remove local drush (will be fixed)
- use global drush
- add BEHAT environment variable
- you are good to go!
lando behat --config=/app/tests/behat-pantheon.yml
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603378/quality-control.jpg)
Questions, ideas, suggestions?
![](https://s3.amazonaws.com/media-p.slid.es/uploads/830369/images/4603380/logo_colours_400px_crop_400x400.jpg)
Automating testing process: Behat and Lando (English)
By Yauhen Zenko
Automating testing process: Behat and Lando (English)
- 1,274