Socket
Socket
Sign inDemoInstall

@qualweb/cli

Package Overview
Dependencies
231
Maintainers
3
Versions
117
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @qualweb/cli

QualWeb evaluator command line interface


Version published
Maintainers
3
Created

Readme

Source

QualWeb CLI

QualWeb command line interface. It allows you to perform accessibility evaluations from the terminal. It uses the @qualweb/core that contains 3 evaluation modules:

You can also perform evaluations at http://qualweb.di.fc.ul.pt/evaluator/, or by installing the chrome extension.

How to install

  $ npm i -g @qualweb/cli

How to run

Url input

Simple evaluation
  $ qw -u https://act-rules.github.io/pages/about/
Evaluation with EARL report
  $ qw -u https://act-rules.github.io/pages/about/ -r earl

File input

If you want to evaluate multiple url's at once, you can input a file with each url separated by a newline \n.

Example
  $ qw -f urls.txt
Evaluation with EARL report

This method will create an EARL report for each url.

  $ qw -f urls.txt -r earl

This method will create an aggregated EARL report from all urls.

  $ qw -f urls.txt -r earl-a # add `-s <save-name>` to rename the report file

Options

Usage options

AliasCommandValueInformation
-u--url<url>Url to evaluate
-f--file<path-to-file>File with urls to evaluate
-c--crawl<domain>Domain to crawl
-m--moduleact wcag bpChoose which modules to execute
-r--report-type"earl" or "earl-a"Convert the evaluation to earl or earl-a (earl-aggregated)
-s--save-name<name>The name to save the aggregated earl reports (earl-a)
-t--timeout<number>Timeout for page to load
-w--waitUntilload doncontentloaded networkidle0 networkidle2Events to wait before starting evaluation
-p--maxParallelEvaluations<number>Evaluates multiples urls ate the same time (experimental)
-j--json<file>Loads a json file with the configs to execute. Check an example below
-h--helpPrint the help menu

-j, --json config file example

This command replaces all other commands.

{
  "url": "https://act-rules.github.io/pages/about/",
  "file": "test_url.txt",
  "crawl": "https://act-rules.github.io",
  "viewport": {
    "mobile": false,
    "orientation": "landscape",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:22.0) Gecko/20100101 Firefox/22.0', default value for mobile = 'Mozilla/5.0 (Linux; U; Android 2.2; en-us; DROID2 GLOBAL Build/S273) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
    "width": 1920,
    "height": 1080
  },
  "maxParallelEvaluations": "5",
  "modules": {
    "act": true,
    "wcag": true,
    "bp": true,
    "counter": false,
  },
  "act-rules": {
    "rules": ["QW-ACT-R1"],
    "exclude": ["QW-ACT-R2"],
    "levels": ["A", "AA", "AAA"],
    "principles": ["Perceivable", "Operable", "Understandable", "Robust"]
  },
  "wcag-techniques": {
    "rules": ["QW-WCAG-T1"],
    "exclude": ["QW-WCAG-T2"],
    "levels": ["A", "AA", "AAA"],
    "principles": ["Perceivable", "Operable", "Understandable", "Robust"]
  },
  "best-practices": {
    "bestPractices": ["QW-BP1"],
    "exclude": ["QW-BP2"]
  }
}

Viewport Options

AliasCommandValueInformation
-v--viewportUse custom viewport
--mobileUse a mobile context (default: desktop)
--orientation"portrait" or "landscape"Set window orientation (default desktop: landscape, default mobile: portrait)
--user-agent<custom-user-agent>Set custom user agent
--width<number in px>Set custom viewport width (default desktop: 1366, default mobile: 1080)
--height<number in px>Set custom viewport height (default desktop: 768, default mobile: 1920)

Modules options

CommandValueInformation
--act-rules"ruleId1 ruleId2 ... ruleIdx" or <config file>Choose which act rules to execute. For config file check below
--exclude-act"ruleId1 ruleId2 ... ruleIdx" or <config file>Choose which act rules to exclude. For config file check below
--act-levelsA AA AAAChoose which conform levels to evaluate regarding the act rules
--act-principlesPerceivable Operable Understandable RobustChoose which principles to evaluate regarding the act rules
--wcag-techniques"techniqueId1 techniqueId2 ... techniqueIdx" or <config file>Choose which wcag techniques to execute. For config file check below
--exclude-wcag"techniqueId1 techniqueId2 ... techniqueIdx" or <config file>Choose which wcag techniques to exclude. For config file check below
--wcag-levelsA AA AAAChoose which conform levels to evaluate regarding the wcag techniques
--wcag-principlesPerceivable Operable Understandable RobustChoose which principles to evaluate regarding the wcag techniques
--best-practicesbestpracticeId1 bestpracticeId2 ... bestpracticeIdxChoose which best practices to execute. For config file check below
--exclude-bpbestpracticeId1 bestpracticeId2 ... bestpracticeIdxChoose which best practices to exclude. For config file check below

