diff --git a/tests/spec/121-delete-and-redraft.js b/tests/spec/121-delete-and-redraft.js index 557c21fb..6ce6a4bc 100644 --- a/tests/spec/121-delete-and-redraft.js +++ b/tests/spec/121-delete-and-redraft.js @@ -129,31 +129,27 @@ test('delete and redraft reply within thread', async t => { .expect(getNthStatusContent(1).innerText).contains('this is a thread') .click(getNthStatus(1)) .expect(getUrl()).match(/statuses/) - await sleep(1000) await t - .expect(getNthStatusContent(1).innerText).contains('this is a thread') + .expect(getNthStatusContent(1).innerText).contains('this is a thread', { timeout: 30000 }) .click(getNthReplyButton(1)) - await sleep(1000) + await sleep(2000) await t .typeText(getNthComposeReplyInput(1), 'heyo', { paste: true }) .click(getNthComposeReplyButton(1)) - await sleep(1000) await t - .expect(getNthStatus(2).innerText).contains('@admin heyo') + .expect(getNthStatus(2).innerText).contains('@admin heyo', { timeout: 30000 }) .click(getNthStatusOptionsButton(2)) - await sleep(500) + await sleep(2000) await t .click(dialogOptionsOption.withText('Delete and redraft')) - await sleep(500) await t - .expect(modalDialog.hasAttribute('aria-hidden')).notOk() + .expect(modalDialog.hasAttribute('aria-hidden')).notOk({ timeout: 30000 }) .typeText(composeModalInput, ' update!', { paste: true }) - await sleep(1000) + await sleep(2000) await t .click(composeModalComposeButton) - await sleep(1000) await t - .expect(modalDialog.exists).notOk() + .expect(modalDialog.exists).notOk({ timeout: 20000 }) .expect(getNthStatusContent(2).innerText).match(/@admin heyo\s+update!/, { timeout: 30000 }) diff --git a/tests/spec/126-polls.js b/tests/spec/126-polls.js index 5df62678..38e5ec12 100644 --- a/tests/spec/126-polls.js +++ b/tests/spec/126-polls.js @@ -71,8 +71,9 @@ test('Can update poll results', async t => { }) test('Poll results refresh everywhere', async t => { - await loginAsFoobar(t) await createPollAs('admin', 'another poll', ['yes', 'no'], false) + await sleep(2000) + await loginAsFoobar(t) await t .expect(getNthStatusContent(1).innerText).contains('another poll') .click(getNthStatusRelativeDate(1)) diff --git a/tests/spec/127-compose-polls.js b/tests/spec/127-compose-polls.js index 785009db..92d80b69 100644 --- a/tests/spec/127-compose-polls.js +++ b/tests/spec/127-compose-polls.js @@ -7,7 +7,7 @@ import { getComposePollNthInput, composePoll, composePollMultipleChoice, - composePollExpiry, composePollAddButton, getComposePollRemoveNthButton, postStatusButton, composeInput + composePollExpiry, composePollAddButton, getComposePollRemoveNthButton, postStatusButton, composeInput, sleep } from '../utils' import { loginAsFoobar } from '../roles' import { POLL_EXPIRY_DEFAULT } from '../../src/routes/_static/polls' @@ -42,20 +42,28 @@ test('Can add and remove poll options', async t => { .expect(composePoll.exists).ok() .typeText(getComposePollNthInput(1), 'first', { paste: true }) .typeText(getComposePollNthInput(2), 'second', { paste: true }) + await sleep(1000) + await t .click(composePollAddButton) .typeText(getComposePollNthInput(3), 'third', { paste: true }) .expect(getComposePollNthInput(1).value).eql('first') .expect(getComposePollNthInput(2).value).eql('second') .expect(getComposePollNthInput(3).value).eql('third') .expect(getComposePollNthInput(4).exists).notOk() + await sleep(1000) + await t .click(getComposePollRemoveNthButton(2)) .expect(getComposePollNthInput(1).value).eql('first') .expect(getComposePollNthInput(2).value).eql('third') .expect(getComposePollNthInput(3).exists).notOk() .expect(getComposePollNthInput(4).exists).notOk() + await sleep(1000) + await t .click(composePollAddButton) .typeText(getComposePollNthInput(3), 'fourth', { paste: true }) .typeText(composeInput, 'Vote on my poll!!!', { paste: true }) + await sleep(1000) + await t .click(postStatusButton) .expect(getNthStatusContent(1).innerText).contains('Vote on my poll!!!') .expect(getNthStatusPollForm(1).exists).notOk()