From 50499c00a7aea05d61c35e9841fa186b09e50fd8 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Tue, 13 Mar 2018 20:00:35 -0700 Subject: [PATCH] make tests less flaky --- tests/spec/013-compose-media.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/spec/013-compose-media.js b/tests/spec/013-compose-media.js index 4619d80..30619f3 100644 --- a/tests/spec/013-compose-media.js +++ b/tests/spec/013-compose-media.js @@ -1,4 +1,4 @@ -import { composeInput, getNthDeleteMediaButton, getNthMedia, mediaButton, uploadKittenImage } from '../utils' +import { composeInput, getNthDeleteMediaButton, getNthMedia, mediaButton, sleep, uploadKittenImage } from '../utils' import { foobarRole } from '../roles' fixture`013-compose-media.js` @@ -33,6 +33,7 @@ test('inserts media', async t => { test('removes media', async t => { await t.useRole(foobarRole) + .expect(mediaButton.exists).ok() await (uploadKittenImage(1)()) await t.expect(getNthMedia(1).getAttribute('alt')).eql('kitten1.jpg') await (uploadKittenImage(2)()) @@ -47,6 +48,7 @@ test('removes media', async t => { test('changes URLs as media is added/removed', async t => { await t.useRole(foobarRole) + .expect(mediaButton.exists).ok() await (uploadKittenImage(1)()) await t.expect(composeInput.value).match(/^ http:\/\/localhost:3000\/media\/\S+$/) await (uploadKittenImage(1)())