Download the PHP package metadrop/backstopjs-addons without Composer
On this page you can find all versions of the php package metadrop/backstopjs-addons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download metadrop/backstopjs-addons
More information about metadrop/backstopjs-addons
Files in metadrop/backstopjs-addons
Package backstopjs-addons
Short Description Metadrop custom backstopjs scripts
License
Informations about the package backstopjs-addons
BackstopJS Addons
A library that extends and improves the default options provided by BackstopJS.
Installation
Add the path of the "bacsktopjs-addons" folder to the project's .gitignore, for example:
You can override the default destination of the library ("tests/backstopjs/common/libraries/backstopjs-addons") by adding the following parameter to the extra section of your project's composer.json file:
Options and features
Scenario setup
By default, the library applies the following optimisations to the scenarios to avoid common loading issues:
- Avoid lazy CSS loading
- Remove lazy loading and force eager on all images and iframes
- Avoid asynchronous image decoding
- Force Drupal.blazy to load all images
- Pause the Slick slider autoplay
- Wait for fonts to load
- Wait for the page to load completely
- Allow setting the
cookiePath
for the cookies.json globally to apply to all scenarios. If set in the scenario configuration, it will override the global configuration.
Stop animations
Allow stopping the CSS animations on the provided CSS selectors, can be set on each scenario using the stopAnimationsSelectors
property.
Disable filters
CSS filters can be disabled on the provided CSS selectors, can be set on each scenario using the disableFiltersSelectors
property.
Log in and navigate to a specific page
Allow users to log in and navigate to a specific page before taking a screenshot. To use this feature you need to set at least the following options
loginWrapperSelector
- The selector of the element that wraps the login form.loginUser
- The username to login withloginPass
- The password to login with
Optionally, loginRedirectTo
can be set to navigate to a specific page after login.
loginUser
and loginPass
can be set globally in the 'backstopjsAddons' settings or in the scenario configuration. If you set the login in the global configuration, you can override it in the scenario configuration.
The removeSelectors
option is applied after login and navigation.
Wait for selector after interaction
This option allows you to wait for a selector to appear after an interaction. This feature is configured within a scenario using the `waitForSelectorAfterInteraction' property, which takes a CSS selector.
Custom user agent by viewport
Allow a user agent to be set on the viewport.
Hide iframe content
This option replaces the specified iframe(s) with a grey background, maintaining the size of the iframe. This feature is configured within a scenario using the `hideIframeContent' property, which takes a comma-separated list of CSS selectors.