From c65d91c13485ea1cb17eb98f35d33cad2155d5df Mon Sep 17 00:00:00 2001 From: yogevbd Date: Mon, 29 Jul 2019 20:41:25 +0300 Subject: [PATCH] Fix flaky tests --- e2e/Notifications.test.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/e2e/Notifications.test.js b/e2e/Notifications.test.js index b6bb29b..57cdc50 100644 --- a/e2e/Notifications.test.js +++ b/e2e/Notifications.test.js @@ -2,11 +2,11 @@ const Utils = require('./Utils'); const {elementByLabel} = Utils; describe('Notifications', () => { - describe('Foreground', () => { - beforeEach(async () => { - await device.relaunchApp({permissions: {notifications: 'YES'}}); - }); + beforeEach(async () => { + await device.relaunchApp({delete: true, permissions: {notifications: 'YES'}}); + }); + describe('Foreground', () => { it('Receive notification', async () => { await device.sendUserNotification(createNotification({link: 'foreground/notification'})); await expect(elementByLabel('foreground/notification')).toBeVisible(); @@ -19,10 +19,6 @@ describe('Notifications', () => { }); describe('Background', () => { - beforeEach(async () => { - await device.launchApp({newInstance: true, permissions: {notifications: 'YES'}}); - }); - it('Receive notification', async () => { device.sendToHome(); await expect(elementByLabel('background/notification')).toBeNotVisible(); @@ -33,7 +29,7 @@ describe('Notifications', () => { describe('Dead state', () => { it('Receive notification', async () => { - await device.launchApp({delete: true, newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); + await device.launchApp({newInstance: true, userNotification: createNotification({link: 'deadState/notification'})}); await expect(elementByLabel('deadState/notification')).toBeVisible(); }); }); -- 2.26.2