diff --git a/src/tests/frontend/helper.js b/src/tests/frontend/helper.js index c38175fe1..0f8a32f1a 100644 --- a/src/tests/frontend/helper.js +++ b/src/tests/frontend/helper.js @@ -1,4 +1,5 @@ 'use strict'; + const helper = {}; // eslint-disable-line no-redeclare (function () { @@ -180,6 +181,22 @@ const helper = {}; // eslint-disable-line no-redeclare return padName; }; + helper.newAdmin = async function (page) { + // define the iframe + $iframe = $(``); + + // clean up inner iframe references + helper.admin$ = null; + + // remove old iframe + $('#iframe-container iframe').remove(); + // set new iframe + $('#iframe-container').append($iframe); + $iframe.one('load', () => { + helper.admin$ = getFrameJQuery($('#iframe-container iframe')); + }); + }; + helper.waitFor = function (conditionFunc, timeoutTime = 1900, intervalTime = 10) { const deferred = new $.Deferred();