@axe-core/playwright
Advanced tools
Comparing version 4.9.1-232476e.0 to 4.9.1-364e944.0
@@ -236,3 +236,3 @@ "use strict"; | ||
const { page } = this; | ||
page.evaluate(this.script()); | ||
await page.evaluate(this.script()); | ||
const runPartialDefined = await page.evaluate( | ||
@@ -265,6 +265,18 @@ 'typeof window.axe.runPartial === "function"' | ||
*/ | ||
async inject(frames) { | ||
async inject(frames, shouldThrow) { | ||
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")); | ||
}, 1e3); | ||
}); | ||
const evaluate = iframe.evaluate(this.script()); | ||
try { | ||
await Promise.race([evaluate, race]); | ||
await iframe.evaluate(await this.axeConfigure()); | ||
} catch (err) { | ||
if (shouldThrow) { | ||
throw err; | ||
} | ||
} | ||
} | ||
@@ -323,3 +335,3 @@ } | ||
if (childFrame) { | ||
await this.inject([childFrame]); | ||
await this.inject([childFrame], true); | ||
childResults = await this.runPartialRecursive( | ||
@@ -344,4 +356,4 @@ childFrame, | ||
); | ||
blankPage.evaluate(this.script()); | ||
blankPage.evaluate(await this.axeConfigure()); | ||
await blankPage.evaluate(this.script()); | ||
await blankPage.evaluate(await this.axeConfigure()); | ||
const sizeLimit = 6e7; | ||
@@ -348,0 +360,0 @@ const partialString = JSON.stringify(partialResults); |
@@ -236,3 +236,3 @@ "use strict"; | ||
const { page } = this; | ||
page.evaluate(this.script()); | ||
await page.evaluate(this.script()); | ||
const runPartialDefined = await page.evaluate( | ||
@@ -265,6 +265,18 @@ 'typeof window.axe.runPartial === "function"' | ||
*/ | ||
async inject(frames) { | ||
async inject(frames, shouldThrow) { | ||
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")); | ||
}, 1e3); | ||
}); | ||
const evaluate = iframe.evaluate(this.script()); | ||
try { | ||
await Promise.race([evaluate, race]); | ||
await iframe.evaluate(await this.axeConfigure()); | ||
} catch (err) { | ||
if (shouldThrow) { | ||
throw err; | ||
} | ||
} | ||
} | ||
@@ -323,3 +335,3 @@ } | ||
if (childFrame) { | ||
await this.inject([childFrame]); | ||
await this.inject([childFrame], true); | ||
childResults = await this.runPartialRecursive( | ||
@@ -344,4 +356,4 @@ childFrame, | ||
); | ||
blankPage.evaluate(this.script()); | ||
blankPage.evaluate(await this.axeConfigure()); | ||
await blankPage.evaluate(this.script()); | ||
await blankPage.evaluate(await this.axeConfigure()); | ||
const sizeLimit = 6e7; | ||
@@ -348,0 +360,0 @@ const partialString = JSON.stringify(partialResults); |
{ | ||
"name": "@axe-core/playwright", | ||
"version": "4.9.1-232476e.0+232476e", | ||
"version": "4.9.1-364e944.0+364e944", | ||
"description": "Provides a method to inject and analyze web pages using axe", | ||
@@ -57,3 +57,3 @@ "contributors": [ | ||
"devDependencies": { | ||
"@playwright/test": "^1.34.3", | ||
"@playwright/test": "^1.44.0", | ||
"@types/chai": "^4.3.3", | ||
@@ -96,3 +96,3 @@ "@types/express": "^4.17.14", | ||
}, | ||
"gitHead": "232476e306f0bc875e7b0db5718bfe953083bcde" | ||
"gitHead": "364e944faa86f679785b46976d04fe329d32c45b" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
63092
1229