Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 4 additions & 33 deletions backstop/onBefore.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@
module.exports = async (page, scenario, vp, isReference, browserContext, config) => {
module.exports = async (page) => {
// Simulate the "prefers-reduced-motion: reduce" media query,
// which is a user setting that reduces animations and transitions.
// It will provide less distorted test images.
await page.emulateMedia({ reducedMotion: 'reduce' });
// Wait until all assets have been loaded. Image style generation
// can sometimes take a long time, causing random failures.
await page.waitForLoadState('networkidle');

const { hostname } = config;

browserContext.addCookies([
{
'name': 'cookie-agreed-version',
'value': '1.2.4',
'domain': hostname,
'path': '/',
'httpOnly': false,
'secure': false
},
{
'name': 'cookie-agreed',
'value': '2',
'domain': hostname,
'path': '/',
'httpOnly': false,
'secure': false
},
{
'name': 'cookie-agreed-categories',
'value': '%5B%22essential%22%2C%22preference%22%2C%22statistics%22%2C%22marketing%22%2C%22chat%22%5D',
'domain': hostname,
'path': '/',
'httpOnly': false,
'secure': false
}
]);
};
Loading