@bucky24/jsbehave 0.12.8 → 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 +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bucky24/jsbehave",
3
- "version": "0.12.8",
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();
@@ -450,7 +451,7 @@ async function takeScreenshot(test) {
450
451
  console.error(`Unable to take screenshot - driver does not exist`);
451
452
  return;
452
453
  }
453
- const image = activeDriver.takeScreenshot();
454
+ const image = await activeDriver.takeScreenshot();
454
455
  const useTest = test.replace(/ /g, "_");
455
456
  let configPath = getVariable("screenshotDirectory");
456
457
  const fileName = `test_${useTest}_failure_${activeBrowser}.png`;