From 9ad45f067cbd6e2ca77c0af9e807f2624f75f3c4 Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Wed, 21 Jul 2021 17:17:48 -0400 Subject: [PATCH] Add E2E test --- e2e/tests/room/04-discussion.spec.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/e2e/tests/room/04-discussion.spec.js b/e2e/tests/room/04-discussion.spec.js index 29fc5a090..a3185d6c6 100644 --- a/e2e/tests/room/04-discussion.spec.js +++ b/e2e/tests/room/04-discussion.spec.js @@ -71,7 +71,7 @@ describe('Discussion', () => { }); describe('Check RoomActionsView render', () => { - it('should navigete to RoomActionsView', async() => { + it('should navigate to RoomActionsView', async() => { await waitFor(element(by.id('room-header'))).toBeVisible().withTimeout(5000); await element(by.id('room-header')).tap(); await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000); @@ -118,7 +118,7 @@ describe('Discussion', () => { await expect(element(by.id('room-actions-leave-channel'))).toBeVisible(); }); - it('should navigate to RoomActionView', async() => { + it('should navigate to RoomActionsView', async() => { await element(by.type('UIScrollView')).atIndex(1).swipe('down'); await expect(element(by.id('room-actions-info'))).toBeVisible(); await element(by.id('room-actions-info')).tap(); @@ -130,4 +130,25 @@ describe('Discussion', () => { await expect(element(by.id('room-info-view-edit-button'))).toBeVisible(); }); }); + + describe('Open Discussion from DiscussionMessagesView', () => { + const discussionName = `${ data.random }message`; + it('should go back to main room', async() => { + await tapBack(); + await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000); + await tapBack(); + await waitFor(element(by.id(`room-view-title-${ discussionName }`))).toExist().withTimeout(5000); + await tapBack(); + await navigateToRoom(); + }); + + it('should navigate to DiscussionMessagesView', async() => { + await waitFor(element(by.id(`room-view-title-${ channel }`))).toExist().withTimeout(5000); + await waitFor(element(by.id('room-header'))).toBeVisible().withTimeout(5000); + await element(by.id('room-header')).tap(); + await waitFor(element(by.id('room-actions-discussions'))).toBeVisible().withTimeout(5000); + await element(by.id('room-actions-discussions')).tap(); + await waitFor(element(by.id('discussion-messages-view'))).toBeVisible().withTimeout(5000); + }); + }); });