Note: The module options above are only used if the correspondent module was set to be executed (command -m).

--act-rules config file example

This config file can replace commands --act-rules, --act-levels and --act-principles.

{
  "act-rules": {
    "rules": ["QW-ACT-R1"],
    "exclude": ["QW-ACT-R2"],
    "levels": ["A", "AA", "AAA"],
    "principles": ["Perceivable", "Operable", "Understandable", "Robust"]
  }
}
--wcag-techniques config file example

This config file can replace commands --wcag-techniques, --wcag-levels and --wcag-principles.

{
  "wcag-techniques": {
    "techniques": ["QW-WCAG-T1"],
    "exclude": ["QW-WCAG-T2"],
    "levels": ["A", "AA", "AAA"],
    "principles": ["Perceivable", "Operable", "Understandable", "Robust"]
  }
}
--best-practices config file example
{
  "best-practices": {
    "bestPractices": ["QW-BP1"],
    "exclude": ["QW-BP2"]
  }
}

Implemented ACT Rules

QualWeb Rule IDACT Rule IDACT Rule Name
QW-ACT-R12779a5HTML Page has a title
QW-ACT-R2b5c3f8HTML has lang attribute
QW-ACT-R35b7ae0HTML lang and xml:lang match
QW-ACT-R4bc659aMeta-refresh no delay
QW-ACT-R5bf051aValidity of HTML Lang attribute
QW-ACT-R659796fImage button has accessible name
QW-ACT-R7b33effOrientation of the page is not restricted using CSS transform property
QW-ACT-R9b20e66Links with identical accessible names have equivalent purpose
QW-ACT-R104b1c6ciframe elements with identical accessible names have equivalent purpose
QW-ACT-R1197a4e1Button has accessible name
QW-ACT-R12c487aeLink has accessible name
QW-ACT-R136cfa84Element with aria-hidden has no focusable content
QW-ACT-R14b4f0c3meta viewport does not prevent zoom
QW-ACT-R1580f0bfaudio or video has no audio that plays automatically
QW-ACT-R16e086e5Form control has accessible name
QW-ACT-R1723a2a8Image has accessible name
QW-ACT-R183ea0c8id attribute value is unique
QW-ACT-R19cae760iframe element has accessible name
QW-ACT-R20674b10role attribute has valid value
QW-ACT-R217d6734svg element with explicit role has accessible name
QW-ACT-R22de46e4Element within body has valid lang attribute
QW-ACT-R23c5a4eavideo element visual content has accessible alternative
QW-ACT-R2473f2c2autocomplete attribute has valid value
QW-ACT-R255c01eaARIA state or property is permitted
QW-ACT-R26eac66bvideo element auditory content has accessible alternative
QW-ACT-R275f99a7This rule checks that each aria- attribute specified is defined in ARIA 1.1.
QW-ACT-R284e8ab6Element with role attribute has required states and properties
QW-ACT-R29e7aa44Audio element content has text alternative
QW-ACT-R302ee8b8Visible label is part of accessible name
QW-ACT-R31c3232fVideo element visual-only content has accessible alternative
QW-ACT-R321ec09bvideo element visual content has strict accessible alternative
QW-ACT-R33ff89c9ARIA required context role
QW-ACT-R346a7281ARIA state or property has valid value
QW-ACT-R35ffd0e9Heading has accessible name
QW-ACT-R36a25f45Headers attribute specified on a cell refers to cells in the same table element
QW-ACT-R37afw4f7Text has minimum contrast
QW-ACT-R38bc4a75ARIA required owned elements
QW-ACT-R39d0f69eAll table header cells have assigned data cells
QW-ACT-R4059br37Zoomed text node is not clipped with CSS overflow
QW-ACT-R4136b590Error message describes invalid form field value
QW-ACT-R428fc3b6Object element has non-empty accessible name
QW-ACT-R430ssw9kScrollable element is keyboard accessible
QW-ACT-R44fd3a94Links with identical accessible names and context serve equivalent purpose
QW-ACT-R4846ca7fElement marked as decorative is not exposed
QW-ACT-R49aaa1bfAudio or video that plays automatically has no audio that lasts more than 3 seconds
QW-ACT-R504c31dfAudio or video that plays automatically has a control mechanism
QW-ACT-R51fd26cfvideo element visual-only content is media alternative for text
QW-ACT-R52ac7dc6video element visual-only content has description track
QW-ACT-R53ee13b5video element visual-only content has transcript
QW-ACT-R54d7ba54video element visual-only content has audio track alternative
QW-ACT-R551ea59cvideo element visual content has audio description
QW-ACT-R56ab4d13video element content is media alternative for text
QW-ACT-R57f196cevideo element visual content has description track
QW-ACT-R582eb176audio element content has transcript
QW-ACT-R59afb423audio element content is media alternative for text
QW-ACT-R60f51b46video element auditory content has captions
QW-ACT-R611a02b0video element visual content has transcript
QW-ACT-R62oj04fdElement in sequential focus order has visible focus
QW-ACT-R63b40fd1Document has a landmark with non-repeated content
QW-ACT-R64047fe0Document has heading for non-repeated content
QW-ACT-R65307n5zElement with presentational children has no focusable content
QW-ACT-R66m6b1q3Menuitem has non-empty accessible name
QW-ACT-R6724afc2Letter spacing in style attributes is not !important
QW-ACT-R6878fd32Line height in style attributes is not !important
QW-ACT-R699e45ecWord spacing in style attributes is not !important
QW-ACT-R70akn7bnframe with negative tabindex has no interactive elements
QW-ACT-R71bisz58meta element has no refresh delay (no exception)
QW-ACT-R728a213cFirst focusable element is link to non-repeated content
QW-ACT-R733e12e1Block of repeated content is collapsible
QW-ACT-R74ye5d6eDocument has an instrument to move focus to non-repeated content
QW-ACT-R75cf77f2Bypass Blocks of Repeated Content
QW-ACT-R7609o5cgText has enhanced contrast
QW-ACT-R77in6db8ARIA required ID references exist

