Using Readyevent on scenario halts execution of BackstopJS
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to use the ReadyEvent to delay the execution of a scenario (B) that requires scenario (A) to be finished before (B) begins. (Basically scenario (A) creates a piece of content in my CMS and scenario (B) deletes it)
I thought the issues was in my custom puppeteer/backstop scripts but I tried it with a vanilla backstop and the ReadyEvent still halts everything.
Am I completely missing something and not using it right? or is this an actual issue with Backstop?
Any help would be really appreciated.
macOS HighSierra 10.13.6
$ backstop --version
BackstopJS v4.1.9
**backstop.json**
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
"scenarios": [
{
"label": "BackstopJS Homepage",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://garris.github.io/BackstopJS/",
"referenceUrl": "",
"readyEvent": "backstopjs_ready_event",
"readySelector": "",
"delay": 1000,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": 0,
"selectors": [],
"selectorExpansion": true,
"expect": 0,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"]
},
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": false,
"debugWindow": false
}
**onReady.js**
module.exports = async (page, scenario, vp) => {
console.log('SCENARIO > ' + scenario.label);
await require('./clickAndHoverHelper')(page, scenario);
// add more ready handlers here...
console.log('is this running??')
console.log("backstopjs_ready_event")
};
output

Contributor guide
Assessment
This issue has not been assessed yet.