From 063e7014d12487172c653fa53ff3e273e04f3386 Mon Sep 17 00:00:00 2001 From: Wilco Fiers Date: Wed, 21 Feb 2018 15:05:40 +0100 Subject: [PATCH] fix: Delete Selenium example, use grunt-axe-selenium instead --- doc/examples/selenium/Gruntfile.js | 14 -------- doc/examples/selenium/README.md | 36 ------------------- .../selenium/build/tasks/axe-selenium.js | 36 ------------------- doc/examples/selenium/package.json | 20 ----------- 4 files changed, 106 deletions(-) delete mode 100644 doc/examples/selenium/Gruntfile.js delete mode 100644 doc/examples/selenium/README.md delete mode 100644 doc/examples/selenium/build/tasks/axe-selenium.js delete mode 100644 doc/examples/selenium/package.json diff --git a/doc/examples/selenium/Gruntfile.js b/doc/examples/selenium/Gruntfile.js deleted file mode 100644 index 119fb1ade5..0000000000 --- a/doc/examples/selenium/Gruntfile.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = function (grunt) { - 'use strict'; - grunt.loadTasks('build/tasks'); - - grunt.initConfig({ - 'axe-selenium': { - urls: [ - 'https://github.com/dequelabs/axe-core' - ] - } - }); - - grunt.registerTask('test', ['axe-selenium']); -}; diff --git a/doc/examples/selenium/README.md b/doc/examples/selenium/README.md deleted file mode 100644 index b4d3086724..0000000000 --- a/doc/examples/selenium/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Selenium README # - -This example demonstrates how to use aXe with the Selenium browser automation -tool and Node development tools. - -Selenium integration enables testing of full pages and sites. - -## To configure the example ## - -* Node must be installed; please follow the directions at http://www.nodejs.org - to install it. -* Firefox must be installed; please follow the directions at http://getfirefox.com - to install it. On Unix, ensure that Firefox is on your path. -* `npm install -g grunt-cli` to install the Grunt task runner (may need to be - run with `sudo` on Unix or as Administrator on Windows) -* Move to the `doc/examples/selenium` directory -* `npm install` to install dependencies - -## To run the example ## - -* Move to the `doc/examples/selenium` directory -* `grunt test` to run Selenium - -This should launch an automated Firefox window, load and analyze the -configured web pages, and then output aXe test results to JSON -files, one per URL. - -## To modify the example ## - -To run the example on your own web pages, edit Gruntfile.js. The `urls` -property of the ks-selenium task controls which URLs the example will run on, -so simply edit that property to put in the URLs you wish to test. - -The example is simply logging the analysis results to files. The aXe -documentation should be consulted for more details on customizing and -analyzing calls to `axe.run`. diff --git a/doc/examples/selenium/build/tasks/axe-selenium.js b/doc/examples/selenium/build/tasks/axe-selenium.js deleted file mode 100644 index ac95ca712d..0000000000 --- a/doc/examples/selenium/build/tasks/axe-selenium.js +++ /dev/null @@ -1,36 +0,0 @@ -/*jshint node: true */ -'use strict'; - -var WebDriver = require('selenium-webdriver'), - axeBuilder = require('axe-webdriverjs'); - -module.exports = function (grunt) { - grunt.registerMultiTask('axe-selenium', function () { - - var done = this.async(), - count = this.data.length; - - var driver = new WebDriver.Builder() - .forBrowser('firefox') - .build(); - - driver.manage().timeouts().setScriptTimeout(10000); - - this.data.forEach(function (testUrl) { - driver.get(testUrl) - .then(function () { - axeBuilder(driver) - .analyze(function (result) { - grunt.file.write(result.url.replace(/[^a-z0-9]/gi, '-') - .replace(/-{2,}/g, '-').replace(/^-|-$/g, '').toLowerCase() + '.json', - JSON.stringify(result, null, ' ')); - - if (!--count) { - driver.quit(); - done(result.violations.length === 0); - } - }); - }); - }); - }); -}; diff --git a/doc/examples/selenium/package.json b/doc/examples/selenium/package.json deleted file mode 100644 index eda93d253b..0000000000 --- a/doc/examples/selenium/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "axe-webdriverjs-example", - "description": "aXe WebDriverJS Example", - "version": "0.0.1", - "private": true, - "author": { - "name": "David Sturley", - "organization": "Deque Systems, Inc.", - "url": "http://deque.com/" - }, - "dependencies": {}, - "scripts": { - "build": "grunt" - }, - "devDependencies": { - "axe-webdriverjs": "^0.1.0", - "grunt": "~0.4.5", - "selenium-webdriver": "~2.46.1" - } -}