testaro 57.3.0 → 57.4.0
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/doTestAct.js +14 -3
- package/run.js +8 -6
- package/tests/ed11y.js +7 -9
package/package.json
CHANGED
package/procs/doTestAct.js
CHANGED
|
@@ -54,7 +54,7 @@ const doTestAct = async () => {
|
|
|
54
54
|
// Get the saved report.
|
|
55
55
|
const reportJSON = await fs.readFile(reportPath, 'utf8');
|
|
56
56
|
const report = JSON.parse(reportJSON);
|
|
57
|
-
// Get the act.
|
|
57
|
+
// Get a reference to the act in the report.
|
|
58
58
|
const act = report.acts[actIndex];
|
|
59
59
|
// Get the tool name.
|
|
60
60
|
const {which} = act;
|
|
@@ -94,7 +94,7 @@ const doTestAct = async () => {
|
|
|
94
94
|
act.data = actReport.data;
|
|
95
95
|
act.result = actReport.result;
|
|
96
96
|
// If the tool reported that the page prevented testing:
|
|
97
|
-
if (
|
|
97
|
+
if (act.data && act.data.prevented) {
|
|
98
98
|
// Add prevention data to the job data.
|
|
99
99
|
report.jobData.preventions[which] = act.data.error;
|
|
100
100
|
}
|
|
@@ -118,8 +118,19 @@ const doTestAct = async () => {
|
|
|
118
118
|
}
|
|
119
119
|
// Otherwise, i.e. if the page does not exist:
|
|
120
120
|
else {
|
|
121
|
+
// Add data to the act.
|
|
122
|
+
act.data ??= {};
|
|
123
|
+
act.data.prevented = true;
|
|
124
|
+
act.data.error = 'No page';
|
|
125
|
+
// Add prevention data to the job data.
|
|
126
|
+
report.jobData.preventions[which] = act.data.error;
|
|
127
|
+
// Save the revised report.
|
|
128
|
+
const reportJSON = JSON.stringify(report);
|
|
129
|
+
await fs.writeFile(reportPath, reportJSON);
|
|
121
130
|
// Report this.
|
|
122
|
-
|
|
131
|
+
const message = 'ERROR: No page';
|
|
132
|
+
console.log(message);
|
|
133
|
+
process.send(message);
|
|
123
134
|
}
|
|
124
135
|
}
|
|
125
136
|
};
|
package/run.js
CHANGED
|
@@ -174,7 +174,7 @@ const goTo = async (report, page, url, timeout, waitUntil) => {
|
|
|
174
174
|
// Otherwise, if the response status was rejection of excessive requests:
|
|
175
175
|
else if (httpStatus === 429) {
|
|
176
176
|
// Return this.
|
|
177
|
-
console.log(`Visit to ${url} prevented by request frequency
|
|
177
|
+
console.log(`ERROR: Visit to ${url} prevented by request frequency limit (status 429)`);
|
|
178
178
|
return {
|
|
179
179
|
success: false,
|
|
180
180
|
error: 'status429'
|
|
@@ -633,8 +633,9 @@ const doActs = async (report) => {
|
|
|
633
633
|
// If this failed:
|
|
634
634
|
if (page.prevented) {
|
|
635
635
|
// Add this to the act.
|
|
636
|
-
act.
|
|
637
|
-
act.
|
|
636
|
+
act.data ??= {};
|
|
637
|
+
act.data.prevented = true;
|
|
638
|
+
act.data.error = page.error || '';
|
|
638
639
|
}
|
|
639
640
|
}
|
|
640
641
|
// Otherwise, if the act is a test act:
|
|
@@ -708,8 +709,9 @@ const doActs = async (report) => {
|
|
|
708
709
|
// If this failed:
|
|
709
710
|
if (page.prevented) {
|
|
710
711
|
// Add this to the act.
|
|
711
|
-
act.
|
|
712
|
-
act.
|
|
712
|
+
act.data ??= {};
|
|
713
|
+
act.data.prevented = true;
|
|
714
|
+
act.data.error = page.error || '';
|
|
713
715
|
}
|
|
714
716
|
// Otherwise, i.e. if it succeeded:
|
|
715
717
|
else {
|
|
@@ -782,7 +784,7 @@ const doActs = async (report) => {
|
|
|
782
784
|
act.result.url = page.url();
|
|
783
785
|
// If a prohibited redirection occurred:
|
|
784
786
|
if (response.exception === 'badRedirection') {
|
|
785
|
-
// Report this
|
|
787
|
+
// Report this.
|
|
786
788
|
addError(true, false, report, actIndex, 'ERROR: Navigation illicitly redirected');
|
|
787
789
|
}
|
|
788
790
|
}
|
package/tests/ed11y.js
CHANGED
|
@@ -187,10 +187,12 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
// Return the data and result, discarding the separate element data.
|
|
190
|
+
const data = {};
|
|
191
|
+
if (result.prevented) {
|
|
192
|
+
data.prevented = true;
|
|
193
|
+
}
|
|
190
194
|
return {
|
|
191
|
-
data
|
|
192
|
-
prevented: result.prevented
|
|
193
|
-
},
|
|
195
|
+
data,
|
|
194
196
|
result
|
|
195
197
|
};
|
|
196
198
|
}
|
|
@@ -198,12 +200,8 @@ exports.reporter = async (page, report, actIndex, timeLimit) => {
|
|
|
198
200
|
else {
|
|
199
201
|
// Return this.
|
|
200
202
|
return {
|
|
201
|
-
data: {
|
|
202
|
-
|
|
203
|
-
},
|
|
204
|
-
result: {
|
|
205
|
-
prevented: false,
|
|
206
|
-
}
|
|
203
|
+
data: {},
|
|
204
|
+
result: {}
|
|
207
205
|
}
|
|
208
206
|
}
|
|
209
207
|
};
|