Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test.after.always(async () => {
if (global.browser) {
await closeBrowser(global.browser)
}
})
}
newTest.beforeEach(async t => {
t.context.browser = await openBrowser(global.chromePath)
})
export default async function(
{ puppeteer: { browser } }: Browser,
url: string,
options: ?Options
): Promise {
const page = await browser.newPage()
const tab = makeTab(browser, page)
if (options) {
await navigate(tab, url, options)
} else {
await navigate(tab, url)
}
return tab
}
export default async function(
{ puppeteer: { browser } }: Browser,
url: string,
options: ?Options
): Promise {
const page = await browser.newPage()
const tab = makeTab(browser, page)
if (options) {
await navigate(tab, url, options)
} else {
await navigate(tab, url)
}
return tab
}
return pages.map(page => makeTab(browser, page))
},
export default async function(
{ puppeteer: { browser } }: Browser,
url: string,
options: ?Options
): Promise {
const page = await browser.newPage()
const tab = makeTab(browser, page)
if (options) {
await navigate(tab, url, options)
} else {
await navigate(tab, url)
}
return tab
}