2020-12-01 17:30:39 +00:00
|
|
|
const data = require('../../data');
|
2021-07-02 17:39:39 +00:00
|
|
|
const {
|
|
|
|
navigateToLogin, login, mockMessage, searchRoom
|
|
|
|
} = require('../../helpers/app');
|
2020-12-01 17:30:39 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const testuser = data.users.regular;
|
|
|
|
const room = data.channels.detoxpublicprotected.name;
|
|
|
|
const { joinCode } = data.channels.detoxpublicprotected;
|
2020-12-01 17:30:39 +00:00
|
|
|
|
|
|
|
async function navigateToRoom() {
|
|
|
|
await searchRoom(room);
|
2021-01-20 19:53:12 +00:00
|
|
|
await element(by.id(`rooms-list-view-item-${ room }`)).tap();
|
2020-12-01 17:30:39 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function openJoinCode() {
|
|
|
|
await element(by.id('room-view-join-button')).tap();
|
|
|
|
await waitFor(element(by.id('join-code'))).toBeVisible().withTimeout(5000);
|
|
|
|
}
|
|
|
|
|
2021-04-19 14:31:43 +00:00
|
|
|
describe('Join protected room', () => {
|
2020-12-01 17:30:39 +00:00
|
|
|
before(async() => {
|
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
await navigateToRoom();
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
2020-12-01 17:30:39 +00:00
|
|
|
it('should tap join and ask for join code', async() => {
|
|
|
|
await openJoinCode();
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-12-01 17:30:39 +00:00
|
|
|
|
|
|
|
it('should cancel join room', async() => {
|
|
|
|
await element(by.id('join-code-cancel')).tap();
|
|
|
|
await waitFor(element(by.id('join-code'))).toBeNotVisible().withTimeout(5000);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should join room', async() => {
|
|
|
|
await openJoinCode();
|
|
|
|
await element(by.id('join-code-input')).replaceText(joinCode);
|
|
|
|
await element(by.id('join-code-submit')).tap();
|
|
|
|
await waitFor(element(by.id('join-code'))).toBeNotVisible().withTimeout(5000);
|
|
|
|
await waitFor(element(by.id('messagebox'))).toBeVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.id('messagebox'))).toBeVisible();
|
|
|
|
await expect(element(by.id('room-view-join'))).toBeNotVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should send message', async() => {
|
|
|
|
await mockMessage('message');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|