forked from dequelabs/axe-webdriverjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sauce.js
39 lines (34 loc) · 951 Bytes
/
sauce.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var WebDriver = require('selenium-webdriver'),
assert = require('chai').assert,
AxeBuilder = require('../../lib');
describe('sauce-example', function() {
this.timeout(10000);
var driver;
var url = 'https://github.com/dequelabs/axe-webdriverjs';
before(function(done) {
driver = new WebDriver.Builder()
.usingServer('http://ondemand.saucelabs.com:80/wd/hub')
.withCapabilities({
browserName: 'Firefox',
// you must set these environment variables
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY
})
.build();
driver.get(url).then(function() {
done();
});
});
after(function() {
driver.quit();
});
it('should find violations', function(done) {
AxeBuilder(driver).analyze(function(err, results) {
if (err) {
return done(err);
}
assert.equal(results.url, url);
done();
});
});
});