"@percy/cli": "^1.0.0-beta.55",
The execute() function seems to work when in the "parent" snapshot:
// snapshots.js
module.exports = [
{
name: 'snapshot one',
url: 'http://localhost:8080',
waitForSelector: '.some-element',
execute() {
document.querySelector('h1').innerHTML = 'Tilting on windmills...';
}
}
]
However, trying to run the same execute() in an additionalSnapshot (like in this pages.js example) it does not work, and the <h1> content stays the same :/
// snapshots.js
module.exports = [
{
name: 'snapshot one',
url: 'http://localhost:8080',
waitForSelector: '.some-element',
additionalSnapshots: [
{
suffix: '--tilt',
execute() {
document.querySelector('h1').innerHTML = 'Tilting on windmills...';
}
}
]
}
]
The
execute()function seems to work when in the "parent" snapshot:However, trying to run the same
execute()in anadditionalSnapshot(like in this pages.js example) it does not work, and the<h1>content stays the same :/