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
|
|
|
|
|
|
|
async function mockMessage(message) {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }${ message }`);
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }${ message }`)).atIndex(0)).toExist().withTimeout(60000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.label(`${ data.random }${ message }`)).atIndex(0)).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
async function navigateToRoom() {
|
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(`private${ data.random }`);
|
2019-01-29 19:52:56 +00:00
|
|
|
await sleep(2000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`rooms-list-view-item-private${ data.random }`))).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id(`rooms-list-view-item-private${ data.random }`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('Room screen', () => {
|
2019-04-17 17:01:03 +00:00
|
|
|
const mainRoom = `private${ data.random }`;
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
before(async() => {
|
|
|
|
await navigateToRoom();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Render', async() => {
|
|
|
|
it('should have room screen', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-view'))).toExist();
|
|
|
|
await waitFor(element(by.id(`room-view-title-${ mainRoom }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ mainRoom }`))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Render - Header
|
|
|
|
describe('Header', async() => {
|
|
|
|
it('should have actions button ', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-view-header-actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2020-03-03 20:27:38 +00:00
|
|
|
|
|
|
|
it('should have threads button ', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-view-header-threads'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Render - Messagebox
|
|
|
|
describe('Messagebox', async() => {
|
|
|
|
it('should have messagebox', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have open emoji button', async() => {
|
2019-05-28 13:03:08 +00:00
|
|
|
if (device.getPlatform() === 'android') {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
}
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have message input', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-input'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have audio button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-send-audio'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have actions button', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', async() => {
|
|
|
|
describe('Messagebox', async() => {
|
|
|
|
it('should send message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await mockMessage('message')
|
|
|
|
await expect(element(by.label(`${ data.random }message`)).atIndex(0)).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
it('should ask for review', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Are you enjoying this app?'))).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await expect(element(by.text('Are you enjoying this app?')).atIndex(0)).toExist();
|
|
|
|
await element(by.label('No').and(by.type('_UIAlertControllerActionView'))).tap(); // Tap `no` on ask for review alert
|
|
|
|
})
|
|
|
|
|
2019-05-28 13:03:08 +00:00
|
|
|
it('should show/hide emoji keyboard', async () => {
|
|
|
|
if (device.getPlatform() === 'android') {
|
|
|
|
await element(by.id('messagebox-open-emoji')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toExist().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-keyboard-emoji'))).toExist();
|
|
|
|
await expect(element(by.id('messagebox-close-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toBeNotVisible();
|
|
|
|
await element(by.id('messagebox-close-emoji')).tap();
|
|
|
|
await waitFor(element(by.id('messagebox-keyboard-emoji'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-keyboard-emoji'))).toBeNotVisible();
|
|
|
|
await expect(element(by.id('messagebox-close-emoji'))).toBeNotVisible();
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('messagebox-open-emoji'))).toExist();
|
2019-05-28 13:03:08 +00:00
|
|
|
}
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should show/hide emoji autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(':joy');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-container'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
await waitFor(element(by.id('messagebox-container'))).toBeNotVisible().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-container'))).toBeNotVisible();
|
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on emoji autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).replaceText(':');
|
|
|
|
await element(by.id('messagebox-input')).typeText('joy'); // workaround for number keyboard
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(10000);
|
|
|
|
await expect(element(by.id('messagebox-container'))).toExist();
|
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('mention-item-joy')).tap();
|
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText(':joy: ');
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on user autocomplete and send mention', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText(`@${ data.user }`);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('messagebox-container'))).toExist();
|
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id(`mention-item-${ data.user }`)).tap();
|
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText(`@${ data.user } `);
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
2018-09-11 16:32:52 +00:00
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }mention`);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
// await waitFor(element(by.label(`@${ data.user } ${ data.random }mention`)).atIndex(0)).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should show and tap on room autocomplete', async() => {
|
|
|
|
await element(by.id('messagebox-input')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('#general');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('messagebox-container'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('messagebox-container'))).toExist();
|
|
|
|
await sleep(1000);
|
|
|
|
await element(by.id('mention-item-general')).tap();
|
2018-05-23 13:39:18 +00:00
|
|
|
await expect(element(by.id('messagebox-input'))).toHaveText('#general ');
|
|
|
|
await element(by.id('messagebox-input')).clearText();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Message', async() => {
|
|
|
|
it('should copy permalink', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).tap();
|
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2019-02-27 14:26:40 +00:00
|
|
|
await element(by.text('Permalink')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
// TODO: test clipboard
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should copy message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2019-02-27 14:26:40 +00:00
|
|
|
await element(by.text('Copy')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
// TODO: test clipboard
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should star message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Star')).tap();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(2000);
|
2018-06-01 17:38:13 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toBeNotVisible().withTimeout(5000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
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('Cancel')).tap();
|
|
|
|
await waitFor(element(by.text('Cancel'))).toBeNotVisible().withTimeout(2000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should react to message', async() => {
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }message`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Add Reaction')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('reaction-picker'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-😃')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker-grinning'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('reaction-picker-grinning'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-grinning')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('message-reaction-:grinning:'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('message-reaction-:grinning:'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should show reaction picker on add reaction button pressed and have frequently used emoji', async() => {
|
|
|
|
await element(by.id('message-add-reaction')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('reaction-picker'))).toExist();
|
|
|
|
await waitFor(element(by.id('reaction-picker-grinning'))).toExist().withTimeout(2000);
|
|
|
|
await expect(element(by.id('reaction-picker-grinning'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-😃')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('reaction-picker-grimacing'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('reaction-picker-grimacing')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('message-reaction-:grimacing:'))).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should remove reaction', async() => {
|
|
|
|
await element(by.id('message-reaction-:grinning:')).tap();
|
|
|
|
await waitFor(element(by.id('message-reaction-:grinning:'))).toBeNotVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.id('message-reaction-:grinning:'))).toBeNotVisible();
|
|
|
|
});
|
|
|
|
|
2018-05-24 20:17:45 +00:00
|
|
|
it('should edit message', async() => {
|
|
|
|
await mockMessage('edit');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }edit`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2018-05-24 20:17:45 +00:00
|
|
|
await element(by.text('Edit')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('ed');
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist();
|
2018-05-24 20:17:45 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should quote message', async() => {
|
|
|
|
await mockMessage('quote');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }quote`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2018-05-24 20:17:45 +00:00
|
|
|
await element(by.text('Quote')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText(`${ data.random }quoted`);
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
|
|
|
// TODO: test if quote was sent
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(2000);
|
2018-05-24 20:17:45 +00:00
|
|
|
});
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should pin message', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }edited (edited)`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.text('Pin')).tap();
|
2018-06-01 17:38:13 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toBeNotVisible().withTimeout(5000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.label('Message pinned')).atIndex(0)).toExist().withTimeout(5000);
|
|
|
|
await waitFor(element(by.label(`${ data.random }edited (edited)`)).atIndex(0)).toExist().withTimeout(60000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(`${ data.random }edited (edited)`)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
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('Cancel')).tap();
|
|
|
|
await waitFor(element(by.text('Cancel'))).toBeNotVisible().withTimeout(2000);
|
|
|
|
});
|
|
|
|
|
|
|
|
// TODO: delete message - swipe on action sheet missing
|
|
|
|
});
|
|
|
|
|
2019-04-17 17:01:03 +00:00
|
|
|
describe('Thread', async() => {
|
|
|
|
const thread = `${ data.random }thread`;
|
|
|
|
it('should create thread', async() => {
|
|
|
|
await mockMessage('thread');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(thread)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await element(by.text('Reply')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('replied');
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
2019-04-24 18:36:29 +00:00
|
|
|
await waitFor(element(by.id(`message-thread-button-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`message-thread-button-${ thread }`))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to thread from button', async() => {
|
|
|
|
await element(by.id(`message-thread-button-${ thread }`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await tapBack();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2019-04-17 17:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should toggle follow thread', async() => {
|
|
|
|
await element(by.id(`message-thread-button-${ thread }`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await element(by.id('room-view-header-unfollow')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view-header-follow'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('room-view-header-follow'))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await element(by.id('room-view-header-follow')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-view-header-unfollow'))).toExist().withTimeout(60000);
|
|
|
|
await expect(element(by.id('room-view-header-unfollow'))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await tapBack();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2019-04-17 17:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to thread from thread name', async() => {
|
2019-05-03 13:33:38 +00:00
|
|
|
await mockMessage('dummymessagebetweenthethread');
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.label(thread)).atIndex(0).longPress();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.text('Message actions'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.text('Message actions'))).toExist();
|
2019-05-03 13:33:38 +00:00
|
|
|
await element(by.text('Reply')).tap();
|
|
|
|
await element(by.id('messagebox-input')).typeText('repliedagain');
|
|
|
|
await element(by.id('messagebox-send-message')).tap();
|
|
|
|
await waitFor(element(by.id(`message-thread-replied-on-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`message-thread-replied-on-${ thread }`))).toExist();
|
|
|
|
|
2019-04-17 17:01:03 +00:00
|
|
|
await element(by.id(`message-thread-replied-on-${ thread }`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await tapBack();
|
2020-03-03 20:27:38 +00:00
|
|
|
await sleep(1000);
|
2019-04-17 17:01:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to thread from threads view', async() => {
|
|
|
|
await element(by.id('room-view-header-threads')).tap();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('thread-messages-view'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id('thread-messages-view'))).toExist();
|
|
|
|
await element(by.id(`message-thread-button-${ thread }`)).atIndex(0).tap();
|
2019-04-17 17:01:03 +00:00
|
|
|
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id(`room-view-title-${ thread }`))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id(`room-view-title-${ thread }`))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await tapBack();
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('thread-messages-view'))).toExist().withTimeout(5000);
|
|
|
|
await expect(element(by.id('thread-messages-view'))).toExist();
|
2019-04-17 17:01:03 +00:00
|
|
|
await tapBack();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-06-15 14:00:46 +00:00
|
|
|
// after(async() => {
|
|
|
|
// await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
|
|
|
// await tapBack();
|
|
|
|
// await waitFor(element(by.id('rooms-list-view'))).toExist().withTimeout(2000);
|
|
|
|
// await expect(element(by.id('rooms-list-view'))).toExist();
|
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2019-06-10 18:36:56 +00:00
|
|
|
});
|