Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 4bb827d

Browse files
authored
Merge pull request #5 from dequelabs/fix-for-release
Fix axe-cli for release
2 parents 4d586d9 + 870f6de commit 4bb827d

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

lib/axe-test-urls.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,19 @@ function testPages(urls, config, events) {
2828
if (events.onTestStart) {
2929
events.onTestStart(currentUrl);
3030
}
31-
3231
driver.get(currentUrl)
3332
.then(function () {
34-
// Wait for the page to be loaded
35-
return driver.executeAsyncScript(function(callback) {
36-
var script = document.createElement('script');
37-
script.innerHTML = 'document.documentElement.classList.add("deque-axe-is-ready");';
38-
document.documentElement.appendChild(script);
39-
callback();
40-
});
41-
})
42-
.then(function () {
43-
return driver.wait(WebDriver.until.elementsLocated(WebDriver.By.css('.deque-axe-is-ready')));
44-
})
33+
// Wait for the page to be loaded
34+
return driver.executeAsyncScript(function(callback) {
35+
var script = document.createElement('script');
36+
script.innerHTML = 'document.documentElement.classList.add("deque-axe-is-ready");';
37+
document.documentElement.appendChild(script);
38+
callback();
39+
});
40+
})
41+
.then(function () {
42+
return driver.wait(WebDriver.until.elementsLocated(WebDriver.By.css('.deque-axe-is-ready')));
43+
})
4544
.then(() => {
4645
// Set everything up
4746
const axe = AxeBuilder(driver, config.axeSource)
@@ -72,7 +71,7 @@ function testPages(urls, config, events) {
7271
.then(out => {
7372
resolve([results].concat(out))
7473
});
75-
});
74+
});
7675
}).catch((e) => {
7776
driver.quit();
7877
reject(e)

lib/webdriver.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function startDriver(config) {
2424
config.phantom = phantom;
2525

2626
// And connect selenium to our phantom server
27-
config.driver = builder.usingServer('http://localhost:4444').build();
27+
config.driver = builder.usingServer('http://localhost:4444/wd/hub').build();
2828
config.driver.manage().timeouts().setScriptTimeout(90*1000)
2929

3030
return Promise.resolve(config);
@@ -34,7 +34,6 @@ function startDriver(config) {
3434
}
3535

3636
function stopDriver(config) {
37-
config.driver.quit();
3837
if (config.phantom) {
3938
config.phantom.kill();
4039
}

0 commit comments

Comments
 (0)