FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update openReport.js to wait=true by accendgroup-dave · Pull Request #1612 · garris/BackstopJS · GitHub

Update openReport.js to wait=true - #1612

Open
accendgroup-dave wants to merge 1 commit into
garris:masterfrom
accendgroup-dave:patch-1
Open

Update openReport.js to wait=true#1612
accendgroup-dave wants to merge 1 commit into
garris:masterfrom
accendgroup-dave:patch-1

Conversation

Copy link
Copy Markdown

This probably isn't a great solution, but I don't think this project is active anymore anyways. Mostly just opening this PR hoping that it will help somebody else who runs into the same issue as me.

This may not be advised, but I'm running backstop within a javascript file:

const backstop = require('backstopjs');
backstop(command, {
  config: CONFIG_FILE,
  filter
});

Any time a scenario compare failed, openReport.js would fail to open the HTML report. Turns out it was because an uncaught promise exception was causing my application to abort before the broswer window could open. I was able to resolve this by handling the return promise's error, which ensured the browser window would open:

const backstop = require('backstopjs');
backstop(command, {
  config: CONFIG_FILE,
  filter
}).catch(() => {});

Unfortunately, this is undocumented and unexpected. An alternative solution, as proposed by this PR, is to run the open() command with config { wait: true }, which prevents the error from being handled before the report opens.

This probably isn't a great solution, but I don't think this project is active anymore anyways.  Mostly just opening this PR hoping that it will help somebody else who runs into the same issue as me.

This may not be advised, but I'm running backstop within a javascript file:
```const backstop = require('backstopjs');
backstop(command, {
  config: CONFIG_FILE,
  filter
});```

Any time a scenario compare failed, openReport.js would fail to open the HTML report.  Turns out it was because an uncaught promise exception was causing my application to abort before the broswer window could open.  I was able to resolve this by handling the return promise's error, which ensured the browser window would open:
```const backstop = require('backstopjs');
backstop(command, {
  config: CONFIG_FILE,
  filter
}).catch(() => {});```

Unfortunately, this is undocumented and unexpected.  An alternative solution, as proposed by this PR, is to run the `open()` command with config `{ wait: true }`, which prevents the error from being handled before the report opens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL