testaro 70.0.2 → 70.0.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "70.0.2",
3
+ "version": "70.0.3",
4
4
  "description": "Run 1000 web accessibility tests from 11 tools and get a standardized report",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/tests/alfa.js CHANGED
@@ -140,9 +140,17 @@ exports.reporter = async (page, report, actIndex) => {
140
140
  };
141
141
  }
142
142
  catch(error) {
143
- console.log(`ERROR: Navigation to URL timed out (${error})`);
144
143
  data.prevented = true;
145
- data.error = 'ERROR: Act failed';
144
+ const {message} = error;
145
+ if (message) {
146
+ if (message.includes('Unsupported node of type: 4')) {
147
+ data.error = 'Alfa cannot test page because it contains CDATA';
148
+ }
149
+ else {
150
+ data.error = message;
151
+ }
152
+ }
153
+ console.log(`ERROR: ${data.error}`);
146
154
  }
147
155
  return {
148
156
  data,
package/tests/wave.js CHANGED
@@ -132,9 +132,14 @@ exports.reporter = async (page, report, actIndex) => {
132
132
  for (const index in selectors) {
133
133
  const selector = selectors[index];
134
134
  // Get the violator.
135
- const violator = document.querySelector(selector);
136
- // Concatenate its selector with its XPath in the native result.
137
- selectors[index] = [selector, window.getXPath(violator) ?? ''];
135
+ let violator;
136
+ try {
137
+ violator = document.querySelector(selector);
138
+ // Concatenate its selector with its XPath in the native result.
139
+ selectors[index] = [selector, window.getXPath(violator) ?? ''];
140
+ } catch (error) {
141
+ console.error(`ERROR: Invalid selector: ${selector} (${error.message})`);
142
+ }
138
143
  }
139
144
  });
140
145
  return items;