Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

QAstro.js is a modular library for automatic accessibility and security linting of web pages. Easily extensible with new rules

Notifications You must be signed in to change notification settings

modalqa/qastro.js

Repository files navigation

QAstro.js

QAstro.js is a modular library for automatic accessibility and security linting of web pages. Easily extensible with new rules.

Features

  • πŸ”„ Auto-run when the page loads
  • πŸ§ͺ Modular rules (checkTitle, checkImageAlt, checkFormLabel, etc)
  • πŸ“‹ Reports in the browser console
  • 🧩 Easily extensible with your own rules

Project Structure

qastro/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ rules/
β”‚ β”‚ β”œβ”€β”€ checkTitle.js
β”‚ β”‚ β”œβ”€β”€ checkImageAlt.js
β”‚ β”‚ └── checkFormLabel.js
β”‚ └── index.js
β”œβ”€β”€ dist/
β”‚ └── qastro.min.js
β”œβ”€β”€ rollup.config.js
β”œβ”€β”€ package.json
└── README.md

How to Build

  1. Install dependencies:
    npm install
  2. Build:
    npm run build

Usage

Include dist/qastro.min.js in your web page. Reports will automatically appear in the browser console.

Example

QAstro.js logo

Extending Rules

Add a new rule file in src/rules/ and import it in src/index.js.

CI/CD & Automation

QAstro.js can be integrated into your CI/CD pipeline or automated test environment. You can run QAstro.js in a headless browser or Node.js environment (e.g., with jsdom, Puppeteer, or Playwright) to lint your pages automatically and fail the build if issues are found.

Example: Node.js + jsdom

Install jsdom:

npm install jsdom

Example script:

import { JSDOM } from 'jsdom';
import runQAstro from './src/index.js';
const dom = new JSDOM('<!doctype html><html><head></head><body></body></html>', { url: 'http://localhost' });
global.document = dom.window.document;
global.window = dom.window;
let issues = [];
runQAstro({
 report: (result) => issues.push(result)
});
if (issues.length > 0) {
 console.error('QAstro found issues:', issues);
 process.exit(1); // fail CI
}

You can adapt this approach for Playwright, Puppeteer, or other test runners to automate accessibility and security linting as part of your build process.

About

QAstro.js is a modular library for automatic accessibility and security linting of web pages. Easily extensible with new rules

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /