testaro 59.2.2 → 59.2.3

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/run.js +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "59.2.2",
3
+ "version": "59.2.3",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/run.js CHANGED
@@ -100,6 +100,7 @@ const tmpDir = os.tmpdir();
100
100
 
101
101
  // Facts about the current session.
102
102
  let actCount = 0;
103
+ let browserCloseIntentional = false;
103
104
  // Facts about the current act.
104
105
  let actIndex = 0;
105
106
  let browser;
@@ -216,7 +217,9 @@ const browserClose = async () => {
216
217
  if (browser) {
217
218
  for (const context of browser.contexts()) {
218
219
  try {
220
+ browserCloseIntentional = true;
219
221
  await context.close();
222
+ browserCloseIntentional = false;
220
223
  }
221
224
  catch(error) {
222
225
  console.log(
@@ -283,6 +286,12 @@ const launch = exports.launch = async (report, debug, waits, tempBrowserID, temp
283
286
  browser = await browserType.launch(browserOptions);
284
287
  // Open a context (i.e. browser window).
285
288
  const browserContext = await browser.newContext(device.windowOptions);
289
+ // Create a diagnostic listener for its unintentional closing.
290
+ browserContext.on('close', () => {
291
+ if (! browserCloseIntentional) {
292
+ console.log(new Error('Browser context closed').stack);
293
+ }
294
+ });
286
295
  // Prevent default timeouts.
287
296
  browserContext.setDefaultTimeout(0);
288
297
  // When a page (i.e. browser tab) is added to the browser context (i.e. browser window):