testaro 5.5.9 → 5.5.10
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/menuNav.js +17 -7
package/package.json
CHANGED
package/tests/menuNav.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
exports.reporter = async (page, withItems) => {
|
|
8
8
|
// Initialize a report.
|
|
9
|
-
|
|
9
|
+
let data = {
|
|
10
10
|
totals: {
|
|
11
11
|
navigations: {
|
|
12
12
|
all: {
|
|
@@ -238,12 +238,22 @@ exports.reporter = async (page, withItems) => {
|
|
|
238
238
|
// If the menu contains at least 2 direct menu items:
|
|
239
239
|
if (menuItems.length > 1) {
|
|
240
240
|
// Test its menu items.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
let isCorrect = false;
|
|
242
|
+
try {
|
|
243
|
+
isCorrect = await testMenuItems(firstMenu, menuItems, 0, orientation, true);
|
|
244
|
+
// Increment the data.
|
|
245
|
+
data.totals.menus.total++;
|
|
246
|
+
data.totals.menus[isCorrect ? 'correct' : 'incorrect']++;
|
|
247
|
+
// Process the remaining menus.
|
|
248
|
+
await testMenus(menus.slice(1));
|
|
249
|
+
}
|
|
250
|
+
catch(error) {
|
|
251
|
+
console.log(`ERROR: menuNav could not perform tests (${error.message})`);
|
|
252
|
+
data = {
|
|
253
|
+
prevented: true,
|
|
254
|
+
error: error.message
|
|
255
|
+
};
|
|
256
|
+
}
|
|
247
257
|
}
|
|
248
258
|
}
|
|
249
259
|
};
|