From 0b658ff8a4b1c99950102fa1ba5563780054e489 Mon Sep 17 00:00:00 2001 From: Jack Reed <phillipjreed@gmail.com> Date: Tue, 27 Oct 2020 10:07:31 -0600 Subject: [PATCH] Make flaky annotation tests a little bit more resiliant on CI --- __tests__/integration/mirador/annotations.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/integration/mirador/annotations.test.js b/__tests__/integration/mirador/annotations.test.js index eb45ad341..f8135a6fb 100644 --- a/__tests__/integration/mirador/annotations.test.js +++ b/__tests__/integration/mirador/annotations.test.js @@ -3,7 +3,7 @@ describe('Annotations in Mirador', () => { beforeAll(async () => { await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/'); - await expect(page).toMatchElement('.mirador-window', { polling: 'mutation', timeout: 5000 }); + await expect(page).toMatchElement('.mirador-window[aria-label="Window: Self-Portrait Dedicated to Paul Gauguin"]', { polling: 'mutation', timeout: 5000 }); }); it('stores annotations in state by canvasId', async () => { const annotations = await page.evaluate(() => ( @@ -25,7 +25,7 @@ describe('Annotations in Mirador', () => { await expect(page).toClick(`#${windowId} button[aria-label="Annotations"]`); await expect(page).toMatchElement(`#${windowId} h3`, { text: 'Annotations' }); - await expect(page).toMatchElement(`#${windowId} p`, { text: 'Showing 5 annotations' }); + await expect(page).toMatchElement(`#${windowId} p`, { polling: 'mutation', text: 'Showing 5 annotations', timeout: 2000 }); await expect(page).toMatchElement(`#${windowId} .mirador-companion-window-left.mirador-window-sidebar-annotation-panel ul li`, { count: 2 }); }); }); -- GitLab