Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drunomics/behat-drupal-utils
Provides utilities for running smoke tests and various useful behat contexts.
https://github.com/drunomics/behat-drupal-utils
behat drupal
Last synced: 2 months ago
JSON representation
Provides utilities for running smoke tests and various useful behat contexts.
- Host: GitHub
- URL: https://github.com/drunomics/behat-drupal-utils
- Owner: drunomics
- Created: 2018-04-30T10:45:53.000Z (over 6 years ago)
- Default Branch: 2.x
- Last Pushed: 2023-04-06T08:09:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T17:29:49.089Z (4 months ago)
- Topics: behat, drupal
- Language: PHP
- Homepage:
- Size: 57.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# drunomics Behat Drupal utils
## Dependencies:
- Behat
- Drupal
- Drupal Extension
- Behat Driver with Javascript enabled (e.g. `dmore/behat-chrome-extension`)The javascript step definitions are all tested with `dmore/behat-chrome-extension`.
## Overview:
The package provides:
* Various useful behat contexts, organized the following context classes:
- DrupalUtilsApiContext
- DrupalUtilsDrushContext
- MinkUtilsContext
- HttpHeadersContextDepending on your behat configuration, the suiting context classes should be added in. It automatically includes
all compatible step definitions.
* Optional additional context classes that add automatic checks or cleanup routines like:
- DrupalCleanTestContentApiContext
- DrupalErrorCheckApiContext## Smoke tests
The tests below ./examples/ ensure a simple Drupal login/logout works and a page of your site can be opened, while
frontend assets are loaded and no javascript or watchdog errors are triggered.### Setup
* Add this package to your project's dev dependencies.
* Add one of the three context to your behat.yml, optionall also add optional contexts.
* Feel free to copy the example behat features.
* Add the provided js file to your sites js. The listener is required to catch js errors.### Detecting watchdog errors
##### Default behaviourWhen DrupalErrorCheckApiContext is added, all watchdog entries excluding `Notice`, `Info` and `Debug` will be detected
and trigger PHP errors in the behat PHP runner automatically.##### Adjusting watchdog entries severity to `NOTICE` level
To change the error detection severity to `NOTICE` set the `fail_on_notice` parameter in the behat.yml to `TRUE`.
```
contexts:
- drunomics\BehatDrupalUtils\Context\DrupalErrorCheckApiContext:
fail_on_notice: TRUE
```## Credits
developed by drunomics GmbH, [email protected]
Please refer to the commit log individual contributors.