@bucky24/jsbehave 0.12.7 → 0.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bucky24/jsbehave",
3
- "version": "0.12.7",
3
+ "version": "0.12.9",
4
4
  "description": "A module that allows BDD testing for browser based testing in Selenium.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -381,7 +381,8 @@ function setActiveBrowser([ name ]) {
381
381
  function closeBrowserWithName([ name ]) {
382
382
  const driver = getVariable(`jsbehave.driver.${name}`);
383
383
  if (!driver) {
384
- throw new Error(`Unable to close browser with name "${name}": no driver found`);
384
+ console.log(`Unable to close browser with name "${name}": no driver found`);
385
+ return;
385
386
  }
386
387
  delete variables[`jsbehave.driver.${name}`];
387
388
  return driver.close();
@@ -448,8 +449,9 @@ async function takeScreenshot(test) {
448
449
  if (!activeDriver) {
449
450
  // don't throw, we get here when an error happens so we're already handling a problem
450
451
  console.error(`Unable to take screenshot - driver does not exist`);
452
+ return;
451
453
  }
452
- const image = activeDriver.takeScreenshot();
454
+ const image = await activeDriver.takeScreenshot();
453
455
  const useTest = test.replace(/ /g, "_");
454
456
  let configPath = getVariable("screenshotDirectory");
455
457
  const fileName = `test_${useTest}_failure_${activeBrowser}.png`;