2021-03-18 13:32:48 +00:00
|
|
|
const data = require('../../data');
|
2021-09-13 20:41:05 +00:00
|
|
|
const { navigateToLogin, login, tapBack, sleep } = require('../../helpers/app');
|
2021-03-18 13:32:48 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const testuser = data.users.regular;
|
2021-03-18 13:32:48 +00:00
|
|
|
|
|
|
|
async function navigateToRoom(search) {
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('directory-view-search')).replaceText(search);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`directory-view-item-${search}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
2021-03-18 13:32:48 +00:00
|
|
|
await sleep(300); // app takes some time to animate
|
2021-09-13 20:41:05 +00:00
|
|
|
await element(by.id(`directory-view-item-${search}`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${search}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-03-18 13:32:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('Join room from directory', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2021-03-18 13:32:48 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap directory', async () => {
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('rooms-list-view-directory')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('directory-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:32:48 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should search public channel and navigate', async () => {
|
2021-03-18 13:32:48 +00:00
|
|
|
await navigateToRoom(data.channels.detoxpublic.name);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:32:48 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should search user and navigate', async () => {
|
2021-03-18 13:32:48 +00:00
|
|
|
await tapBack();
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('rooms-list-view-directory')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('directory-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('directory-view-dropdown')).tap();
|
2021-06-04 18:07:26 +00:00
|
|
|
await element(by.label('Users')).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.label('Search by')).tap();
|
2021-06-04 18:07:26 +00:00
|
|
|
await navigateToRoom(data.users.alternate.username);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:32:48 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should search user and navigate', async () => {
|
2021-06-04 18:07:26 +00:00
|
|
|
await tapBack();
|
|
|
|
await element(by.id('rooms-list-view-directory')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('directory-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('directory-view-dropdown')).tap();
|
2021-06-04 18:07:26 +00:00
|
|
|
await element(by.label('Teams')).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.label('Search by')).tap();
|
2021-06-04 18:07:26 +00:00
|
|
|
await navigateToRoom(data.teams.private.name);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2021-03-18 13:32:48 +00:00
|
|
|
});
|
|
|
|
});
|