From 31a6ec68571fb8acf62fb9a951abaada9fe88628 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 23 Feb 2019 12:32:10 -0800 Subject: [PATCH] chore: make test less flaky (#1038) --- tests/spec/010-focus.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/spec/010-focus.js b/tests/spec/010-focus.js index fd4c3d6c..0befd90c 100644 --- a/tests/spec/010-focus.js +++ b/tests/spec/010-focus.js @@ -75,9 +75,12 @@ test('notification timeline preserves focus', async t => { }) test('thread preserves focus', async t => { + const timeout = 30000 + await loginAsFoobar(t) await t .navigateTo('/accounts/3') + .expect(getNthStatus(0).exists).ok({ timeout }) .hover(getNthStatus(0)) await scrollToStatus(t, 2) await t.click(getNthStatus(2)) @@ -91,12 +94,12 @@ test('thread preserves focus', async t => { .expect(getActiveElementInsideNthStatus()).eql('24') .hover(getNthStatus(23)) .click(getNthStatus(23)) - .expect($(`${getNthStatusSelector(23)} .status-absolute-date`).exists).ok() + .expect($(`${getNthStatusSelector(23)} .status-absolute-date`).exists).ok({ timeout }) await goBack() - await t.expect($(`${getNthStatusSelector(24)} .status-absolute-date`).exists).ok() - .expect(getActiveElementClassList()).contains('status-article') - .expect(getActiveElementClassList()).contains('status-in-timeline') - .expect(getActiveElementInsideNthStatus()).eql('23') + await t.expect($(`${getNthStatusSelector(24)} .status-absolute-date`).exists).ok({ timeout }) + .expect(getActiveElementClassList()).contains('status-article', { timeout }) + .expect(getActiveElementClassList()).contains('status-in-timeline', { timeout }) + .expect(getActiveElementInsideNthStatus()).eql('23', { timeout }) }) test('reply preserves focus and moves focus to the text input', async t => {