Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v4.9.1 #1068

Merged
merged 18 commits into from
May 20, 2024
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/sync-master-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
steps:
- uses: dequelabs/action-sync-branches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.PAT }}
pr-title: 'chore: merge master into develop'
pr-reviewers: michael-siek,stephenmathieson
pr-team-reviewers: axe-api-team
pr-labels: chore
pr-template: .github/PULL_REQUEST_TEMPLATE.md
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- run: npm ci
# HACK: Force a TTY to enable browser-driver-manager to manipulate stdout.
- shell: 'script -q -e -c "bash {0}"'
run: npx browser-driver-manager install chromedriver=123 --verbose
run: npx browser-driver-manager install chromedriver=125 --verbose
working-directory: packages/cli
- run: npm run coverage --workspace=packages/cli

Expand Down
21 changes: 9 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,29 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)

## [4.9.1](https://github.com/dequelabs/axe-core-npm/compare/v4.9.0...v4.9.1) (2024-05-15)

### Bug Fixes

* get correct new window handle with Selenium 3 workaround ([#1031](https://github.com/dequelabs/axe-core-npm/issues/1031)) ([b72c735](https://github.com/dequelabs/axe-core-npm/commit/b72c73571c12c81c2ef3dc3ebe89e15769f0942b)), closes [#1027](https://github.com/dequelabs/axe-core-npm/issues/1027) [/github.com/dequelabs/axe-core-maven-html/blob/ad58b26a8d0e2f1afed33b2c5cbca22b54644b99/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverExtensions.java#L126](https://github.com//github.com/dequelabs/axe-core-maven-html/blob/ad58b26a8d0e2f1afed33b2c5cbca22b54644b99/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverExtensions.java/issues/L126) [#936](https://github.com/dequelabs/axe-core-npm/issues/936)

- **playwright:** skip unloaded iframes ([#1060](https://github.com/dequelabs/axe-core-npm/issues/1060)) ([d30dae4](https://github.com/dequelabs/axe-core-npm/commit/d30dae4a6fede397bc49b5171c4cb4c43e545b53))

### Features
- Update axe-core to v4.9.1 ([#1055](https://github.com/dequelabs/axe-core-npm/issues/1055)) ([8644fbd](https://github.com/dequelabs/axe-core-npm/commit/8644fbd2d2b407c68b5ff3bd7b8368c6c173e355))

* Update axe-core to v4.9.0 ([#1028](https://github.com/dequelabs/axe-core-npm/issues/1028)) ([7e152b6](https://github.com/dequelabs/axe-core-npm/commit/7e152b65ff30b9e1cb26c3b0564457b32a0d35b2))
# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)

### Bug Fixes

- get correct new window handle with Selenium 3 workaround ([#1031](https://github.com/dequelabs/axe-core-npm/issues/1031)) ([b72c735](https://github.com/dequelabs/axe-core-npm/commit/b72c73571c12c81c2ef3dc3ebe89e15769f0942b)), closes [#1027](https://github.com/dequelabs/axe-core-npm/issues/1027) [/github.com/dequelabs/axe-core-maven-html/blob/ad58b26a8d0e2f1afed33b2c5cbca22b54644b99/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverExtensions.java#L126](https://github.com//github.com/dequelabs/axe-core-maven-html/blob/ad58b26a8d0e2f1afed33b2c5cbca22b54644b99/selenium/src/main/java/com/deque/html/axecore/extensions/WebDriverExtensions.java/issues/L126) [#936](https://github.com/dequelabs/axe-core-npm/issues/936)

### Features

- Update axe-core to v4.9.0 ([#1028](https://github.com/dequelabs/axe-core-npm/issues/1028)) ([7e152b6](https://github.com/dequelabs/axe-core-npm/commit/7e152b65ff30b9e1cb26c3b0564457b32a0d35b2))

## [4.8.5](https://github.com/dequelabs/axe-core-npm/compare/v4.8.4...v4.8.5) (2024-02-08)


### Bug Fixes

* Update axe-core to v4.8.4 ([#1008](https://github.com/dequelabs/axe-core-npm/issues/1008)) ([d54f145](https://github.com/dequelabs/axe-core-npm/commit/d54f145a4078c4730a850e694c9eb77297c23a35))




- Update axe-core to v4.8.4 ([#1008](https://github.com/dequelabs/axe-core-npm/issues/1008)) ([d54f145](https://github.com/dequelabs/axe-core-npm/commit/d54f145a4078c4730a850e694c9eb77297c23a35))

## [4.8.4](https://github.com/dequelabs/axe-core-npm/compare/v4.8.3...v4.8.4) (2024-01-23)

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "4.9.0"
"version": "4.9.1"
}
12,924 changes: 4,879 additions & 8,045 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,21 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)


### Features

* Update axe-core to v4.9.0 ([#1028](https://github.com/dequelabs/axe-core-npm/issues/1028)) ([7e152b6](https://github.com/dequelabs/axe-core-npm/commit/7e152b65ff30b9e1cb26c3b0564457b32a0d35b2))
## [4.9.1](https://github.com/dequelabs/axe-core-npm/compare/v4.9.0...v4.9.1) (2024-05-10)

**Note:** Version bump only for package @axe-core/cli

# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)

### Features

- Update axe-core to v4.9.0 ([#1028](https://github.com/dequelabs/axe-core-npm/issues/1028)) ([7e152b6](https://github.com/dequelabs/axe-core-npm/commit/7e152b65ff30b9e1cb26c3b0564457b32a0d35b2))

## [4.8.5](https://github.com/dequelabs/axe-core-npm/compare/v4.8.4...v4.8.5) (2024-02-08)


### Bug Fixes

* Update axe-core to v4.8.4 ([#1008](https://github.com/dequelabs/axe-core-npm/issues/1008)) ([d54f145](https://github.com/dequelabs/axe-core-npm/commit/d54f145a4078c4730a850e694c9eb77297c23a35))




- Update axe-core to v4.8.4 ([#1008](https://github.com/dequelabs/axe-core-npm/issues/1008)) ([d54f145](https://github.com/dequelabs/axe-core-npm/commit/d54f145a4078c4730a850e694c9eb77297c23a35))

## [4.8.4](https://github.com/dequelabs/axe-core-npm/compare/v4.8.3...v4.8.4) (2024-01-23)

Expand Down
10 changes: 6 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/cli",
"version": "4.9.0",
"version": "4.9.1",
"description": "A CLI for accessibility testing using axe-core",
"author": {
"name": "Wilco Fiers",
Expand Down Expand Up @@ -47,23 +47,25 @@
"testing"
],
"dependencies": {
"@axe-core/webdriverjs": "^4.9.0",
"axe-core": "~4.9.0",
"@axe-core/webdriverjs": "^4.9.1",
"axe-core": "~4.9.1",
"chromedriver": "latest",
"colors": "^1.4.0",
"commander": "^9.4.1",
"selenium-webdriver": "~4.17.0"
"selenium-webdriver": "~4.20.0"
},
"devDependencies": {
"@types/chai": "^4.3.3",
"@types/chromedriver": "^81.0.1",
"@types/mocha": "^10.0.0",
"@types/selenium-webdriver": "^4.1.5",
"@types/sinon": "^17.0.3",
"chai": "^4.3.6",
"execa": "5.1.1",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"rimraf": "^5.0.5",
"sinon": "^17.0.1",
"tempy": "^1.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lib/axe-test-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const testPages = async (
const currentUrl = urls[0].replace(/[,;]$/, '');

if (events?.onTestStart) {
events?.onTestStart(currentUrl);
events.onTestStart(currentUrl);
}

if (config.timer) {
Expand Down
7 changes: 1 addition & 6 deletions packages/cli/src/lib/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { assert } from 'chai';
import tempy from 'tempy';
import { join } from 'path';
import { mkdirSync, writeFileSync, rmSync } from 'fs';
import { dependencies } from '../../package.json';
import * as utils from './utils';

describe('utils', () => {
Expand Down Expand Up @@ -83,11 +82,7 @@ describe('utils', () => {
writeFileSync(join(parentDirname, 'axe.js'), 'parent');

const cliDirname = join(tempDir, 'packages', 'cli');
const nodeModDirname = join(
cliDirname,
'node_modules',
'axe-core'
);
const nodeModDirname = join(cliDirname, 'node_modules', 'axe-core');
mkdirSync(nodeModDirname, { recursive: true });
writeFileSync(join(nodeModDirname, 'axe.js'), 'node modules');

Expand Down
23 changes: 21 additions & 2 deletions packages/cli/src/lib/webdriver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { startDriver } from './webdriver';
import { WebDriver } from 'selenium-webdriver';
import chromedriver from 'chromedriver';
import chrome from 'selenium-webdriver/chrome';
import type { Options } from 'selenium-webdriver/chrome';
import path from 'path';
import { WebdriverConfigParams } from '../types';
import sinon from 'sinon';

describe('startDriver', () => {
let config: WebdriverConfigParams;
let browser: string;
Expand All @@ -22,7 +23,11 @@ describe('startDriver', () => {
});

afterEach(async () => {
await driver.quit();
// try catch required due to `chrome.options` being mocked with sinon
// and not properly creating a driver
try {
await driver.quit();
} catch (error) {}
});

it('creates a driver', async () => {
Expand Down Expand Up @@ -101,4 +106,18 @@ describe('startDriver', () => {
assert.isObject(timeoutValue);
assert.deepEqual(timeoutValue.script, 10000000);
});

it('invokes `options.headless()` on versions of selenium-webdriver < 4.17.0', async () => {
const stub = sinon.stub(chrome, 'Options').returns({
headless: () => {}
});

// try catch required due to `chrome.options` being mocked with sinon
// and not properly creating a driver
try {
driver = await startDriver(config);
} catch (error) {}
assert.isTrue(stub.calledOnce);
stub.restore();
});
});
2 changes: 1 addition & 1 deletion packages/cli/src/lib/webdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const startDriver = async (

let options = new chrome.Options();
// selenium-webdriver < 4.17.0
if (typeof options.headless === 'function') {
if ('headless' in options && typeof options.headless === 'function') {
options.headless();
}
// selenium-webdriver >= 4.17.0
Expand Down
11 changes: 11 additions & 0 deletions packages/playwright/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.9.1](https://github.com/dequelabs/axe-core-npm/compare/v4.9.0...v4.9.1) (2024-05-15)


### Bug Fixes

* **playwright:** skip unloaded iframes ([#1060](https://github.com/dequelabs/axe-core-npm/issues/1060)) ([d30dae4](https://github.com/dequelabs/axe-core-npm/commit/d30dae4a6fede397bc49b5171c4cb4c43e545b53))





# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)


Expand Down
6 changes: 3 additions & 3 deletions packages/playwright/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/playwright",
"version": "4.9.0",
"version": "4.9.1",
"description": "Provides a method to inject and analyze web pages using axe",
"contributors": [
{
Expand Down Expand Up @@ -51,10 +51,10 @@
"prepare": "npx playwright install && npm run build"
},
"dependencies": {
"axe-core": "~4.9.0"
"axe-core": "~4.9.1"
},
"devDependencies": {
"@playwright/test": "^1.34.3",
"@playwright/test": "^1.44.0",
"@types/chai": "^4.3.3",
"@types/express": "^4.17.14",
"@types/mocha": "^10.0.0",
Expand Down
22 changes: 18 additions & 4 deletions packages/playwright/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,24 @@ export default class AxeBuilder {
* @returns Promise<void>
*/

private async inject(frames: Frame[]): Promise<void> {
private async inject(frames: Frame[], shouldThrow?: boolean): Promise<void> {
for (const iframe of frames) {
await iframe.evaluate(await this.script());
await iframe.evaluate(await this.axeConfigure());
const race = new Promise((_, reject) => {
setTimeout(() => {
reject(new Error('Script Timeout'));
}, 1000);
});
const evaluate = iframe.evaluate(this.script());

try {
await Promise.race([evaluate, race]);
await iframe.evaluate(await this.axeConfigure());
} catch (err) {
// in legacy mode we don't want to throw the error we just want to skip injecting into the frame
if (shouldThrow) {
throw err;
}
}
}
}

Expand Down Expand Up @@ -256,7 +270,7 @@ export default class AxeBuilder {
iframeHandle.asElement() as ElementHandle<Element>;
const childFrame = await iframeElement.contentFrame();
if (childFrame) {
await this.inject([childFrame]);
await this.inject([childFrame], true);
childResults = await this.runPartialRecursive(
childFrame,
frameContext
Expand Down
7 changes: 6 additions & 1 deletion packages/playwright/test/axe-playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,12 @@ describe('@axe-core/playwright', () => {
.analyze();

assert.equal(res?.status(), 200);
assert.lengthOf(results.incomplete, 0);
assert.equal(results.incomplete[0].id, 'frame-tested');
assert.lengthOf(results.incomplete[0].nodes, 1);
assert.deepEqual(results.incomplete[0].nodes[0].target, [
'#ifr-lazy',
'#lazy-iframe'
]);
assert.equal(results.violations[0].id, 'label');
assert.lengthOf(results.violations[0].nodes, 1);
assert.deepEqual(results.violations[0].nodes[0].target, [
Expand Down
8 changes: 8 additions & 0 deletions packages/puppeteer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.9.1](https://github.com/dequelabs/axe-core-npm/compare/v4.9.0...v4.9.1) (2024-05-15)

**Note:** Version bump only for package @axe-core/puppeteer





# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)


Expand Down
4 changes: 2 additions & 2 deletions packages/puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/puppeteer",
"version": "4.9.0",
"version": "4.9.1",
"description": "Provides a chainable axe API for Puppeteer and automatically injects into all frames",
"repository": {
"type": "git",
Expand Down Expand Up @@ -55,7 +55,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"axe-core": "~4.9.0"
"axe-core": "~4.9.1"
},
"peerDependencies": {
"puppeteer": ">=1.10.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.9.1](https://github.com/dequelabs/axe-core-npm/compare/v4.9.0...v4.9.1) (2024-05-15)

**Note:** Version bump only for package @axe-core/react





# [4.9.0](https://github.com/dequelabs/axe-core-npm/compare/v4.8.5...v4.9.0) (2024-04-01)


Expand Down
6 changes: 5 additions & 1 deletion packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ Previous versions of this program were maintained at [dequelabs/react-axe](https

## React support

This package does not support React 18 and above. Deque is working on alternatives for React 18+ developers and will update the community following product announcements at [axe-con 2024](https://www.deque.com/axe-con/).
This package does not support React 18 and above. Deque released a product called [axe Developer Hub](https://www.deque.com/axe/developer-hub/). This product has [numerous JavaScript/TypeScript test framework integrations](https://docs.deque.com/developer-hub/2/en/dh-platform-support#browser-automation-platform-support) and is Deque's recommended path forward for users of this library who wish to use more modern versions of React.

The product has a free plan where each licensed user gets 1 API key. This is a good option for open-source projects or solo developers looking for high-quality accessibility feedback. [Sign up for the free plan](https://axe.deque.com/signup?product=axe-devtools-watcher&redirect_uri=https%3A%2F%2Faxe.deque.com%2Faxe-watcher%2Fstartup).

For more information, read the [blog post: Introducing axe Developer Hub, now available as part of axe DevTools for Web](https://www.deque.com/blog/introducing-axe-developer-hub-now-available-as-part-of-axe-devtools-for-web/)

## Usage

Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@axe-core/react",
"version": "4.9.0",
"version": "4.9.1",
"description": "Dynamic accessibility analysis for React using axe-core",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -60,7 +60,7 @@
"author": "Dylan Barrell ([email protected])",
"license": "MPL-2.0",
"dependencies": {
"axe-core": "~4.9.0",
"axe-core": "~4.9.1",
"requestidlecallback": "^0.3.0"
},
"devDependencies": {
Expand Down
Loading
Loading