TimeoutError when using "readyEvent": "backstopjs_ready"
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
On a newly initialized config the reference and test runs succeed. However, when I add "backstopjs_ready" to "readyEvent" I receive TimeoutError: timeout. If I revert by replacing "backstopjs_ready" with "", the runs succeed again.
```
macOS Sierra 10.12.6
Chrome: Version 61.0.3163.79 (Official Build) (64-bit)
$ node --version
v8.4.0
$ backstop --version
BackstopJS v3.0.24
BackstopJS 3.0.24
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "chromy/onBefore.js",
"onReadyScript": "chromy/onReady.js",
"scenarios": [
{
"label": "https://bpcoll.glynndevinsdigital.com/",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://bpcoll.glynndevinsdigital.com/",
"referenceUrl": "",
"readyEvent": "backstopjs_ready",
"readySelector": "",
"delay": 0,
"hideSelectors": [
"#trackduck",
"#player"
],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": "",
"selectors": [],
"selectorExpansion": true,
"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": "chrome",
"engineFlags": [],
"debug": false,
"debugWindow": false
}
```
Output
```
$ backstop reference
BackstopJS v3.0.24
Loading config: /Users/jroberts/Virtual/qa-render-test-app/sites/bpcoll.glynndevinsdigital.com/backstop.json
COMMAND | Executing core for `reference`
clean | backstop_data/bitmaps_reference was cleaned.
createBitmaps | Selected 1 of 1 scenarios.
Starting Chromy: port:9222 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=320,480
CREATING NEW REFERENCE FILES
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction",
"url": "https://.www.yourdomain.com"
}
]
SCENARIO > https://bpcoll.glynndevinsdigital.com/
Starting Chromy: port:9223 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=1024,768
CREATING NEW REFERENCE FILES
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction",
"url": "https://.www.yourdomain.com"
}
]
SCENARIO > https://bpcoll.glynndevinsdigital.com/
9222 LOG > JQMIGRATE: Migrate is installed with logging active, version 1.4.1
9222 LOG > console.trace
9223 LOG > JQMIGRATE: Migrate is installed with logging active, version 1.4.1
9223 LOG > console.trace
9222 LOG > backstopjs_ready
9223 LOG > backstopjs_ready
COMMAND | Command `reference` ended with an error after [33.776s]
COMMAND | BackstopException: https://bpcoll.glynndevinsdigital.com/ on undefined: TimeoutError: timeout
```
After I revert:
```
$ backstop reference
BackstopJS v3.0.24
Loading config: /Users/jroberts/Virtual/qa-render-test-app/sites/bpcoll.glynndevinsdigital.com/backstop.json
COMMAND | Executing core for `reference`
clean | backstop_data/bitmaps_reference was cleaned.
createBitmaps | Selected 1 of 1 scenarios.
Starting Chromy: port:9222 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=320,480
CREATING NEW REFERENCE FILES
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction",
"url": "https://.www.yourdomain.com"
}
]
SCENARIO > https://bpcoll.glynndevinsdigital.com/
Starting Chromy: port:9223 --disable-gpu,--force-device-scale-factor=1,--disable-infobars=true,--window-size=1024,768
CREATING NEW REFERENCE FILES
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "no_restriction",
"url": "https://.www.yourdomain.com"
}
]
SCENARIO > https://bpcoll.glynndevinsdigital.com/
9222 LOG > JQMIGRATE: Migrate is installed with logging active, version 1.4.1
9222 LOG > console.trace
9223 LOG > JQMIGRATE: Migrate is installed with logging active, version 1.4.1
9223 LOG > console.trace
9222 LOG > backstopjs_ready
9223 LOG > backstopjs_ready
Run `$ backstop test` to generate diff report.
COMMAND | Command `reference` sucessfully executed in [6.965s]
```
Contributor guide
Research direction
Start with the readyEvent handling used by the scenario in backstop.json, then reproduce the issue with the shown BackstopJS 3.0.24 configuration by running backstop reference. Done means a configured backstopjs_ready event no longer causes TimeoutError and the reference command completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100