tests: frontend helper for admin UI tests
parent
c639e743d7
commit
b79c347196
|
@ -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 = $(`<iframe src='/admin/${page}'></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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue