Add E2E test

This commit is contained in:
Gerzon Z 2021-07-21 17:17:48 -04:00
parent da3bdd4272
commit 9ad45f067c
1 changed files with 23 additions and 2 deletions

View File

@ -71,7 +71,7 @@ describe('Discussion', () => {
}); });
describe('Check RoomActionsView render', () => { 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 waitFor(element(by.id('room-header'))).toBeVisible().withTimeout(5000);
await element(by.id('room-header')).tap(); await element(by.id('room-header')).tap();
await waitFor(element(by.id('room-actions-view'))).toBeVisible().withTimeout(5000); 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(); 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 element(by.type('UIScrollView')).atIndex(1).swipe('down');
await expect(element(by.id('room-actions-info'))).toBeVisible(); await expect(element(by.id('room-actions-info'))).toBeVisible();
await element(by.id('room-actions-info')).tap(); 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(); 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);
});
});
}); });