testaro 59.2.1 → 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.
- package/package.json +1 -1
- package/run.js +9 -0
- package/tests/testaro.js +5 -0
package/package.json
CHANGED
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):
|
package/tests/testaro.js
CHANGED
|
@@ -217,11 +217,16 @@ exports.reporter = async (page, report, actIndex) => {
|
|
|
217
217
|
? rules.slice(1)
|
|
218
218
|
: Object.keys(evalRules).filter(ruleID => ! rules.slice(1).includes(ruleID));
|
|
219
219
|
const calledContaminators = calledRules.filter(rule => contaminators.includes(rule)).sort();
|
|
220
|
+
const firstCalledContaminator = calledContaminators[0];
|
|
220
221
|
const calledBenignRules = calledRules.filter(rule => ! contaminators.includes(rule)).sort();
|
|
221
222
|
const testTimes = [];
|
|
222
223
|
let contaminatorsStarted = false;
|
|
223
224
|
// Starting with the noncontaminators, for each rule invoked:
|
|
224
225
|
for (const rule of calledBenignRules.concat(calledContaminators)) {
|
|
226
|
+
console.log(`Starting rule ${rule}`);
|
|
227
|
+
if (rule === firstCalledContaminator) {
|
|
228
|
+
console.log(' It is the first contaminator');
|
|
229
|
+
}
|
|
225
230
|
const pageClosed = page ? page.isClosed() : true;
|
|
226
231
|
const isContaminator = contaminators.includes(rule);
|
|
227
232
|
// If it is a contaminator other than the first one or the page has closed:
|