testaro 32.2.1 → 32.2.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/run.js +2 -0
- package/tests/qualWeb.js +8 -2
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -422,6 +422,8 @@ const launch = async (report, typeName, url, debug, waits, isLowMotion = false)
|
|
|
422
422
|
// Open a context (i.e. browser tab), with reduced motion if specified.
|
|
423
423
|
const options = {reduceMotion: isLowMotion ? 'reduce' : 'no-preference'};
|
|
424
424
|
const browserContext = await browser.newContext(options);
|
|
425
|
+
// Prevent default timeouts, including those arising from a Playwright bug.
|
|
426
|
+
browserContext.setDefaultTimeout(0);
|
|
425
427
|
// When a page (i.e. browser tab) is added to the browser context (i.e. browser window):
|
|
426
428
|
browserContext.on('page', async page => {
|
|
427
429
|
// If it emits a message:
|
package/tests/qualWeb.js
CHANGED
|
@@ -42,6 +42,7 @@ const clusterOptions = {
|
|
|
42
42
|
exports.reporter = async (page, options) => {
|
|
43
43
|
const {withNewContent, rules} = options;
|
|
44
44
|
const data = {};
|
|
45
|
+
let result = {};
|
|
45
46
|
// Start the QualWeb core engine.
|
|
46
47
|
await qualWeb.start(clusterOptions);
|
|
47
48
|
// Specify the invariant test options.
|
|
@@ -126,7 +127,7 @@ exports.reporter = async (page, options) => {
|
|
|
126
127
|
// Get the report.
|
|
127
128
|
let actReports = await qualWeb.evaluate(qualWebOptions);
|
|
128
129
|
// Remove the copy of the DOM from it.
|
|
129
|
-
|
|
130
|
+
result = actReports[withNewContent ? qualWebOptions.url : 'customHtml'];
|
|
130
131
|
if (result && result.system && result.system.page && result.system.page.dom) {
|
|
131
132
|
delete result.system.page.dom;
|
|
132
133
|
// For each test section of the act report:
|
|
@@ -202,8 +203,13 @@ exports.reporter = async (page, options) => {
|
|
|
202
203
|
};
|
|
203
204
|
}
|
|
204
205
|
catch(error) {
|
|
206
|
+
const message = error.message.slice(0, 200);
|
|
205
207
|
data.prevented = true;
|
|
206
|
-
data.error =
|
|
208
|
+
data.error = message;
|
|
209
|
+
result = {
|
|
210
|
+
prevented: true,
|
|
211
|
+
error: message
|
|
212
|
+
};
|
|
207
213
|
};
|
|
208
214
|
return {
|
|
209
215
|
data,
|