-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added default axe commands to be overriden by the plugin
- Loading branch information
1 parent
8f7ad41
commit e6ab5c2
Showing
7 changed files
with
95 additions
and
3 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
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,27 @@ | ||
/** | ||
* Injects the [axe-core](https://github.com/dequelabs/axe-core) js library into the current page (using the .executeScript() command). | ||
* | ||
* @example | ||
* describe('accessibility testing', function() { | ||
* | ||
* it('accessibility rule subset', function(browser) { | ||
* browser | ||
* .url('https://www.w3.org/WAI/demos/bad/after/home.html') | ||
* .assert.titleEquals('Welcome to CityLights! [Accessible Home Page]') | ||
* .axeInject() | ||
* .axeRun('body', { | ||
* runOnly: ['color-contrast', 'image-alt'], | ||
* }); | ||
* }); | ||
* }) | ||
* | ||
* @method axeInject | ||
* @link https://github.com/dequelabs/axe-core | ||
* @syntax browser.axeInject() | ||
* @api accessibility | ||
*/ | ||
module.exports = class AxeInjectAbstract { | ||
static get allowOverride() { | ||
return true; | ||
} | ||
}; |
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,30 @@ | ||
/** | ||
* Analyzes the current page against applied axe rules. | ||
* | ||
* @example | ||
* describe('accessibility testing', function() { | ||
* | ||
* it('accessibility rule subset', function(browser) { | ||
* browser | ||
* .url('https://www.w3.org/WAI/demos/bad/after/home.html') | ||
* .assert.titleEquals('Welcome to CityLights! [Accessible Home Page]') | ||
* .axeInject() | ||
* .axeRun('body', { | ||
* runOnly: ['color-contrast', 'image-alt'], | ||
* }); | ||
* }); | ||
* }) | ||
* | ||
* @method axeRun | ||
* @link https://github.com/dequelabs/axe-core | ||
* @syntax browser.axeRun('body') | ||
* @param {string} selector The CSS selector used to locate the element. | ||
* @param {object} options Object containing rules configuration to use when performing the analysis | ||
* @param {function} [callback] Optional callback function which is called with the results | ||
* @api accessibility | ||
*/ | ||
module.exports = class AxeInject { | ||
static get allowOverride() { | ||
return true; | ||
} | ||
}; |
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,19 @@ | ||
const assert = require('assert'); | ||
const CommandGlobals = require('../../../../lib/globals/commands.js'); | ||
|
||
describe('accessibility commands', function () { | ||
|
||
before(function (done) { | ||
CommandGlobals.beforeEach.call(this, done); | ||
}); | ||
|
||
after(function (done) { | ||
CommandGlobals.afterEach.call(this, done); | ||
}); | ||
|
||
it('test axe commands loaded onto the main api', function () { | ||
assert.strictEqual(typeof this.client.api.axeInject, 'function'); | ||
assert.strictEqual(typeof this.client.api.axeRun, 'function'); | ||
}); | ||
|
||
}); |