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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tests/menuNav.js +17 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "5.5.9",
3
+ "version": "5.5.10",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/menuNav.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  exports.reporter = async (page, withItems) => {
8
8
  // Initialize a report.
9
- const data = {
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
- const isCorrect = await testMenuItems(firstMenu, menuItems, 0, orientation, true);
242
- // Increment the data.
243
- data.totals.menus.total++;
244
- data.totals.menus[isCorrect ? 'correct' : 'incorrect']++;
245
- // Process the remaining menus.
246
- await testMenus(menus.slice(1));
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
  };