From 21a4c03ff020648561f284da7739821e6e059bfb Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Wed, 28 Apr 2021 15:59:33 -0500 Subject: [PATCH] test(app, e2e): add redbox detection, probe firestore shutdown This correctly identifies that #5225 can happen, where previously it passed CI with no problem. Tested by applying / removing the fix for 5225 and now CI will fail if a redbox ever happens again --- packages/firestore/e2e/issues.e2e.js | 5 +++++ tests/e2e/init.js | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/packages/firestore/e2e/issues.e2e.js b/packages/firestore/e2e/issues.e2e.js index 7f6dac3dc5..f63d269428 100644 --- a/packages/firestore/e2e/issues.e2e.js +++ b/packages/firestore/e2e/issues.e2e.js @@ -91,5 +91,10 @@ describe('firestore()', function () { } }); }); + + it('issue 5225 - app reloads successfully', async function () { + // Reload causes the TaskExecutor to shut down, make sure it does not error + await device.reloadReactNative(); + }); }); }); diff --git a/tests/e2e/init.js b/tests/e2e/init.js index d84309d79e..26d1db670c 100644 --- a/tests/e2e/init.js +++ b/tests/e2e/init.js @@ -49,6 +49,13 @@ beforeEach(async function beforeEach() { } }); +// Make sure we the app is still visible (that is, no redbox) after each test +afterEach(async function afterEach() { + await waitFor(element(by.id('welcome')).atIndex(0)) // the testID for the Root View in app.js + .toBeVisible() + .withTimeout(10000); // If app reloads, it takes some time to re-display +}); + after(async function () { console.log(' ✨ Tests Complete ✨ '); await device.terminateApp();