Skip to content

Commit

Permalink
Merge pull request #330 from IBMa/archive-path
Browse files Browse the repository at this point in the history
Change archive paths for engine to use path from json
  • Loading branch information
tombrunet authored Mar 3, 2021
2 parents 43f9928 + 4aba9d0 commit adfecde
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions accessibility-checker/src-ts/lib/ACEngineManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class ACEngineManager {
} catch (e) {
return Promise.reject(e);
}
}, `${config.ruleServer}/archives/${config.ruleArchive}/js/ace.js`);
}, `${config.rulePack}/ace.js`);
return ACEngineManager.loadEngineLocal();
} else if (ACEngineManager.isSelenium(content)) {
config.DEBUG && console.log("[INFO] aChecker.loadEngine detected Selenium");
Expand All @@ -47,7 +47,7 @@ try {
let script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('aChecker', 'ACE');
script.setAttribute('src', '${config.ruleServer}/archives/${config.ruleArchive}/js/ace.js');
script.setAttribute('src', '${config.rulePack}/ace.js');
script.addEventListener('load', function() {
cb();
});
Expand Down Expand Up @@ -95,9 +95,9 @@ try {
let config = await ACConfigManager.getConfigUnsupported();

return new Promise<void>((resolve, reject) => {
request.get(`${config.ruleServer}/archives/${config.ruleArchive}/js/ace-node.js`, function (err, data) {
request.get(`${config.rulePack}/ace-node.js`, function (err, data) {
if (!data) {
console.log("Cannot read: " + `${config.ruleServer}/archives/${config.ruleArchive}/js/ace.js`);
console.log("Cannot read: " + `${config.rulePack}/ace-node.js`);
}
data = data.body;
let engineDir = path.join(__dirname, "engine");
Expand Down
6 changes: 3 additions & 3 deletions accessibility-checker/src-ts/lib/ACHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ try {
// If cucumber is the platform...
let {AfterAll} = require('cucumber');
AfterAll(function (done) {
const rulePack = `${Config.ruleServer}/archives/${Config.ruleArchive}/js`;
const rulePack = `${Config.rulePack}`;
initialize().then(() => ACReportManager.metricsLogger.sendLogsV2(() => ACBrowserManager.close().then(done), rulePack));
});
} catch (e) {
if (typeof (after) !== "undefined") {
after(function (done) {
if (Config) {
const rulePack = `${Config.ruleServer}/archives/${Config.ruleArchive}/js`;
const rulePack = `${Config.rulePack}/ace`;
initialize().then(() => ACReportManager.metricsLogger.sendLogsV2(() => ACBrowserManager.close().then(done), rulePack));
} else {
done();
Expand All @@ -49,7 +49,7 @@ try {
} else {
process.on('beforeExit', async function () {
if (Config) {
const rulePack = `${Config.ruleServer}/archives/${Config.ruleArchive}/js`;
const rulePack = `${Config.rulePack}/ace`;
initialize().then(() => ACReportManager.metricsLogger.sendLogsV2(null, rulePack));
ACBrowserManager.close();
}
Expand Down
2 changes: 2 additions & 0 deletions accessibility-checker/src-ts/lib/api/IChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export type IConfigUnsupported = IConfig & {
*/
ruleServer?: string

rulePack?: string

/**
* (optional) If the tool allows, should we capture screenshots
*/
Expand Down

0 comments on commit adfecde

Please sign in to comment.