Skip to content

Commit

Permalink
test throw error navigateToCustomChart is error
Browse files Browse the repository at this point in the history
  • Loading branch information
jalezi committed Apr 23, 2021
1 parent a8895f9 commit 2aec4e2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,16 @@ const run = async (
}

if (customChartName) {
await navigateToCustomChart({
const error = await navigateToCustomChart({
page,
element,
screenshot,
chosenScreenshot,
customChartName,
});
if (error instanceof Error) {
throw error;
}
}

image = await element.screenshot({ type: 'png' });
Expand All @@ -121,12 +124,13 @@ const run = async (

fs.writeFileSync(`images/${filename}`, image);
} catch (error) {
throw new Error(error);
throw error;
} finally {
browser && (await browser.close());
console.log('Browser closed');
}
return image;
};

(async () => await run({ type: 'multicard', screen: 'ALL' }, false))();
(async () =>
await run({ type: 'multicard', screen: 'HOS', custom: '' }, false))();

0 comments on commit 2aec4e2

Please sign in to comment.