Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hermione-assert-view-extended

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hermione-assert-view-extended

Hermione plugin for extend assertView command.

  • 5.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 28 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc