Skip to main content

hermione-hide-scrollbars

Overview

Use the hermione-hide-scrollbars plugin to hide scrollbars in tests that run in Chrome browsers.

To access the browser via Chrome DevTools Protocol (CDP), the plugin uses the puppeteer-core package.

To hide scroll bars, the CDP Emulation.setScrollbarsHidden command is used.

warning

Update your Chrome browser to version 72.1 and higher so that this functionality works in your tests. Since earlier versions of Chrome browsers do not support the Emulation.setScrollbarsHidden command.

Install

npm install -D hermione-hide-scrollbars

Setup

Add the plugin to the plugins section of the testplane config:

module.exports = {
plugins: {
"hermione-hide-scrollbars": {
enabled: true,
browsers: ["chrome"],
browserWSEndpoint: ({ sessionId, gridUrl }) =>
`ws://${url.parse(gridUrl).host}/devtools/${sessionId}`,
},

// other Testplane plugins...
},

// other Testplane settings...
};

Description of configuration parameters

ParameterTypeDefault valueDescription
enabledBooleantrueEnable / disable the plugin.
browsersArray[ ]A list of browsers for which the logic of disabling scroll bars will be applied.
browserWSEndpointFunctionN/AA function that should return the URL to work with the browser via CDP. To be able to define the URL, the session ID and a link to the grid are passed to the function: the parameters are passed as an object with the keys sessionId and gridUrl.

Passing parameters via the CLI

All plugin parameters that can be defined in the config can also be passed as command-line options or through environment variables during the launch of Testplane. Use the prefix --hide-scrollbars- for command line options and testplane_hide_scrollbars_ for environment variables.