From 2a15773e046e3278af1ffb783a254670e1220ed4 Mon Sep 17 00:00:00 2001 From: Rayraegah Date: Sat, 21 May 2016 14:13:38 +0100 Subject: [PATCH] Added "wait" field in new task and edit task pages Added UI control to set `wait` option in pa11y script. Updated test cases. [pa11y-dashboard issue #127](https://github.com/springernature/pa11y-dashboard/issues/127) --- route/new.js | 1 + route/task/edit.js | 1 + test/integration/route/new.js | 7 +++++++ test/integration/route/task/edit.js | 7 +++++++ view/new.html | 10 ++++++++++ view/task/edit.html | 10 ++++++++++ 6 files changed, 36 insertions(+) diff --git a/route/new.js b/route/new.js index 8feee25..a5bd5cc 100644 --- a/route/new.js +++ b/route/new.js @@ -42,6 +42,7 @@ function route(app) { standard: req.body.standard, ignore: req.body.ignore || [], timeout: req.body.timeout, + wait: req.body.wait, username: req.body.username, password: req.body.password }; diff --git a/route/task/edit.js b/route/task/edit.js index 23b0e33..4fa2c69 100644 --- a/route/task/edit.js +++ b/route/task/edit.js @@ -60,6 +60,7 @@ function route(app) { task.name = req.body.name; task.ignore = req.body.ignore; task.timeout = req.body.timeout; + task.wait = req.body.wait; task.username = req.body.username; task.password = req.body.password; var standards = getStandards().map(function(standard) { diff --git a/test/integration/route/new.js b/test/integration/route/new.js index a30162c..3706617 100644 --- a/test/integration/route/new.js +++ b/test/integration/route/new.js @@ -62,6 +62,13 @@ describe('GET /new', function() { assert.strictEqual(field.getAttribute('value'), ''); }); + it('should have a "wait" field', function() { + var field = this.form.querySelectorAll('input[name=wait]')[0]; + assert.isDefined(field); + assert.strictEqual(field.getAttribute('type'), 'text'); + assert.strictEqual(field.getAttribute('value'), ''); + }); + it('should have a "username" field', function() { var field = this.form.querySelectorAll('input[name=username]')[0]; assert.isDefined(field); diff --git a/test/integration/route/task/edit.js b/test/integration/route/task/edit.js index 78d2af6..ea11e98 100644 --- a/test/integration/route/task/edit.js +++ b/test/integration/route/task/edit.js @@ -63,6 +63,13 @@ describe('GET //edit', function() { assert.isDefined(field.getAttribute('disabled')); }); + it('should have a "wait" field', function() { + var field = this.form.querySelectorAll('input[name=wait]')[0]; + assert.isDefined(field); + assert.strictEqual(field.getAttribute('type'), 'text'); + assert.strictEqual(field.getAttribute('value'), '0'); + }); + it('should have a disabled "standard" field', function() { var field = this.form.querySelectorAll('select[name=standard]')[0]; assert.isDefined(field); diff --git a/view/new.html b/view/new.html index b826aed..d6d6cff 100644 --- a/view/new.html +++ b/view/new.html @@ -74,6 +74,16 @@ along with pa11y-dashboard. If not, see . +
+
+
+ + + (Note: default wait time is 0ms) +
+
+
+
diff --git a/view/task/edit.html b/view/task/edit.html index 173f482..8c7e834 100644 --- a/view/task/edit.html +++ b/view/task/edit.html @@ -86,6 +86,16 @@ along with pa11y-dashboard. If not, see .
+
+
+
+ + + (Note: default wait time is 0ms) +
+
+
+