2021-09-13 20:41:05 +00:00
|
|
|
const { navigateToLogin, login, mockMessage, tapBack, searchRoom } = require('../../helpers/app');
|
2021-03-18 14:36:50 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
|
|
|
|
const channel = data.groups.private.name;
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const navigateToRoom = async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await searchRoom(channel);
|
2021-09-13 20:41:05 +00:00
|
|
|
await element(by.id(`rooms-list-view-item-${channel}`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2021-07-02 17:39:39 +00:00
|
|
|
};
|
2021-03-18 14:36:50 +00:00
|
|
|
|
|
|
|
describe('Discussion', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
|
|
|
await navigateToLogin();
|
2021-07-02 17:39:39 +00:00
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should create discussion from NewMessageView', async () => {
|
|
|
|
const discussionName = `${data.random} Discussion NewMessageView`;
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('rooms-list-view-create-channel')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-message-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-06-11 18:23:43 +00:00
|
|
|
await element(by.label('Create Discussion')).atIndex(0).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-discussion-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('create-discussion-view'))).toExist();
|
|
|
|
await element(by.label('Select a Channel...')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await element(by.id('multi-select-search')).replaceText(`${channel}`);
|
|
|
|
await waitFor(element(by.id(`multi-select-item-${channel}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id(`multi-select-item-${channel}`)).tap();
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('multi-select-discussion-name')).replaceText(discussionName);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-discussion-submit')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('create-discussion-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${discussionName}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`rooms-list-view-item-${discussionName}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should create discussion from action button', async () => {
|
|
|
|
const discussionName = `${data.random} Discussion Action Button`;
|
2021-03-18 14:36:50 +00:00
|
|
|
await navigateToRoom();
|
|
|
|
await element(by.id('messagebox-actions')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-06-11 18:23:43 +00:00
|
|
|
await element(by.label('Create Discussion')).atIndex(0).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-discussion-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('multi-select-discussion-name')).replaceText(discussionName);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-discussion-submit')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('create-discussion-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${discussionName}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Create Discussion from action sheet', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should send a message', async () => {
|
|
|
|
await waitFor(element(by.id('messagebox')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await mockMessage('message');
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should create discussion', async () => {
|
|
|
|
const discussionName = `${data.random}message`;
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.label(discussionName)).atIndex(0).longPress();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.label('Start a Discussion')).atIndex(0).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-discussion-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await element(by.id('create-discussion-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${discussionName}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
describe('Check RoomActionsView render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigete to RoomActionsView', async () => {
|
|
|
|
await waitFor(element(by.id('room-header')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have room actions screen', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-view'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have info', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have members', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-members'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have files', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-files'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have mentions', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-mentioned'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have starred', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-starred'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have share', async () => {
|
2021-07-21 15:50:39 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).swipe('up');
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-share'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have pinned', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-pinned'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should not have notifications', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-notifications'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should not have leave channel', async () => {
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-leave-channel'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to RoomActionView', async () => {
|
2021-07-21 15:50:39 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).swipe('down');
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toBeVisible();
|
|
|
|
await element(by.id('room-actions-info')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-info-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-03-18 14:36:50 +00:00
|
|
|
await expect(element(by.id('room-info-view'))).toExist();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have edit button', async () => {
|
2021-05-27 20:44:35 +00:00
|
|
|
await expect(element(by.id('room-info-view-edit-button'))).toBeVisible();
|
2021-03-18 14:36:50 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|