diff --git a/test/end-to-end-tests/src/usecases/toasts.js b/test/end-to-end-tests/src/usecases/toasts.js index a82c910eea..2e88677e4b 100644 --- a/test/end-to-end-tests/src/usecases/toasts.js +++ b/test/end-to-end-tests/src/usecases/toasts.js @@ -17,8 +17,12 @@ limitations under the License. const assert = require('assert'); async function assertNoToasts(session) { - const toast = await session.query('.mx_Toast_toast'); - assert(!toast, 'toast found when none expected'); + try { + await session.query('.mx_Toast_toast'); + } catch (e) { + return; + } + throw new Error('toast found when none expected'); } async function assertToast(session, expectedTitle) {