Implemented WCAG 2.1 Techniques

QualWeb Technique IDWCAG Technique IDWCAG Technique Name
QW-WCAG-T1H24Providing text alternatives for the area elements of image maps
QW-WCAG-T2H39Using caption elements to associate data table captions with data tables
QW-WCAG-T3H71Providing a description for groups of form controls using fieldset and legend elements
QW-WCAG-T4H73Using the summary attribute of the table element to give an overview of data tables
QW-WCAG-T5H36Using alt attributes on images used as submit buttons
QW-WCAG-T6SCR20Using both keyboard and other device-specific functions
QW-WCAG-T7H28Providing definitions for abbreviations by using the abbr element
QW-WCAG-T8F30Failure of Success Criterion 1.1.1 and 1.2.1 due to using text alternatives that are not alternatives
QW-WCAG-T9G141Organizing a page using headings
QW-WCAG-T10H2Combining adjacent image and text links for the same resource
QW-WCAG-T11H35Providing text alternatives on applet elements
QW-WCAG-T12F46Failure of Success Criterion 1.3.1 due to using th elements, caption elements, or non-empty summary attributes in layout tables
QW-WCAG-T13F47Failure of Success Criterion 2.2.2 due to using the blink element
QW-WCAG-T14H43Using id and headers attributes to associate data cells with header cells in data tables
QW-WCAG-T15H59Using the link element and navigation tools
QW-WCAG-T16H88Using HTML according to spec
QW-WCAG-T17G162Positioning labels to maximize predictability of relationships
QW-WCAG-T18H51Using table markup to present tabular information
QW-WCAG-T19H32Providing submit buttons
QW-WCAG-T20H33Supplementing link text with the title attribute
QW-WCAG-T21F89Failure of Success Criteria 2.4.4, 2.4.9 and 4.1.2 due to not providing an accessible name for an image which is the only content in a link
QW-WCAG-T22F52Failure of Success Criterion 3.2.1 and 3.2.5 due to opening a new window as soon as a new page is loaded
QW-WCAG-T23G1Adding a link at the top of each page that goes directly to the main content area
QW-WCAG-T24F55Failure of Success Criteria 2.1.1, 2.4.7, and 3.2.1 due to using script to remove focus when focus is received
QW-WCAG-T25H63Using the scope attribute to associate header cells and data cells in data tables
QW-WCAG-T26F59Failure of Success Criterion 4.1.2 due to using script to make div or span a user interface control in HTML without providing a role for the control
QW-WCAG-T27F88Failure of Success Criterion 1.4.8 due to using text that is justified (aligned to both the left and the right margins)
QW-WCAG-T28C12 C13 C14Using percent, em, names for font sizes
QW-WCAG-T29C19Specifying alignment either to the left or right in CSS
QW-WCAG-T30F4Failure of Success Criterion 2.2.2 due to using text-decoration:blink without a mechanism to stop it in less than five seconds
QW-WCAG-T31F24Failure of Success Criterion 1.4.3, 1.4.6 and 1.4.8 due to specifying foreground colors without specifying background colors or vice versa
QW-WCAG-T32H48Using ol, ul and dl for lists or groups of links

License

ISC

Keywords

FAQs

Last updated on 04 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc