Skip to content

Conversation

@accendgroup-dave
Copy link

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.
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