tests: admin test timeout increase, bugfix and removal of buggy test (#4762)

pull/4771/head
John McLear 2021-02-12 20:04:42 +00:00 committed by GitHub
parent 73d31b12a8
commit fcd9adf20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 54 deletions

View File

@ -65,8 +65,8 @@ $(() => {
runner.on('pass', (test) => {
if (killTimeout) clearTimeout(killTimeout);
killTimeout = setTimeout(() => {
append('FINISHED - [red]no test started since 3 minutes, tests stopped[clear]');
}, 60000 * 3);
append('FINISHED - [red]no test started since 5 minutes, tests stopped[clear]');
}, 60000 * 5);
const medium = test.slow() / 2;
test.speed = test.duration > test.slow()
@ -82,8 +82,8 @@ $(() => {
runner.on('fail', (test, err) => {
if (killTimeout) clearTimeout(killTimeout);
killTimeout = setTimeout(() => {
append('FINISHED - [red]no test started since 3 minutes, tests stopped[clear]');
}, 60000 * 3);
append('FINISHED - [red]no test started since 5 minutes, tests stopped[clear]');
}, 60000 * 5);
stats.failures++;
test.err = err;
@ -93,8 +93,8 @@ $(() => {
runner.on('pending', (test) => {
if (killTimeout) clearTimeout(killTimeout);
killTimeout = setTimeout(() => {
append('FINISHED - [red]no test started since 3 minutes, tests stopped[clear]');
}, 60000 * 3);
append('FINISHED - [red]no test started since 5 minutes, tests stopped[clear]');
}, 60000 * 5);
stats.pending++;
append(`-> [yellow]PENDING[clear]: ${test.title}`);

View File

@ -1,29 +0,0 @@
'use strict';
describe('Admin page', function () {
before(async function () {
let success = false;
$.ajax({
url: `${location.protocol}//admin:changeme@${location.hostname}:${location.port}/admin/`,
type: 'GET',
success: () => success = true,
});
await helper.waitForPromise(() => success === true);
});
beforeEach(async function () {
helper.newAdmin('');
await helper.waitForPromise(
() => helper.admin$ && helper.admin$('.menu').find('li').length >= 3);
});
it('Shows Plugin Manager Link', async function () {
helper.admin$('a[data-l10n-id="admin_plugins"]').is(':visible');
});
it('Shows Troubleshooting Info Link', async function () {
helper.admin$('a[data-l10n-id="admin_plugins_info"]').is(':visible');
});
it('Shows Settings Link', async function () {
helper.admin$('a[data-l10n-id="admin_settings"]').is(':visible');
});
});

View File

@ -16,7 +16,8 @@ describe('Admin > Settings', function () {
beforeEach(async function () {
helper.newAdmin('settings');
// needed, because the load event is fired to early
await helper.waitForPromise(() => helper.admin$ && helper.admin$('.settings').val().length > 0);
await helper.waitForPromise(
() => helper.admin$ && helper.admin$('.settings').val().length > 0, 5000);
});
it('Are Settings visible, populated, does save work', async function () {
@ -27,16 +28,17 @@ describe('Admin > Settings', function () {
// set new value
helper.admin$('.settings').val((_, text) => `/* test */\n${text}`);
await helper.waitForPromise(
() => settingsLength + 11 === helper.admin$('.settings').val().length);
() => settingsLength + 11 === helper.admin$('.settings').val().length, 5000);
// saves
helper.admin$('#saveSettings').click();
await helper.waitForPromise(() => helper.admin$('#response').is(':visible'));
await helper.waitForPromise(() => helper.admin$('#response').is(':visible'), 5000);
// new value for settings.json should now be saved
// reset it to the old value
helper.newAdmin('settings');
await helper.waitForPromise(() => helper.admin$ && helper.admin$('.settings').val().length > 0);
await helper.waitForPromise(
() => helper.admin$ && helper.admin$('.settings').val().length > 0, 20000);
// replace the test value with a line break
helper.admin$('.settings').val((_, text) => text.replace('/* test */\n', ''));

View File

@ -19,11 +19,11 @@ describe('Plugins page', function () {
beforeEach(async function () {
helper.newAdmin('plugins');
await helper.waitForPromise(
() => helper.admin$ && helper.admin$('.menu').find('li').length >= 3);
() => helper.admin$ && helper.admin$('.menu').find('li').length >= 3, 30000);
});
it('Lists some plugins', async function () {
await helper.waitForPromise(() => helper.admin$('.results').children().length > 50);
await helper.waitForPromise(() => helper.admin$('.results').children().length > 50, 20000);
});
it('Searches for plugin', async function () {
@ -33,7 +33,9 @@ describe('Plugins page', function () {
});
it('Attempt to Update a plugin', async function () {
this.timeout(120000);
this.timeout(280000);
await helper.waitForPromise(() => helper.admin$('.results').children().length > 50, 20000);
if (helper.admin$('.ep_align').length === 0) this.skip();
@ -70,41 +72,41 @@ describe('Plugins page', function () {
// allow 50 seconds, check every 1 second.
});
it('Attempt to Install a plugin', async function () {
this.timeout(240000);
this.timeout(280000);
helper.admin$('#search-query').val('ep_activepads');
helper.admin$('#search-query').val('ep_headings2');
await helper.waitForPromise(() => helper.admin$('.results').children().length < 300, 6000);
await helper.waitForPromise(() => helper.admin$('.results').children().length > 0, 6000);
// skip if we already have ep_activepads installed..
if (helper.admin$('.ep_activepads .do-install').is(':visible') === false) this.skip();
// skip if we already have ep_headings2 installed..
if (helper.admin$('.ep_headings2 .do-install').is(':visible') === false) this.skip();
helper.admin$('.ep_activepads .do-install').click();
helper.admin$('.ep_headings2 .do-install').click();
// ensure install has attempted to be started
await helper.waitForPromise(
() => helper.admin$('.ep_activepads .do-install').length !== 0, 120000);
() => helper.admin$('.ep_headings2 .do-install').length !== 0, 120000);
// ensure its not showing installing any more
await helper.waitForPromise(
() => helper.admin$('.ep_activepads .message').text() === '', 180000);
() => helper.admin$('.ep_headings2 .message').text() === '', 180000);
// ensure uninstall button is visible
await helper.waitForPromise(
() => helper.admin$('.ep_activepads .do-uninstall').length !== 0, 120000);
() => helper.admin$('.ep_headings2 .do-uninstall').length !== 0, 120000);
});
it('Attempt to Uninstall a plugin', async function () {
this.timeout(360000);
await helper.waitForPromise(
() => helper.admin$('.ep_activepads .do-uninstall').length !== 0, 120000);
() => helper.admin$('.ep_headings2 .do-uninstall').length !== 0, 120000);
helper.admin$('.ep_activepads .do-uninstall').click();
helper.admin$('.ep_headings2 .do-uninstall').click();
// ensure its showing uninstalling
await helper.waitForPromise(
() => helper.admin$('.ep_activepads .message')
() => helper.admin$('.ep_headings2 .message')
.text() === 'Uninstalling', 120000);
// ensure its gone
await helper.waitForPromise(
() => helper.admin$('.ep_activepads').length === 0, 240000);
() => helper.admin$('.ep_headings2').length === 0, 240000);
helper.admin$('#search-query').val('ep_font');
await helper.waitForPromise(() => helper.admin$('.results').children().length < 300, 240000);