5.0.0 • Published 1 year ago

hermione-assert-view-extended v5.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

hermione-assert-view-extended

Hermione plugin for extend assertView command. Inspired hermione-ignore.

Install

npm i -D hermione-assert-view-extended

Usage

Set options for the plugin in your hermione config:

{
    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

OptionDefaultDescription
hooksHermione commands which will be called before/after call assertView in then().
hooks.beforeEachHermione commands which will be called before call assertView and first inner execute.
hooks.afterEachHermione commands which will be called after call assertView and last inner execute.
globalStylesCSS injection appended in <head> before call assertView. It will be removed after call assertView.
globalStyles.animationDisabledfalseDisable CSS animation (transition-duration: 0s, animation-duration: 0s, etc.).
globalStyles.redrawfalseBowser 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.redrawTimeoutTimeout after redraw elements.
globalStyles.ignoreElementsElements will be covered with black rect.
globalStyles.invisibleElementsElements will be hidden with opacity: 0.
globalStyles.hideElementsElements will be hidden with display: none.
globalStyles.customCSSCustom styles.

Licence

MIT

5.0.0

1 year ago

4.0.0

5 years ago

4.0.0-0

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago