Error while running on SVG file
- Dominant language
- JavaScript
- Stars
- 7.2k
- Forks
- 621
- PR merge metrics
- No merged PRs in 30d
Description
I get the following error when trying to run Backstop on an SVG file:
```
Andys-iMac:pdfcmd achou$ yarn backstop-test
yarn run v1.3.2
$ backstop test
BackstopJS v3.1.19
Loading config: /Users/achou/Code/pdfcmd/backstop.json
COMMAND | Executing core for `test`
createBitmaps | Selected 1 of 1 scenarios.
searching for 1 available ports.
These ports will be used: [9222]
Starting Chromy: {"chromeFlags":["--disable-gpu","--force-device-scale-factor=1","--disable-infobars=true","--window-size=1024,768"],"port":9222,"waitTimeout":30000,"visible":true}
Cookie state restored with: []
SCENARIO > text-1
9222 Chrome v64 detected.
9222 INFO > BackstopTools have been installed.
COMMAND | Command `test` ended with an error after [1.963s]
COMMAND | Error: An error has occurred evaluating the script in the browser.TypeError: Cannot read property 'scrollWidth' of null
at :5:40
at :10:17
error Command failed with exit code 1.
```
As far as I can tell this happens for pretty much any SVG. If I wrap the SVG in an HTML file, Backstop works fine.
Contributor guide
Research direction
Start by reproducing the error with the reported `backstop test` command and the `backstop.json` configuration against a standalone SVG. Trace the browser-side evaluation that reads `scrollWidth`, then compare it with the working HTML-wrapper case. Done means standalone SVG scenarios run successfully without the null `scrollWidth` error and existing tests remain passing.
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