2018-05-23 13:39:18 +00:00
|
|
|
const {
|
|
|
|
device, expect, element, by, waitFor
|
|
|
|
} = require('detox');
|
2020-05-20 16:33:40 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
const { tapBack, sleep } = require('../../helpers/app');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
const scrollDown = 200;
|
|
|
|
|
|
|
|
async function navigateToRoomActions(type) {
|
|
|
|
let room;
|
|
|
|
if (type === 'd') {
|
|
|
|
room = 'rocket.cat';
|
|
|
|
} else {
|
|
|
|
room = `private${ data.random }`;
|
|
|
|
}
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(10000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.type('UIScrollView')).atIndex(1).scrollTo('top');
|
|
|
|
await element(by.id('rooms-list-view-search')).typeText(room);
|
2019-01-29 19:52:56 +00:00
|
|
|
await sleep(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitFor(element(by.id(`rooms-list-view-item-${ room }`))).toExist().withTimeout(60000);
|
|
|
|
await element(by.id(`rooms-list-view-item-${ room }`)).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toExist().withTimeout(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-view-header-actions')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2018-10-23 21:39:48 +00:00
|
|
|
async function backToActions() {
|
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('room-actions-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2018-08-31 18:13:30 +00:00
|
|
|
async function backToRoomsList() {
|
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toExist().withTimeout(2000);
|
2018-10-23 21:39:48 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('Room actions screen', () => {
|
|
|
|
describe('Render', async() => {
|
|
|
|
describe('Direct', async() => {
|
|
|
|
before(async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await device.launchApp({ newInstance: true });
|
2018-05-23 13:39:18 +00:00
|
|
|
await navigateToRoomActions('d');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have room actions screen', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have info', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have voice', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-voice'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have video', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-video'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
it('should have files', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-files'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have mentions', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-mentioned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have starred', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-starred'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have search', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-search'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have share', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-share'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-share'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have pinned', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notifications', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-notifications'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have block user', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-block-user'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-block-user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
after(async() => {
|
2018-08-31 18:13:30 +00:00
|
|
|
await backToRoomsList();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Channel/Group', async() => {
|
|
|
|
before(async() => {
|
|
|
|
await navigateToRoomActions('c');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have room actions screen', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have info', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have voice', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-voice'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have video', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-video'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
it('should have members', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-members'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have add user', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-add-user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have files', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-files'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have mentions', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-mentioned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have starred', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-starred'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have search', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-search'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have share', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-share'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-share'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have pinned', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notifications', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-notifications'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have leave channel', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-leave-channel'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-leave-channel'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', async() => {
|
|
|
|
describe('TDB', async() => {
|
2019-09-18 17:32:12 +00:00
|
|
|
// TODO: test into a jitsi call
|
|
|
|
// it('should NOT navigate to voice call', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-actions-voice'))).toExist();
|
2019-09-18 17:32:12 +00:00
|
|
|
// await element(by.id('room-actions-voice')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.id('room-actions-view'))).toExist();
|
2019-09-18 17:32:12 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2019-09-18 17:32:12 +00:00
|
|
|
// TODO: test into a jitsi call
|
|
|
|
// it('should NOT navigate to video call', async() => {
|
|
|
|
// await element(by.id('room-actions-video')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.id('room-actions-view'))).toExist();
|
2019-09-18 17:32:12 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2019-05-29 21:19:12 +00:00
|
|
|
// TODO: test share room link
|
|
|
|
// it('should NOT navigate to share room', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-actions-share'))).toExist();
|
2019-05-29 21:19:12 +00:00
|
|
|
// await element(by.id('room-actions-share')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.id('room-actions-view'))).toExist();
|
2019-05-29 21:19:12 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Common', async() => {
|
|
|
|
it('should show mentioned messages', async() => {
|
|
|
|
await element(by.id('room-actions-mentioned')).tap();
|
|
|
|
await waitFor(element(by.id('mentioned-messages-view'))).toExist().withTimeout(2000);
|
2018-09-11 16:32:52 +00:00
|
|
|
await expect(element(by.id('mentioned-messages-view'))).toExist();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text(` ${ data.random }mention`))).toExist().withTimeout(60000);
|
|
|
|
// await expect(element(by.text(` ${ data.random }mention`))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should show starred message and unstar it', async() => {
|
|
|
|
await element(by.id('room-actions-starred')).tap();
|
|
|
|
await waitFor(element(by.id('starred-messages-view'))).toExist().withTimeout(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }message`).withAncestor(by.id('starred-messages-view')))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }message`).withAncestor(by.id('starred-messages-view')))).toExist();
|
|
|
|
await element(by.label(`${ data.random }message`).withAncestor(by.id('starred-messages-view'))).longPress();
|
|
|
|
await waitFor(element(by.text('Unstar'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.text('Unstar'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Unstar')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }message`).withAncestor(by.id('starred-messages-view')))).toBeNotVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }message`).withAncestor(by.id('starred-messages-view')))).toBeNotVisible();
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should show pinned message and unpin it', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-pinned')).tap();
|
|
|
|
await waitFor(element(by.id('pinned-messages-view'))).toExist().withTimeout(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`).withAncestor(by.id('pinned-messages-view')))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }edited (edited)`).withAncestor(by.id('pinned-messages-view')))).toExist();
|
|
|
|
await element(by.label(`${ data.random }edited (edited)`).withAncestor(by.id('pinned-messages-view'))).longPress();
|
|
|
|
await waitFor(element(by.text('Unpin'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.text('Unpin'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Unpin')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`).withAncestor(by.id('pinned-messages-view')))).toBeNotVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }edited (edited)`).withAncestor(by.id('pinned-messages-view')))).toBeNotVisible();
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should search and find a message', async() => {
|
|
|
|
await element(by.id('room-actions-search')).tap();
|
|
|
|
await waitFor(element(by.id('search-messages-view'))).toExist().withTimeout(2000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('search-message-view-input'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('search-message-view-input')).replaceText(`/${ data.random }message/`);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }message`).withAncestor(by.id('search-messages-view')))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }message`).withAncestor(by.id('search-messages-view')))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Notification', async() => {
|
|
|
|
it('should navigate to notification preference view', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-notifications'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-notifications')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('notification-preference-view'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have receive notification option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-receive-notification'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have show unread count option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-unread-count'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notification alert option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-alert'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have push notification option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view-push-notification'))).toExist();
|
|
|
|
await expect(element(by.id('notification-preference-view-push-notification'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notification audio option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view-audio'))).toExist();
|
|
|
|
await expect(element(by.id('notification-preference-view-audio'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notification sound option', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
// Ugly hack to scroll on detox
|
|
|
|
await element(by.type('UIScrollView')).atIndex(1).scrollTo('bottom');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view-sound'))).toExist();
|
|
|
|
await expect(element(by.id('notification-preference-view-sound'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have notification duration option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view-notification-duration'))).toExist();
|
|
|
|
await expect(element(by.id('notification-preference-view-notification-duration'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have email alert option', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view-email-alert'))).toExist();
|
|
|
|
await expect(element(by.id('notification-preference-view-email-alert'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2019-08-23 16:24:15 +00:00
|
|
|
after(async() => {
|
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
})
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
describe('Channel/Group', async() => {
|
|
|
|
// Currently, there's no way to add more owners to the room
|
|
|
|
// So we test only for the 'You are the last owner...' message
|
|
|
|
it('should tap on leave channel and raise alert', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-leave-channel'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-leave-channel'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-leave-channel')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Yes, leave it!'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.text('Yes, leave it!'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Yes, leave it!')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('You are the last owner. Please set new owner before leaving the room.'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.text('You are the last owner. Please set new owner before leaving the room.'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('OK')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
it('should add user to the room', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-add-user'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('room-actions-add-user')).tap();
|
|
|
|
await element(by.id('select-users-view-search')).tap();
|
|
|
|
await element(by.id('select-users-view-search')).replaceText(data.alternateUser);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`select-users-view-item-${ data.alternateUser }`))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id(`select-users-view-item-${ data.alternateUser }`)).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`selected-user-${ data.alternateUser }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`selected-user-${ data.alternateUser }`))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('selected-users-view-submit')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view'))).toExist().withTimeout(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('room-actions-members')).tap();
|
|
|
|
await element(by.id('room-members-view-toggle-status')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await backToActions(1);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Room Members', async() => {
|
|
|
|
before(async() => {
|
|
|
|
await element(by.id('room-actions-members')).tap();
|
|
|
|
await waitFor(element(by.id('room-members-view'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('room-members-view'))).toExist();
|
|
|
|
});
|
|
|
|
|
2018-07-10 13:40:32 +00:00
|
|
|
it('should show all users', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-toggle-status')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should filter user', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-search')).replaceText('rocket');
|
2018-08-10 17:26:36 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeNotVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toBeNotVisible();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-search')).tap();
|
|
|
|
await element(by.id('room-members-view-search')).clearText('');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// FIXME: mute/unmute isn't working
|
|
|
|
// it('should mute user', async() => {
|
|
|
|
// await sleep(1000);
|
|
|
|
// await element(by.id(`room-members-view-item-${ data.alternateUser }`)).longPress(1500);
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text('Mute'))).toExist().withTimeout(5000);
|
|
|
|
// await expect(element(by.text('Mute'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.text('Mute')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toExist().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toBeNotVisible();
|
|
|
|
// await element(by.id(`room-members-view-item-${ data.alternateUser }`)).longPress(1500);
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.text('Unmute'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.text('Unmute'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await element(by.text('Unmute')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toExist().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// await waitFor(element(by.id('toast'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
// await expect(element(by.id('toast'))).toBeNotVisible();
|
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
it('should navigate to direct room', async() => {
|
2018-08-10 17:26:36 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${ data.alternateUser }`))).toExist().withTimeout(5000);
|
|
|
|
await element(by.id(`room-members-view-item-${ data.alternateUser }`)).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('room-view'))).toExist();
|
|
|
|
await waitFor(element(by.id(`room-view-title-${ data.alternateUser }`))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ data.alternateUser }`))).toExist();
|
2018-10-23 21:39:48 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Direct', async() => {
|
|
|
|
before(async() => {
|
|
|
|
await navigateToRoomActions('d');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should block/unblock user', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-block-user'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-block-user')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label('Unblock user'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label('Unblock user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-block-user')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label('Block user'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label('Block user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|