7b933f675a
* Tweak test set-up * Update azure config * Add cleaning test files and windows handling * Limit windows test to one at a time * Tweak test settings * Update tests splitting * remove custom concurrency for azure * Test Azure var * Update Azure config * bump * Simplify cleaning up
26 lines
613 B
JavaScript
26 lines
613 B
JavaScript
'use strict'
|
|
|
|
let globalTeardown = () => {}
|
|
const browser = global.bsBrowser
|
|
|
|
if (process.env.BROWSERSTACK) {
|
|
globalTeardown = () => global.browserStackLocal.killAllProcesses(() => {})
|
|
}
|
|
|
|
module.exports = async () => {
|
|
if (browser) {
|
|
// Close all remaining browser windows
|
|
try {
|
|
const windows = await browser.windowHandles()
|
|
for (const window of windows) {
|
|
if (!window) continue
|
|
await browser.window(window)
|
|
await browser.origClose()
|
|
await browser.quit()
|
|
await globalTeardown()
|
|
}
|
|
} catch (_) {}
|
|
} else {
|
|
await globalTeardown()
|
|
}
|
|
}
|