mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
tests: timeouts for tests (#4773)
This commit is contained in:
parent
f9ec49d7ac
commit
e585d321f9
42 changed files with 368 additions and 4 deletions
|
@ -10,6 +10,7 @@ describe('All the alphabet works n stuff', function () {
|
|||
});
|
||||
|
||||
it('when you enter any char it appears right', function (done) {
|
||||
this.timeout(250);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('bold button', function () {
|
|||
});
|
||||
|
||||
it('makes text bold on click', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -36,6 +37,7 @@ describe('bold button', function () {
|
|||
});
|
||||
|
||||
it('makes text bold on keypress', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
|
|
@ -9,7 +9,7 @@ describe('change user color', function () {
|
|||
|
||||
it('Color picker matches original color and remembers the user color' +
|
||||
' after a refresh', function (done) {
|
||||
this.timeout(60000);
|
||||
this.timeout(10000);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// click on the settings button to make settings visible
|
||||
|
@ -63,6 +63,7 @@ describe('change user color', function () {
|
|||
});
|
||||
|
||||
it('Own user color is shown when you enter a chat', function (done) {
|
||||
this.timeout(1000);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
const $colorOption = helper.padChrome$('#options-colorscheck');
|
||||
|
|
|
@ -7,6 +7,7 @@ describe('change username value', function () {
|
|||
});
|
||||
|
||||
it('Remembers the user name after a refresh', async function () {
|
||||
this.timeout(1500);
|
||||
helper.toggleUserList();
|
||||
helper.setUserName('😃');
|
||||
|
||||
|
@ -21,6 +22,7 @@ describe('change username value', function () {
|
|||
});
|
||||
|
||||
it('Own user name is shown when you enter a chat', async function () {
|
||||
this.timeout(1500);
|
||||
helper.toggleUserList();
|
||||
helper.setUserName('😃');
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('Chat messages and UI', function () {
|
|||
|
||||
it('opens chat, sends a message, makes sure it exists ' +
|
||||
'on the page and hides chat', async function () {
|
||||
this.timeout(3000);
|
||||
const chatValue = 'JohnMcLear';
|
||||
|
||||
await helper.showChat();
|
||||
|
@ -50,6 +51,7 @@ describe('Chat messages and UI', function () {
|
|||
|
||||
it('makes chat stick to right side of the screen via settings, ' +
|
||||
'remove sticky via settings, close it', async function () {
|
||||
this.timeout(5000);
|
||||
await helper.showSettings();
|
||||
|
||||
await helper.enableStickyChatviaSettings();
|
||||
|
@ -67,6 +69,7 @@ describe('Chat messages and UI', function () {
|
|||
|
||||
it('makes chat stick to right side of the screen via icon on the top' +
|
||||
' right, remove sticky via icon, close it', async function () {
|
||||
this.timeout(5000);
|
||||
await helper.showChat();
|
||||
|
||||
await helper.enableStickyChatviaIcon();
|
||||
|
@ -111,6 +114,6 @@ describe('Chat messages and UI', function () {
|
|||
}, 1000);
|
||||
},
|
||||
});
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -30,6 +30,7 @@ describe('chat-load-messages', function () {
|
|||
});
|
||||
|
||||
it('checks initial message count', function (done) {
|
||||
this.timeout(1000);
|
||||
let chatText;
|
||||
const expectedCount = 101;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
@ -45,6 +46,7 @@ describe('chat-load-messages', function () {
|
|||
});
|
||||
|
||||
it('loads more messages', function (done) {
|
||||
this.timeout(3000);
|
||||
const expectedCount = 122;
|
||||
const chrome$ = helper.padChrome$;
|
||||
const chatButton = chrome$('#chaticon');
|
||||
|
@ -60,6 +62,7 @@ describe('chat-load-messages', function () {
|
|||
});
|
||||
|
||||
it('checks for button vanishing', function (done) {
|
||||
this.timeout(2000);
|
||||
const expectedDisplay = 'none';
|
||||
const chrome$ = helper.padChrome$;
|
||||
const chatButton = chrome$('#chaticon');
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('clear authorship colors button', function () {
|
|||
});
|
||||
|
||||
it('makes text clear authorship colors', function (done) {
|
||||
this.timeout(2500);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -55,6 +56,7 @@ describe('clear authorship colors button', function () {
|
|||
});
|
||||
|
||||
it("makes text clear authorship colors and checks it can't be undone", function (done) {
|
||||
this.timeout(1500);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('delete keystroke', function () {
|
|||
});
|
||||
|
||||
it('makes text delete', function (done) {
|
||||
this.timeout(50);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
|
|
@ -31,6 +31,7 @@ describe('drag and drop', function () {
|
|||
});
|
||||
|
||||
it('moves text back to its original place', function (done) {
|
||||
this.timeout(50);
|
||||
// test text was removed from drop target
|
||||
const $targetLine = getLine(TARGET_LINE);
|
||||
expect($targetLine.text()).to.be('Target line []');
|
||||
|
@ -68,6 +69,7 @@ describe('drag and drop', function () {
|
|||
});
|
||||
|
||||
it('moves text back to its original place', function (done) {
|
||||
this.timeout(50);
|
||||
// test text was removed from drop target
|
||||
const $targetLine = getLine(TARGET_LINE);
|
||||
expect($targetLine.text()).to.be('Target line []');
|
||||
|
|
|
@ -57,6 +57,7 @@ describe('embed links', function () {
|
|||
|
||||
describe('the share link', function () {
|
||||
it('is the actual pad url', function (done) {
|
||||
this.timeout(50);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// open share dropdown
|
||||
|
@ -73,6 +74,7 @@ describe('embed links', function () {
|
|||
|
||||
describe('the embed as iframe code', function () {
|
||||
it('is an iframe with the the correct url parameters and correct size', function (done) {
|
||||
this.timeout(50);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// open share dropdown
|
||||
|
@ -96,6 +98,7 @@ describe('embed links', function () {
|
|||
|
||||
describe('the share link', function () {
|
||||
it('shows a read only url', function (done) {
|
||||
this.timeout(50);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// open share dropdown
|
||||
|
@ -114,6 +117,7 @@ describe('embed links', function () {
|
|||
|
||||
describe('the embed as iframe code', function () {
|
||||
it('is an iframe with the the correct url parameters and correct size', function (done) {
|
||||
this.timeout(50);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// open share dropdown
|
||||
|
|
|
@ -7,6 +7,7 @@ describe('enter keystroke', function () {
|
|||
this.timeout(60000);
|
||||
});
|
||||
it('creates a new line & puts cursor onto a new line', function (done) {
|
||||
this.timeout(2000);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('font select', function () {
|
|||
});
|
||||
|
||||
it('makes text RobotoMono', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('indentation button', function () {
|
|||
});
|
||||
|
||||
it('indent text with keypress', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
@ -24,6 +25,7 @@ describe('indentation button', function () {
|
|||
});
|
||||
|
||||
it('indent text with button', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -34,6 +36,7 @@ describe('indentation button', function () {
|
|||
});
|
||||
|
||||
it('keeps the indent on enter for the new line', function (done) {
|
||||
this.timeout(1200);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -59,6 +62,7 @@ describe('indentation button', function () {
|
|||
|
||||
it('indents text with spaces on enter if previous line ends ' +
|
||||
"with ':', '[', '(', or '{'", function (done) {
|
||||
this.timeout(1200);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// type a bit, make a line break and type again
|
||||
|
@ -110,6 +114,7 @@ describe('indentation button', function () {
|
|||
|
||||
it('appends indentation to the indent of previous line if previous line ends ' +
|
||||
"with ':', '[', '(', or '{'", function (done) {
|
||||
this.timeout(1200);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// type a bit, make a line break and type again
|
||||
|
@ -135,6 +140,7 @@ describe('indentation button', function () {
|
|||
|
||||
it("issue #2772 shows '*' when multiple indented lines " +
|
||||
' receive a style and are outdented', async function () {
|
||||
this.timeout(1200);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('italic some text', function () {
|
|||
});
|
||||
|
||||
it('makes text italic using button', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -37,6 +38,7 @@ describe('italic some text', function () {
|
|||
});
|
||||
|
||||
it('makes text italic using keypress', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element out of the inner iframe
|
||||
|
|
|
@ -16,6 +16,7 @@ describe('Language select and change', function () {
|
|||
|
||||
// Destroy language cookies
|
||||
it('makes text german', function (done) {
|
||||
this.timeout(1000);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// click on the settings button to make settings visible
|
||||
|
@ -45,6 +46,7 @@ describe('Language select and change', function () {
|
|||
});
|
||||
|
||||
it('makes text English', function (done) {
|
||||
this.timeout(1000);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// click on the settings button to make settings visible
|
||||
|
@ -75,6 +77,7 @@ describe('Language select and change', function () {
|
|||
});
|
||||
|
||||
it('changes direction when picking an rtl lang', function (done) {
|
||||
this.timeout(1000);
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
// click on the settings button to make settings visible
|
||||
|
|
|
@ -27,6 +27,7 @@ describe('author of pad edition', function () {
|
|||
|
||||
// author 2 makes some changes on the pad
|
||||
it('Clears Authorship by second user', function (done) {
|
||||
this.timeout(100);
|
||||
clearAuthorship(done);
|
||||
});
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('inserts ordered list text', function (done) {
|
||||
this.timeout(200);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -28,6 +29,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('inserts unordered list', function (done) {
|
||||
this.timeout(50);
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1)
|
||||
.done(done);
|
||||
});
|
||||
|
@ -52,6 +54,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('does not insert unordered list', function (done) {
|
||||
this.timeout(3000);
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1)
|
||||
.done(() => {
|
||||
expect().fail(() => 'Unordered list inserted, should ignore shortcut');
|
||||
|
@ -73,6 +76,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('inserts unordered list', function (done) {
|
||||
this.timeout(200);
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1)
|
||||
.done(done);
|
||||
});
|
||||
|
@ -97,6 +101,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('does not insert unordered list', function (done) {
|
||||
this.timeout(3000);
|
||||
helper.waitFor(() => helper.padInner$('div').first().find('ol li').length === 1)
|
||||
.done(() => {
|
||||
expect().fail(() => 'Unordered list inserted, should ignore shortcut');
|
||||
|
@ -175,6 +180,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('indent and de-indent list item with keypress', function (done) {
|
||||
this.timeout(200);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -210,6 +216,7 @@ describe('ordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('indent and de-indent list item with indent button', function (done) {
|
||||
this.timeout(1000);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ describe('Pad modal', function () {
|
|||
});
|
||||
|
||||
it('disables editor', function (done) {
|
||||
this.timeout(200);
|
||||
expect(isEditorDisabled()).to.be(true);
|
||||
|
||||
done();
|
||||
|
@ -25,6 +26,7 @@ describe('Pad modal', function () {
|
|||
|
||||
context('and user clicks on editor', function () {
|
||||
it('does not close the modal', function (done) {
|
||||
this.timeout(200);
|
||||
clickOnPadInner();
|
||||
const $modal = helper.padChrome$(MODAL_SELECTOR);
|
||||
const modalIsVisible = $modal.hasClass('popup-show');
|
||||
|
@ -37,6 +39,7 @@ describe('Pad modal', function () {
|
|||
|
||||
context('and user clicks on pad outer', function () {
|
||||
it('does not close the modal', function (done) {
|
||||
this.timeout(200);
|
||||
clickOnPadOuter();
|
||||
const $modal = helper.padChrome$(MODAL_SELECTOR);
|
||||
const modalIsVisible = $modal.hasClass('popup-show');
|
||||
|
@ -68,6 +71,7 @@ describe('Pad modal', function () {
|
|||
*/
|
||||
context('and user clicks on editor', function () {
|
||||
it('closes the modal', async function () {
|
||||
this.timeout(200);
|
||||
clickOnPadInner();
|
||||
await helper.waitForPromise(() => isModalOpened(MODAL_SELECTOR) === false);
|
||||
});
|
||||
|
@ -75,6 +79,7 @@ describe('Pad modal', function () {
|
|||
|
||||
context('and user clicks on pad outer', function () {
|
||||
it('closes the modal', async function () {
|
||||
this.timeout(200);
|
||||
clickOnPadOuter();
|
||||
await helper.waitForPromise(() => isModalOpened(MODAL_SELECTOR) === false);
|
||||
});
|
||||
|
|
|
@ -7,6 +7,7 @@ describe('undo button then redo button', function () {
|
|||
});
|
||||
|
||||
it('redo some typing with button', function (done) {
|
||||
this.timeout(200);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -34,6 +35,7 @@ describe('undo button then redo button', function () {
|
|||
});
|
||||
|
||||
it('redo some typing with keypress', function (done) {
|
||||
this.timeout(200);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element inside the editable space
|
||||
|
|
|
@ -12,7 +12,7 @@ describe('scrollTo.js', function () {
|
|||
});
|
||||
|
||||
it('Scrolls down to Line 4', async function () {
|
||||
this.timeout(10000);
|
||||
this.timeout(100);
|
||||
const chrome$ = helper.padChrome$;
|
||||
await helper.waitForPromise(() => {
|
||||
const topOffset = parseInt(chrome$('iframe').first('iframe')
|
||||
|
@ -33,7 +33,7 @@ describe('scrollTo.js', function () {
|
|||
});
|
||||
|
||||
it('Does NOT change scroll', async function () {
|
||||
this.timeout(10000);
|
||||
this.timeout(100);
|
||||
const chrome$ = helper.padChrome$;
|
||||
await helper.waitForPromise(() => {
|
||||
const topOffset = parseInt(chrome$('iframe').first('iframe')
|
||||
|
|
|
@ -44,12 +44,14 @@ describe('select formatting buttons when selection has style applied', function
|
|||
|
||||
const testIfFormattingButtonIsDeselected = function (style) {
|
||||
it(`deselects the ${style} button`, function (done) {
|
||||
this.timeout(50);
|
||||
helper.waitFor(() => isButtonSelected(style) === false).done(done);
|
||||
});
|
||||
};
|
||||
|
||||
const testIfFormattingButtonIsSelected = function (style) {
|
||||
it(`selects the ${style} button`, function (done) {
|
||||
this.timeout(50);
|
||||
helper.waitFor(() => isButtonSelected(style)).done(done);
|
||||
});
|
||||
};
|
||||
|
@ -129,6 +131,7 @@ describe('select formatting buttons when selection has style applied', function
|
|||
|
||||
context('when user applies a style and the selection does not change', function () {
|
||||
it('selects the style button', async function () {
|
||||
this.timeout(50);
|
||||
const style = STYLES[0]; // italic
|
||||
applyStyleOnLine(style, FIRST_LINE);
|
||||
await helper.waitForPromise(() => isButtonSelected(style) === true);
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('strikethrough button', function () {
|
|||
});
|
||||
|
||||
it('makes text strikethrough', function (done) {
|
||||
this.timeout(100);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ describe('timeslider follow', function () {
|
|||
// TODO needs test if content is also followed, when user a makes edits
|
||||
// while user b is in the timeslider
|
||||
it("content as it's added to timeslider", async function () {
|
||||
this.timeout(10000);
|
||||
// send 6 revisions
|
||||
const revs = 6;
|
||||
const message = 'a\n\n\n\n\n\n\n\n\n\n';
|
||||
|
|
|
@ -10,6 +10,7 @@ describe('timeslider', function () {
|
|||
* @todo test authorsList
|
||||
*/
|
||||
it("Shows a date/time in the timeslider and make sure it doesn't include NaN", async function () {
|
||||
this.timeout(12000);
|
||||
// make some changes to produce 3 revisions
|
||||
const revs = 3;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ describe('timeslider', function () {
|
|||
});
|
||||
|
||||
it('Makes sure the export URIs are as expected when the padID is numeric', async function () {
|
||||
this.timeout(60000);
|
||||
await helper.edit('a\n');
|
||||
|
||||
await helper.gotoTimeslider(1);
|
||||
|
|
|
@ -8,6 +8,7 @@ describe('timeslider', function () {
|
|||
});
|
||||
|
||||
it('loads adds a hundred revisions', function (done) { // passes
|
||||
this.timeout(100000);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ describe('undo button', function () {
|
|||
});
|
||||
|
||||
it('undo some typing by clicking undo button', function (done) {
|
||||
this.timeout(100);
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -31,6 +33,7 @@ describe('undo button', function () {
|
|||
});
|
||||
|
||||
it('undo some typing using a keypress', function (done) {
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
|
||||
// get the first text element inside the editable space
|
||||
|
|
|
@ -9,6 +9,7 @@ describe('unordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('insert unordered list text then removes by outdent', function (done) {
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
const originalText = inner$('div').first().text();
|
||||
|
@ -42,6 +43,7 @@ describe('unordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('insert unordered list text then remove by clicking list again', function (done) {
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
const originalText = inner$('div').first().text();
|
||||
|
@ -77,6 +79,7 @@ describe('unordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('Keeps the unordered list on enter for the new line', function (done) {
|
||||
this.timeout(250);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -108,6 +111,7 @@ describe('unordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('indent and de-indent list item with keypress', function (done) {
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
@ -142,6 +146,7 @@ describe('unordered_list.js', function () {
|
|||
});
|
||||
|
||||
it('indent and de-indent list item with indent button', function (done) {
|
||||
this.timeout(150);
|
||||
const inner$ = helper.padInner$;
|
||||
const chrome$ = helper.padChrome$;
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ describe('urls', function () {
|
|||
describe('entering a URL makes a link', function () {
|
||||
for (const url of ['https://etherpad.org', 'www.etherpad.org']) {
|
||||
it(url, async function () {
|
||||
this.timeout(5000);
|
||||
const url = 'https://etherpad.org';
|
||||
await helper.edit(url);
|
||||
await helper.waitForPromise(() => txt().find('a').length === 1, 2000);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue