forked from dequelabs/axe-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update docs to use named import and create example.js (dequelab…
…s#741) * docs: update docs to use named import and create example.js * remove * Update packages/playwright/example.js Co-authored-by: Gabe <41127686+Zidious@users.noreply.github.com> * Update packages/playwright/example.js Co-authored-by: Gabe <41127686+Zidious@users.noreply.github.com> * readme updates --------- Co-authored-by: Gabe <41127686+Zidious@users.noreply.github.com>
- Loading branch information
Showing
16 changed files
with
124 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
const AxeBuilder = require('@axe-core/playwright').default; | ||
const { AxeBuilder } = require('@axe-core/playwright'); | ||
const playwright = require('playwright'); | ||
|
||
(async () => { | ||
const browser = await playwright.chromium.launch(); | ||
const browser = await playwright.chromium.launch({ headless: true }); | ||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
await page.goto('https://dequeuniversity.com/demo/mars/'); | ||
const results = await new AxeBuilder({ page }).analyze(); | ||
console.log(results); | ||
|
||
try { | ||
const results = await new AxeBuilder({ page }).analyze(); | ||
console.log(results); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
|
||
await browser.close(); | ||
})(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,3 +325,5 @@ export default class AxeBuilder { | |
`; | ||
} | ||
} | ||
|
||
export { AxeBuilder } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { AxePuppeteer } = require('@axe-core/puppeteer'); | ||
const puppeteer = require('puppeteer'); | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch(); | ||
const page = await browser.newPage(); | ||
await page.goto('https://dequeuniversity.com/demo/mars/'); | ||
|
||
try { | ||
const results = await new AxePuppeteer(page).analyze(); | ||
console.log(results); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
|
||
await browser.close(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { AxeBuilder } = require('@axe-core/webdriverio'); | ||
const { remote } = require('webdriverio'); | ||
|
||
(async () => { | ||
const client = await remote({ | ||
logLevel: 'error', | ||
capabilities: { | ||
browserName: 'chrome', | ||
'goog:chromeOptions': { | ||
args: ['headless', 'disable-gpu'] | ||
} | ||
} | ||
}); | ||
await client.url('https://dequeuniversity.com/demo/mars/'); | ||
|
||
try { | ||
const results = await new AxeBuilder({ client }).analyze(); | ||
console.log(results); | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
|
||
client.deleteSession(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -351,3 +351,5 @@ export default class AxeBuilder { | |
return res; | ||
} | ||
} | ||
|
||
export { AxeBuilder } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
const AxeBuilder = require('@axe-core/webdriverjs'); | ||
const WebDriver = require('selenium-webdriver'); | ||
const { AxeBuilder } = require('@axe-core/webdriverjs'); | ||
const { Builder } = require('selenium-webdriver'); | ||
const chrome = require('selenium-webdriver/chrome'); | ||
|
||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type | ||
(async () => { | ||
const driver = new WebDriver.Builder().forBrowser('chrome').build(); | ||
await driver.get('https://html5-sandbox.glitch.me/'); | ||
const results = await new AxeBuilder(driver, null, { | ||
noSandbox: true | ||
}).analyze(); | ||
console.log(results); | ||
const driver = new Builder() | ||
.forBrowser('chrome') | ||
.setChromeOptions(new chrome.Options().headless()) | ||
.build(); | ||
await driver.get('https://dequeuniversity.com/demo/mars/'); | ||
|
||
try { | ||
const results = await new AxeBuilder(driver).analyze(); | ||
console.log(results); | ||
} catch(e) { | ||
console.error(e); | ||
} | ||
|
||
await driver.quit(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters