diff --git a/doc/examples/phantomjs/axe-phantom.js b/doc/examples/phantomjs/axe-phantom.js index 3f4a62576f..941ce503c5 100644 --- a/doc/examples/phantomjs/axe-phantom.js +++ b/doc/examples/phantomjs/axe-phantom.js @@ -10,6 +10,8 @@ if (args.length < 2) { phantom.exit(1); } +console.log('Testing, please wait...') + page.open(args[1], function (status) { // Check for page load success if (status !== 'success') { @@ -37,9 +39,13 @@ page.open(args[1], function (status) { if (args[2]) { fs.write(args[2], JSON.stringify(msg, null, ' '), 'w'); } else { - console.log(JSON.stringify(msg, null, ' ')); + if (msg.violations.length) { + console.log(JSON.stringify(msg.violations, null, ' ')); + } else { + console.log('No violations found!') + } } - phantom.exit(); + phantom.exit(msg.violations.length); }; }); diff --git a/doc/examples/phantomjs/package.json b/doc/examples/phantomjs/package.json new file mode 100644 index 0000000000..1ba24b504f --- /dev/null +++ b/doc/examples/phantomjs/package.json @@ -0,0 +1,19 @@ +{ + "name": "axe-phantomjs-example", + "description": "aXe Mocha Example", + "version": "0.0.1", + "private": true, + "author": { + "name": "Wlico Fiers", + "organization": "Deque Systems, Inc.", + "url": "http://deque.com/" + }, + "dependencies": {}, + "scripts": { + "test": "phantomjs axe-phantom.js http://www.deque.com" + }, + "devDependencies": { + "axe-core": "^2.6.1", + "phantomjs": "^2.1.7" + } +}