Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/ejs-3.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
straker authored May 13, 2024
2 parents 86a3485 + 7f49c96 commit c5f4852
Show file tree
Hide file tree
Showing 12 changed files with 4,910 additions and 8,055 deletions.
12,910 changes: 4,871 additions & 8,039 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
],
"dependencies": {
"@axe-core/webdriverjs": "^4.9.0",
"axe-core": "~4.9.0",
"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",
Expand Down
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
4 changes: 2 additions & 2 deletions packages/playwright/package.json
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion packages/puppeteer/package.json
Original file line number Diff line number Diff line change
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
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
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion packages/reporter-earl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@types/clone": "^2.1.1",
"@types/jsonld": "github:types/jsonld",
"@types/node": "^20.8.10",
"axe-core": "~4.9.0",
"axe-core": "~4.9.1",
"clone": "^2.1.2",
"cross-env": "^7.0.3",
"jest": "^29.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/webdriverio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"webdriverio"
],
"dependencies": {
"axe-core": "~4.9.0",
"axe-core": "~4.9.1",
"cssesc": "^3.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/webdriverjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"typescript": "^5.2.2"
},
"dependencies": {
"axe-core": "~4.9.0"
"axe-core": "~4.9.1"
},
"peerDependencies": {
"selenium-webdriver": ">3.0.0-beta || >=2.53.1 || >4.0.0-alpha"
Expand Down

0 comments on commit c5f4852

Please sign in to comment.