How JSON Accessibility Results are Stored on Disk

Link to How JSON Accessibility Results are Stored on Disk copied to clipboard

File and directory naming with JSON Accessibility Results

The results data format consists of the following:

  1. The way that axe DevTools CLI uses the file system directories to organize the files that contain the data for an individual page-state,
  2. The algorithm that axe DevTools CLI uses for naming these individual files, and
  3. The format of the JSON data inside each file.

The Directory Structure

The reporter API will store the output files in the folder that is passed as the optional dirPath parameter to the AxeDevTool.report(testCaseName[, dirPath]) function call. If no value is provided, the current working directory will be used.

Axe DevTools CLI stores results output in a folder named with the value of the id property in the CLI specification file. This directory is created automatically when CLI is called. If the folder already exists, it is renamed to id-{Date.now().toString()} and then a new, empty folder is created with the id property.

Each individual analysis result is stored in a .json file within this folder.

Results file names

The name of each individual file is formed using the value of the id property (in the spec file in CLI or passed into the reporter through the API) and the value of the pageState. The complete file name is constructed using these two values in the following way {id}-{pageState}.json.

So if the id is deque and pageState is homepage-initial, then the resulting filename would be deque-homepage-initial.json.

In CLI, pageState is constructed by the combination of the name property of the entry in the pageList and the value of the title property in the analyze statement. These are combined by concatenating the two values, separated by a dash as would be the case using the following JavaScript template string: ${name}-${title}

The reporter API uses the id parameter that is passed to the reporter.logTestResult function call as the pageSate value.