From 7fe59d2dcd4d061cd71d1418bc9fc3a09bb82123 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 11 Jan 2018 07:32:25 -0500 Subject: [PATCH] casper: Add heading output to message editing test. It's always been difficult to find code in this file, particularly when you're matching it up to test failures. --- .../casper_tests/12-toggle-message-editing.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/frontend_tests/casper_tests/12-toggle-message-editing.js b/frontend_tests/casper_tests/12-toggle-message-editing.js index 34f2b54e86..305d34e9b9 100644 --- a/frontend_tests/casper_tests/12-toggle-message-editing.js +++ b/frontend_tests/casper_tests/12-toggle-message-editing.js @@ -1,5 +1,10 @@ var common = require('../casper_lib/common.js').common; +function heading(heading_str) { + casper.then(function () { + casper.test.info(heading_str); + }); +} function submit_checked() { casper.then(function () { @@ -89,6 +94,9 @@ casper.then(function () { }); }); +// DEACTIVATE + +heading("DEACTIVATE"); common.then_click("li[data-section='organization-settings']"); // deactivate "allow message editing" @@ -110,6 +118,9 @@ casper.then(function () { casper.click('.settings-header .exit'); }); +// VIEW SOURCE + +heading("VIEW SOURCE"); // Check that edit link has changed to "View source" in the popover menu // TODO: also check that the edit icon no longer appears next to the message casper.then(function () { @@ -135,6 +146,10 @@ casper.then(function () { }); }); +// REACTIVATE + +heading("REACTIVATE"); + // go back to admin page, and reactivate "allow message editing" common.then_click('#settings-dropdown'); common.then_click('a[href^="#organization"]'); @@ -151,6 +166,9 @@ casper.then(function () { }); }); +// DEACTIVATE + +heading("DEACTIVATE"); // go to admin page casper.then(function () { @@ -188,6 +206,9 @@ casper.then(function () { }); }); +// REACTIVATE +heading("REACTIVATE"); + common.then_click('input[type="checkbox"][id="id_realm_allow_message_editing"] + span'); submit_checked(); @@ -203,6 +224,9 @@ casper.then(function () { }); }); +// SET LIMIT TO 0 +heading("NO LIMIT"); + casper.then(function () { // allow arbitrary message editing casper.waitUntilVisible('input[type="checkbox"][id="id_realm_allow_message_editing"] + span', function () { @@ -225,6 +249,9 @@ casper.then(function () { }); }); +// ILLEGAL LIMIT +heading("ILLEGAL LIMIT"); + casper.then(function () { // disallow message editing, with illegal edit limit value. should be fixed by admin.js casper.waitUntilVisible('input[type="checkbox"][id="id_realm_allow_message_editing"] + span', function () {