testaro 4.5.0 → 4.5.1

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/run.js +9 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/run.js CHANGED
@@ -291,7 +291,7 @@ const textOf = async (page, element) => {
291
291
  if (['A', 'BUTTON', 'INPUT', 'SELECT'].includes(tagName)) {
292
292
  // Return its visible labels, descriptions, and legend if the first input in a fieldset.
293
293
  totalText = await page.evaluate(element => {
294
- const {tagName} = element;
294
+ const {tagName, ariaLabel} = element;
295
295
  let ownText = '';
296
296
  if (['A', 'BUTTON'].includes(tagName)) {
297
297
  ownText = element.textContent;
@@ -302,6 +302,9 @@ const textOf = async (page, element) => {
302
302
  // HTML link elements have no labels property.
303
303
  const labels = tagName !== 'A' ? Array.from(element.labels) : [];
304
304
  const labelTexts = labels.map(label => label.textContent);
305
+ if (ariaLabel) {
306
+ labelTexts.push(ariaLabel);
307
+ }
305
308
  const refIDs = new Set([
306
309
  element.getAttribute('aria-labelledby') || '',
307
310
  element.getAttribute('aria-describedby') || ''
@@ -616,7 +619,7 @@ const doActs = async (report, actIndex, page) => {
616
619
  if (truth[1]) {
617
620
  // If the performance of commands is to stop:
618
621
  if (act.jump === 0) {
619
- // Set the act index to cause a stop.
622
+ // Stop.
620
623
  actIndex = -2;
621
624
  }
622
625
  // Otherwise, if there is a numerical jump:
@@ -1019,9 +1022,10 @@ const doActs = async (report, actIndex, page) => {
1019
1022
  }
1020
1023
  // Otherwise, i.e. if no match was found:
1021
1024
  else {
1022
- const report = 'ERROR: Specified element not found';
1023
- act.result = report;
1024
- console.log(report);
1025
+ // Stop.
1026
+ act.result = matchResult;
1027
+ console.log('ERROR: Specified element not found');
1028
+ actIndex = -2;
1025
1029
  }
1026
1030
  }
1027
1031
  // Otherwise, if the act is a keypress: