https://github.com/ruslanxdev/hermione-assert-view-extended
Hermione plugin for extend assertView command.
https://github.com/ruslanxdev/hermione-assert-view-extended
Last synced: over 1 year ago
JSON representation
Hermione plugin for extend assertView command.
- Host: GitHub
- URL: https://github.com/ruslanxdev/hermione-assert-view-extended
- Owner: ruslanxdev
- License: mit
- Created: 2019-02-16T18:43:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T20:37:53.000Z (almost 4 years ago)
- Last Synced: 2025-03-20T20:19:12.334Z (over 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hermione-assert-view-extended
Hermione plugin for extend assertView command. Inspired [hermione-ignore](https://github.com/deemidroll/hermione-ignore).
## Install
```
npm i -D hermione-assert-view-extended
```
## Usage
Set options for the plugin in your hermione config:
```js
{
hooks: {
beforeEach: function(name, selector, options) {
return this.browser.moveTo(0, 0);
},
afterEach: function(name, selector, options) {
console.log(`Asserted view '${name}' for '${selector}' selector.`);
}
},
globalStyles: {
animationDisabled: true,
redraw: true,
// Elements will be covered with black rect.
ignoreElements: [
'.classname1'
],
// Elements will be hidden with `opacity: 0`.
invisibleElements: [
'.classname3'
],
// Elements will be hidden with `display: none`.
hideElements: [
'.classname2'
],
customCSS: `
body {
background-color: red;
}
`
}
}
```
## Options
| Option | Default | Description |
| --- | --- | --- |
| `hooks` | | Hermione commands which will be called before/after call assertView in `then()`. |
| `hooks.beforeEach` | | Hermione commands which will be called before call assertView and first inner execute. |
| `hooks.afterEach` | | Hermione commands which will be called after call assertView and last inner execute. |
| `globalStyles` | | CSS injection appended in `` before call assertView. It will be removed after call assertView. |
| `globalStyles.animationDisabled` | `false` | Disable CSS animation (`transition-duration: 0s`, `animation-duration: 0s`, etc.). |
| `globalStyles.redraw` | `false` | Bowser redraw page after apply styles. It will be `true`, if you set `redrawElements`. |
| `globalStyles.redrawMode` | `'medium'` | Bowser redraw page after apply styles.
- `'soft'` — only repaint without reflow with `transform: translateZ(0)`;
- `'medium'` — reflow and repaint with `opacity: 0`;
- `'hard'` — reflow and repaint with `display: none`.
| `globalStyles.redrawElements` | `['body']` | Elements will be redrawed. |
| `globalStyles.redrawTimeout` | | Timeout after redraw elements. |
| `globalStyles.ignoreElements` | | Elements will be covered with black rect. |
| `globalStyles.invisibleElements` | | Elements will be hidden with `opacity: 0`. |
| `globalStyles.hideElements` | | Elements will be hidden with `display: none`. |
| `globalStyles.customCSS` | | Custom styles. |
## Licence
MIT