garris / garris/BackstopJS

Using Readyevent on scenario halts execution of BackstopJS

Aperta
#1,069 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
7.2k
Fork
621
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

![Screen Shot 2019-07-12 at 5 22 01 PM](https://user-images.githubusercontent.com/10711625/61159306-9a8fae00-a4c9-11e9-9828-b7b3c9ffbabd.png)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da backstop.json e puppet/onReady.js, quindi riproduci il comportamento segnalato usando la configurazione vanilla e BackstopJS v4.1.9. Traccia la gestione di ReadyEvent per lo scenario configurato e conferma se l'esecuzione procede come previsto; il lavoro è completato quando la causa e il comportamento previsto sono stabiliti con un risultato riproducibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
testing
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.