opena11y / fae-util-node

Utility used by FAE technologies to spider and analyze web pages using OpenAjax evaluation library using the chrome browser
Apache License 2.0
1 stars 1 forks source link

fae-util-2

Utility used by FAE technologies to spider and analyze web pages using OpenAjax evaluation library in Google Chromium browser.

Overview

Installation and Usage

For example, to use the shaverscreek.json configuration file in testFiles folder, you should use the command

node fae-util-2.js -c ./testFiles/shaverscreek

Specifying Configuration File

You need to specify a configuration file using the -c flag as a command line argument. Its usage its as follows

-c  <./location_of_config_file/configuration_file_name>

Configuration File Format and Options

A valid configuration file will have the following format

{
    "urls": <array of strings>,
    "maxPages": <number>,
    "wait": <number>,
    "delay": <number>,
    "ruleset": <aria_ruleset>,
    "outputDirectory": <string>,
    "version": <string>,
    "authorization": <boolean>,
    "credentials": {
        "username": <string>,
        "password": <string>
    },
    "path": <string>,
    "spanDomains": <array of strings>,
    "includeDomains": <array of strings>,
    "excludeDomains": <array of strings>,
    "depth": <number>,
    "exportOption": <string>,
    "debug": <string>,
    "excluded_extensions": <array of strings>,
    "excluded_prefixes": <array of strings>
}

An example configuration file for Shaverscreek website.

Running the Evaluation Library and getting Evaluation Results

async function evaluateRules(passedRuleset) {
  var doc = window.document;
  var ruleset = OpenAjax.a11y.RulesetManager.getRuleset(passedRuleset);
  var evaluator_factory = OpenAjax.a11y.EvaluatorFactory.newInstance();
  evaluator_factory.setParameter('ruleset', ruleset);
  evaluator_factory.setFeature('eventProcessing', 'fae-util');
  evaluator_factory.setFeature('groups', 7);
  var evaluator = evaluator_factory.newEvaluator();
  var evaluation = evaluator.evaluate(doc, doc.title, doc.location.href);
  var out = evaluation.toJSON(true);
  return out;

Output Files

The script will output the following JSON files.

Example evaluation output.