testaro 78.0.1 → 78.0.2
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.
- package/package.json +1 -1
- package/procs/launch.js +4 -2
package/package.json
CHANGED
package/procs/launch.js
CHANGED
|
@@ -83,9 +83,11 @@ const deSlash = url => (url || '').replace(/\/+$/, '');
|
|
|
83
83
|
// Close a browser context and/or its browser, if they exist.
|
|
84
84
|
const browserClose = exports.browserClose = async page => {
|
|
85
85
|
if (page) {
|
|
86
|
-
|
|
86
|
+
// Get the context (i.e. window) of the page and the browser of the context. These are methods, not properties; referencing them as properties made this function silently fail to close anything, because a function object has no close method and the resulting TypeError was caught and discarded.
|
|
87
|
+
const browserContext = page.context();
|
|
87
88
|
if (browserContext) {
|
|
88
|
-
|
|
89
|
+
// The browser is null for a context not owned by a browser, such as a persistent context.
|
|
90
|
+
const browser = browserContext.browser();
|
|
89
91
|
try {
|
|
90
92
|
await browserContext.close();
|
|
91
93
|
}
|