Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,21 @@ jobs:
- run: npm --prefix=packages/webdriverjs run build
- run: npm run test --prefix=packages/webdriverjs/tests/example

playwright:
docker:
- image: cimg/node:16.16.0-browsers
- image: mcr.microsoft.com/playwright:v1.29.0
environment:
NODE_ENV: development
working_directory: ~/axe-core-npm
steps:
- checkout
- restore_dependency_cache
- run: npm install
- run: npm run bootstrap -- --ci
- run: npm run build --prefix=packages/playwright
- run: npm run coverage --prefix=packages/playwright

webdriverio:
docker:
# using a node14 image instead of a node16 image due to WDIO
Expand Down Expand Up @@ -199,22 +214,6 @@ jobs:
- run: npm run build --prefix=packages/react
- run: npm run test --prefix=packages/react

playwright:
docker:
- image: mcr.microsoft.com/playwright:v1.29.0
environment:
NODE_ENV: development
working_directory: ~/axe-core-npm
steps:
# We need to pin node@14 to run WDIO due to WDIO sync, only works on node@14
- run: npm install -g node@14 --force
- checkout
- restore_dependency_cache
- run: npm install
- run: npm run bootstrap -- --ci
- run: npm run build --prefix=packages/playwright
- run: npm run coverage --prefix=packages/playwright

axe-core-test:
<<: *defaults
steps:
Expand Down
8 changes: 8 additions & 0 deletions packages/playwright/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extension": ["ts"],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
],
"spec": ["tests/**/*.spec.ts"]
}
10 changes: 10 additions & 0 deletions packages/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ yarn add @axe-core/playwright

## Usage

```js
const AxeBuilder = require('@axe-core/playwright').default;
```

or

```js
import AxeBuilder from '@axe-core/playwright';
```

This module uses a chainable API to assist in injecting, configuring, and analyzing axe with [Playwright](https://playwright.dev/). As such, it is required to pass an instance of Playwright.

Here is an example of a script that will drive Playwright to a page, perform an analysis, and then log results to the console.
Expand Down
Loading