From 35413c63835203be655a1c31842d38da282d2d49 Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Wed, 6 Feb 2019 11:20:24 -0500
Subject: [PATCH] Include the `waitUntilGone` helper in the other project load
 tests

---
 test/integration/examples.test.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/test/integration/examples.test.js b/test/integration/examples.test.js
index 7e8ff7a10..189cb16d5 100644
--- a/test/integration/examples.test.js
+++ b/test/integration/examples.test.js
@@ -4,13 +4,15 @@ import path from 'path';
 import SeleniumHelper from '../helpers/selenium-helper';
 
 const {
+    findByText,
     clickButton,
     clickText,
     clickXpath,
     findByXpath,
     getDriver,
     getLogs,
-    loadUri
+    loadUri,
+    waitUntilGone
 } = new SeleniumHelper();
 
 let driver;
@@ -29,7 +31,7 @@ describe('player example', () => {
     test('Load a project by ID', async () => {
         const projectId = '96708228';
         await loadUri(`${uri}#${projectId}`);
-        await new Promise(resolve => setTimeout(resolve, 2000));
+        await waitUntilGone(findByText('Loading'));
         await clickXpath('//img[@title="Go"]');
         await new Promise(resolve => setTimeout(resolve, 2000));
         await clickXpath('//img[@title="Stop"]');
@@ -60,7 +62,7 @@ describe('blocks example', () => {
     test('Load a project by ID', async () => {
         const projectId = '96708228';
         await loadUri(`${uri}#${projectId}`);
-        await new Promise(resolve => setTimeout(resolve, 2000));
+        await waitUntilGone(findByText('Loading'));
         await clickXpath('//img[@title="Go"]');
         await new Promise(resolve => setTimeout(resolve, 2000));
         await clickXpath('//img[@title="Stop"]');
-- 
GitLab