2021-03-18 13:29:38 +00:00
|
|
|
const data = require('../../data');
|
2021-12-02 13:19:15 +00:00
|
|
|
const { navigateToLogin, login, platformTypes } = require('../../helpers/app');
|
2021-03-18 13:29:38 +00:00
|
|
|
|
|
|
|
describe('Group DM', () => {
|
2021-12-02 13:19:15 +00:00
|
|
|
let textMatcher;
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2021-03-18 13:29:38 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
2021-12-02 13:19:15 +00:00
|
|
|
({ textMatcher } = platformTypes[device.getPlatform()]);
|
2021-03-18 13:29:38 +00:00
|
|
|
await navigateToLogin();
|
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Create Group DM', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2022-08-08 21:02:08 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view-create-channel')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-03-18 13:29:38 +00:00
|
|
|
await element(by.id('rooms-list-view-create-channel')).tap();
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have new message screen', async () => {
|
|
|
|
await waitFor(element(by.id('new-message-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-03-18 13:29:38 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have search input', async () => {
|
|
|
|
await waitFor(element(by.id('new-message-view-search')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-03-18 13:29:38 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:29:38 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to create DM', async () => {
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Create Direct Messages')).tap();
|
2021-03-18 13:29:38 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should add users', async () => {
|
2021-03-18 13:29:38 +00:00
|
|
|
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('select-users-view-item-rocket.cat')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
2021-03-18 13:29:38 +00:00
|
|
|
await element(by.id('select-users-view-item-rocket.cat')).tap();
|
|
|
|
await element(by.id('select-users-view-search')).replaceText(data.users.existing.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${data.users.existing.username}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id(`select-users-view-item-${data.users.existing.username}`)).tap();
|
2021-03-18 13:29:38 +00:00
|
|
|
await element(by.id('selected-users-view-submit')).tap();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('check Group DM exist', async () => {
|
|
|
|
await waitFor(element(by.id(`room-view-title-${data.users.existing.username}, rocket.cat`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
2021-03-18 13:29:38 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:29:38 +00:00
|
|
|
});
|
|
|
|
});
|