From 5ae36b00c9bd638a4c83b63a0c8268ec8621be63 Mon Sep 17 00:00:00 2001 From: John O'Nolan Date: Sun, 8 Sep 2013 17:56:45 +0200 Subject: [PATCH] Updating tests --- core/test/functional/admin/01_login_test.js | 10 ++++++++-- core/test/functional/admin/07_logout_test.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/test/functional/admin/01_login_test.js b/core/test/functional/admin/01_login_test.js index d184301885..7c54411349 100644 --- a/core/test/functional/admin/01_login_test.js +++ b/core/test/functional/admin/01_login_test.js @@ -20,7 +20,7 @@ casper.test.begin('Ensure a User is Registered', 2, function suite(test) { casper.waitFor(function checkOpaque() { return this.evaluate(function () { var loginBox = document.querySelector('.login-box'); - return window.getComputedStyle(loginBox).getPropertyValue('display') === "block" + return window.getComputedStyle(loginBox).getPropertyValue('display') === "table" && window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1"; }); }, function then() { @@ -90,11 +90,13 @@ casper.test.begin("Can't spam it", 4, function suite(test) { return this.evaluate(function () { var loginBox = document.querySelector('.login-box'); - return window.getComputedStyle(loginBox).getPropertyValue('display') === "block" + return window.getComputedStyle(loginBox).getPropertyValue('display') === "table" && window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1"; }); }, function then() { this.fill("#login", falseUser, true); + }, function onTimeout() { + test.fail('Sign in form didn\'t fade in.'); }); casper.wait(200, function doneWait() { @@ -109,6 +111,10 @@ casper.test.begin("Can't spam it", 4, function suite(test) { test.assert(false, 'Spamming the login did not result in an error notification'); }); + // This test causes the spam notification + // add a wait to ensure future tests don't get tripped up by this. + casper.wait(1000); + casper.run(function () { test.done(); }); diff --git a/core/test/functional/admin/07_logout_test.js b/core/test/functional/admin/07_logout_test.js index e811224466..d9eadc59fb 100644 --- a/core/test/functional/admin/07_logout_test.js +++ b/core/test/functional/admin/07_logout_test.js @@ -43,7 +43,7 @@ casper.test.begin("Can't spam signin", 3, function suite(test) { casper.waitFor(function checkOpaque() { return this.evaluate(function () { var loginBox = document.querySelector('.login-box'); - return window.getComputedStyle(loginBox).getPropertyValue('display') === "block" + return window.getComputedStyle(loginBox).getPropertyValue('display') === "table" && window.getComputedStyle(loginBox).getPropertyValue('opacity') === "1"; }); }, function then() {