testaro 12.2.5 → 12.2.6
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/tests/ibm.js +20 -8
package/package.json
CHANGED
package/tests/ibm.js
CHANGED
|
@@ -124,21 +124,33 @@ exports.reporter = async (page, withItems, withNewContent, rules) => {
|
|
|
124
124
|
const result = {};
|
|
125
125
|
if (! withNewContent) {
|
|
126
126
|
const timeLimit = 20;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
try {
|
|
128
|
+
const typeContent = await page.content();
|
|
129
|
+
result.content = await doTest(typeContent, withItems, timeLimit, rules);
|
|
130
|
+
if (result.content.prevented) {
|
|
131
|
+
result.prevented = true;
|
|
132
|
+
console.log(`ERROR: Getting ibm test report from page timed out at ${timeLimit} seconds`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch(error) {
|
|
130
136
|
result.prevented = true;
|
|
131
|
-
console.log(`ERROR:
|
|
137
|
+
console.log(`ERROR: ibm test on page crashed with error ${error.message.slice(0, 200)}`);
|
|
132
138
|
}
|
|
133
139
|
}
|
|
134
140
|
// If a test with new content is to be performed:
|
|
135
141
|
if ([true, undefined].includes(withNewContent)) {
|
|
136
142
|
const timeLimit = 20;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
try {
|
|
144
|
+
const typeContent = page.url();
|
|
145
|
+
result.url = await doTest(typeContent, withItems, timeLimit, rules);
|
|
146
|
+
if (result.url.prevented) {
|
|
147
|
+
result.prevented = true;
|
|
148
|
+
console.log(`ERROR: Getting ibm test report from URL timed out at ${timeLimit} seconds`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch(error) {
|
|
140
152
|
result.prevented = true;
|
|
141
|
-
console.log(`ERROR:
|
|
153
|
+
console.log(`ERROR: ibm test on URL crashed with error ${error.message.slice(0, 200)}`);
|
|
142
154
|
}
|
|
143
155
|
}
|
|
144
156
|
// Return the result. Execution of close() crashed the Node process.
|