2021-03-18 13:29:38 +00:00
|
|
|
const data = require('../../data');
|
2021-07-02 17:39:39 +00:00
|
|
|
const {
|
|
|
|
navigateToLogin, login
|
|
|
|
} = require('../../helpers/app');
|
2021-03-18 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Group DM', () => {
|
|
|
|
before(async() => {
|
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
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-03-18 13:29:38 +00:00
|
|
|
before(async() => {
|
|
|
|
await element(by.id('rooms-list-view-create-channel')).tap();
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render', () => {
|
2021-03-18 13:29:38 +00:00
|
|
|
it('should have new message screen', async() => {
|
|
|
|
await waitFor(element(by.id('new-message-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-03-18 13:29:38 +00:00
|
|
|
it('should have search input', async() => {
|
|
|
|
await waitFor(element(by.id('new-message-view-search'))).toBeVisible().withTimeout(2000);
|
|
|
|
});
|
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-03-18 13:29:38 +00:00
|
|
|
it('should navigate to create DM', async() => {
|
|
|
|
await element(by.label('Create Direct Messages')).tap();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should add users', async() => {
|
|
|
|
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
|
2021-07-02 17:39:39 +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-07-02 17:39:39 +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();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('check Group DM exist', async() => {
|
2021-07-02 17:39:39 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|