2022-09-12 14:51:33 +00:00
|
|
|
import { expect } from 'detox';
|
|
|
|
|
|
|
|
import data from '../../data';
|
|
|
|
import {
|
2021-12-02 13:19:15 +00:00
|
|
|
navigateToLogin,
|
|
|
|
login,
|
|
|
|
tapBack,
|
|
|
|
sleep,
|
|
|
|
searchRoom,
|
|
|
|
mockMessage,
|
|
|
|
starMessage,
|
|
|
|
pinMessage,
|
2022-09-12 14:51:33 +00:00
|
|
|
platformTypes,
|
|
|
|
TTextMatcher
|
|
|
|
} from '../../helpers/app';
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const { sendMessage } = require('../../helpers/data_setup');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2022-09-12 14:51:33 +00:00
|
|
|
async function navigateToRoomActions(type: string) {
|
2018-05-23 13:39:18 +00:00
|
|
|
let room;
|
|
|
|
if (type === 'd') {
|
|
|
|
room = 'rocket.cat';
|
|
|
|
} else {
|
2020-07-22 16:32:21 +00:00
|
|
|
room = data.groups.private.name;
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
2020-07-06 20:56:28 +00:00
|
|
|
await searchRoom(room);
|
2021-09-13 20:41:05 +00:00
|
|
|
await element(by.id(`rooms-list-view-item-${room}`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2018-10-23 21:39:48 +00:00
|
|
|
async function backToActions() {
|
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2018-08-31 18:13:30 +00:00
|
|
|
async function backToRoomsList() {
|
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-10-23 21:39:48 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
}
|
|
|
|
|
2020-11-30 20:00:31 +00:00
|
|
|
async function waitForToast() {
|
|
|
|
await sleep(1000);
|
|
|
|
}
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
describe('Room actions screen', () => {
|
2022-09-12 14:51:33 +00:00
|
|
|
let alertButtonType: string;
|
|
|
|
let textMatcher: TTextMatcher;
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
2021-12-02 13:19:15 +00:00
|
|
|
({ alertButtonType, textMatcher } = platformTypes[device.getPlatform()]);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
describe('Render', () => {
|
|
|
|
describe('Direct', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
await navigateToRoomActions('d');
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have room actions screen', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have info', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have voice', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-voice'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have video', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-video'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have files', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-files'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have mentions', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-mentioned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have starred', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-starred'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have share', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-share'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-share'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have pinned', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have notifications', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-notifications'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have block user', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-block-user'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-block-user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
after(async () => {
|
2018-08-31 18:13:30 +00:00
|
|
|
await backToRoomsList();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Channel/Group', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
await navigateToRoomActions('c');
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have room actions screen', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have info', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-info'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have voice', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-voice'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
// it('should have video', async() => {
|
2020-06-15 14:00:46 +00:00
|
|
|
// await expect(element(by.id('room-actions-video'))).toExist();
|
2020-03-03 20:27:38 +00:00
|
|
|
// });
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have members', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-members'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have files', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-files'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have mentions', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-mentioned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have starred', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('room-actions-starred'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have share', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-share'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-share'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have pinned', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have notifications', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-notifications'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have leave channel', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-leave-channel'))).toExist();
|
|
|
|
await expect(element(by.id('room-actions-leave-channel'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
|
|
|
describe('Common', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should show mentioned messages', async () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-mentioned')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('mentioned-messages-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should show starred message and unstar it', async () => {
|
2021-07-02 17:39:39 +00:00
|
|
|
// Go back to room and send a message
|
2020-07-22 16:32:21 +00:00
|
|
|
await tapBack();
|
|
|
|
await mockMessage('messageToStar');
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Star the message
|
|
|
|
await starMessage('messageToStar');
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Back into Room Actions
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Go to starred messages
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by.id('room-actions-view')).swipe('up');
|
|
|
|
await waitFor(element(by.id('room-actions-starred'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-starred')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('starred-messages-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}messageToStar`).withAncestor(by.id('starred-messages-view'))))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
// Unstar message
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher](`${data.random}messageToStar`))
|
2021-09-13 20:41:05 +00:00
|
|
|
.atIndex(0)
|
|
|
|
.longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Unstar')).atIndex(0).tap();
|
2020-06-15 19:35:45 +00:00
|
|
|
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}messageToStar`).withAncestor(by.id('starred-messages-view'))))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toBeNotVisible()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should show pinned message and unpin it', async () => {
|
2021-07-02 17:39:39 +00:00
|
|
|
// Go back to room and send a message
|
2020-07-22 16:32:21 +00:00
|
|
|
await tapBack();
|
|
|
|
await mockMessage('messageToPin');
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Pin the message
|
|
|
|
await pinMessage('messageToPin');
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Back into Room Actions
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-pinned'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-pinned')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('pinned-messages-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}messageToPin`).withAncestor(by.id('pinned-messages-view'))))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(6000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher](`${data.random}messageToPin`).withAncestor(by.id('pinned-messages-view')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.atIndex(0)
|
|
|
|
.longPress();
|
2020-06-15 19:35:45 +00:00
|
|
|
|
|
|
|
await expect(element(by.id('action-sheet'))).toExist();
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Unpin')).atIndex(0).tap();
|
2020-06-15 19:35:45 +00:00
|
|
|
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}messageToPin`).withAncestor(by.id('pinned-messages-view'))))
|
2021-09-13 20:41:05 +00:00
|
|
|
.not.toExist()
|
|
|
|
.withTimeout(6000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Notification', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to notification preference view', async () => {
|
2022-07-06 13:23:02 +00:00
|
|
|
await waitFor(element(by.id('room-actions-scrollview')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-notifications')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-notifications')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('notification-preference-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have receive notification option', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-receive-notification'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have show unread count option', async () => {
|
2022-06-13 13:24:54 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-mark-as-unread'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have notification alert option', async () => {
|
2020-06-15 14:00:46 +00:00
|
|
|
await expect(element(by.id('notification-preference-view-alert'))).toExist();
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have push notification option', async () => {
|
|
|
|
await waitFor(element(by.id('notification-preference-view-push-notification')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(4000);
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have notification sound option', async () => {
|
|
|
|
await waitFor(element(by.id('notification-preference-view-sound')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(4000);
|
2019-08-23 16:24:15 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have email alert option', async () => {
|
|
|
|
await waitFor(element(by.id('notification-preference-view-email-alert')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(4000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
after(async () => {
|
2019-08-23 16:24:15 +00:00
|
|
|
await backToActions();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Channel/Group', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
// Currently, there's no way to add more owners to the room
|
|
|
|
// So we test only for the 'You are the last owner...' message
|
2020-07-15 16:28:34 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const user = data.users.alternate;
|
2020-07-15 16:28:34 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap on leave channel and raise alert', async () => {
|
2022-07-06 13:23:02 +00:00
|
|
|
await waitFor(element(by.id('room-actions-scrollview')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-leave-channel')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-leave-channel')).tap();
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Yes, leave it!')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Yes, leave it!').and(by.type(alertButtonType))).tap();
|
|
|
|
await waitFor(element(by[textMatcher]('You are the last owner. Please set new owner before leaving the room.')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(8000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('OK').and(by.type(alertButtonType))).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should add users to the room', async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-actions-members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('room-actions-members')).tap();
|
|
|
|
await waitFor(element(by.id('room-members-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-add-user')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(4000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('room-actions-add-user')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
|
|
|
|
// add rocket.cat
|
|
|
|
const rocketCat = 'rocket.cat';
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${rocketCat}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id(`select-users-view-item-${rocketCat}`)).tap();
|
|
|
|
await waitFor(element(by.id(`selected-user-${rocketCat}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
|
|
|
|
|
|
|
await waitFor(element(by.id('select-users-view-search')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(4000);
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('select-users-view-search')).tap();
|
2020-07-15 16:28:34 +00:00
|
|
|
await element(by.id('select-users-view-search')).replaceText(user.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await sleep(300);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id(`select-users-view-item-${user.username}`)).tap();
|
|
|
|
await waitFor(element(by.id(`selected-user-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2020-11-30 20:00:31 +00:00
|
|
|
|
2020-03-03 20:27:38 +00:00
|
|
|
await element(by.id('selected-users-view-submit')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await sleep(300);
|
2021-04-19 14:31:43 +00:00
|
|
|
await backToActions();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Room Members', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-actions-members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-members')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-members-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2022-09-12 14:51:33 +00:00
|
|
|
const openActionSheet = async (username: string) => {
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-12-02 13:19:15 +00:00
|
|
|
let n = 0;
|
|
|
|
while (n < 3) {
|
|
|
|
// Max tries three times, in case it does not register the click
|
|
|
|
try {
|
|
|
|
await element(by.id(`room-members-view-item-${username}`)).tap();
|
|
|
|
await sleep(300);
|
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
|
|
|
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up');
|
|
|
|
return;
|
|
|
|
} catch (e) {
|
|
|
|
n += 1;
|
|
|
|
}
|
|
|
|
}
|
2021-07-02 17:39:39 +00:00
|
|
|
};
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const closeActionSheet = async () => {
|
2021-07-02 17:39:39 +00:00
|
|
|
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.6);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toBeNotVisible()
|
|
|
|
.withTimeout(1000);
|
|
|
|
await sleep(100);
|
2021-07-02 17:39:39 +00:00
|
|
|
};
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should show all users', async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-members-view-filter')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id('room-members-view-filter')).tap();
|
|
|
|
await waitFor(element(by.id('room-members-view-toggle-status-all')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('room-members-view-toggle-status-all')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2022-08-26 13:21:25 +00:00
|
|
|
await tapBack();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should filter user', async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-actions-members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('room-actions-members')).tap();
|
|
|
|
await element(by.id('room-members-view-filter')).tap();
|
|
|
|
await waitFor(element(by.id('room-members-view-toggle-status-all')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('room-members-view-toggle-status-all')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-search')).replaceText('rocket');
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toBeNotVisible()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-search')).tap();
|
2022-09-12 14:51:33 +00:00
|
|
|
await element(by.id('room-members-view-search')).clearText();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should remove user from room', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet('rocket.cat');
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Remove from room')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by[textMatcher]('Remove from room')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by[textMatcher]('Are you sure?')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Yes, remove user!').and(by.type(alertButtonType))).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-members-view-item-rocket.cat')))
|
|
|
|
.toBeNotVisible()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should clear search', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await element(by.id('room-members-view-search')).tap();
|
2022-09-12 14:51:33 +00:00
|
|
|
await element(by.id('room-members-view-search')).clearText();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should set/remove as owner', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet(user.username);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-owner')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-owner-checked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(6000);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-owner')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-owner-unchecked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await closeActionSheet();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should set/remove as leader', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet(user.username);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-leader')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-leader-checked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(6000);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-leader')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-owner-unchecked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await closeActionSheet();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should set/remove as moderator', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet(user.username);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-moderator')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-moderator-checked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(6000);
|
[TEST] E2E Tests for Teams (#3178)
* Added Create Team
* Added actionTypes, actions, ENG strings for Teams and updated NewMessageView
* Added createTeam sagas, createTeam reducer, new Team string and update CreateChannelView
* Remove unnecessary actionTypes, reducers and sagas, e2e tests and navigation to team view
* Minor tweaks
* Show TeamChannelsView only if joined the team
* Minor tweak
* Added AddChannelTeamView
* Added permissions, translations strings for teams, deleteTeamRoom and addTeamRooms, AddExistingChannelView, updated CreateChannelView, TeamChannelsView
* Refactor touch component and update removeRoom and deleteRoom methods
* Minor tweaks
* Minor tweaks for removing channels and addExistingChannelView
* Added missing events and fixed channels list
* Minor tweaks for refactored touch component
* Added SelectListView and logic for leaving team
* Added addTeamMember and removeTeamMember
* Minor tweak
* Added deleteTeam function
* Minor tweak
* Minor tweaks
* Remove unnecesary changes, update TeamChannelsView, AddExistingChannelView, AddChannelTeamView, createChannel, goRoom and Touchable
* Remove unnecesary prop
* Add screens to ModalStack, events, autoJoin, update createChannel, addRoomsToTeam and Touchable
* Minor tweak
* Update loadMessagesForRoom.js
* Updated schema, tag component, touch, AddChannelTeamView, AddExistingChannelView, ActionSheet Item
* Fix unnecessary changes
* Add i18n, update createChannel, AddExistingChannelTeamView, AddChannelTeamView, RightButton and TeamChannelsView
* Updated styles, added tag story
* Minor tweak
* Minor tweaks
* Auto-join tweak
* Minor tweaks
* Minor tweak on search
* Minor refactor to ListItem, add SelectListView to ModalStack, update handleLeaveTeam
* Minor tweaks
* Update SelectListView
* Update handleLeaveTeam, remove unnecessary method, add story
* Minor tweak
* Minor visual tweaks
* Update SelectListView.js
* Update index.js
* Update RoomMembersView
* Updated SelectListView, RoomActionsView, leaveTeam method and string translations
* Update SelectListVIew
* Minor tweak
* Update SelectListView
* Minor tweak
* Minor tweaks
* Fix for List.Item subtitles being pushed down by title's flex
* Minor tweaks
* Update RoomActionsView
* Use showConfirmationAlert and showErrorAlert
* Remove addTeamMember, update removeTeamMember
* Update Alert
* Minor tweaks
* Minor tweaks
* Minor tweak
* Update showActionSheet on RoomMembersView
* Remove team main from query and move code around
* Fetch roles
* Update RoomMembersView and SelectListView
* Update rocketchat.js
* Updated leaveTeam and handleRemoveFromTeam
* Fix validation
* Remove unnecessary function
* Update RoomActionsView
* Update en.json
* updated deleteTeam function and permissions
* Added showConfirmationAlert
* Added string translations for teams
* Fix permission
* Added moveChannelToTeam and convertToTeam functionality
* Fix SelectListView RadioButton
* Fix moveToTeam
* Added searchBar to SelectListVIew
* Update RoomView , SelectListVIew and string translation for error
* E2E for Teams
* Fix tests and cleanup
* Minor refactor
* Wrong label
* Move/convert
* Fix convert
Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-06-04 16:16:05 +00:00
|
|
|
await element(by.id('action-sheet-set-moderator')).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('action-sheet-set-moderator-unchecked')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await closeActionSheet();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should set/remove as mute', async () => {
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet(user.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Mute')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by[textMatcher]('Are you sure?')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Mute').and(by.type(alertButtonType))).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Unmute')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by[textMatcher]('Are you sure?')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Unmute').and(by.type(alertButtonType))).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
|
|
|
await openActionSheet(user.username);
|
|
|
|
// Tests if Remove as mute worked
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Mute')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await closeActionSheet();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should ignore user', async () => {
|
|
|
|
const message = `${data.random}ignoredmessagecontent`;
|
|
|
|
const channelName = `#${data.groups.private.name}`;
|
2020-11-30 20:00:31 +00:00
|
|
|
await sendMessage(user, channelName, message);
|
|
|
|
await openActionSheet(user.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Ignore')).atIndex(0).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
await backToActions();
|
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by[textMatcher](message)).atIndex(0))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher](message)).atIndex(0).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to direct message', async () => {
|
2021-04-07 18:31:25 +00:00
|
|
|
await element(by.id('room-header')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-actions-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-actions-members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await element(by.id('room-actions-members')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-members-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-members-view-filter')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
|
|
|
await element(by.id('room-members-view-filter')).tap();
|
|
|
|
await waitFor(element(by.id('room-members-view-toggle-status-all')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('room-members-view-toggle-status-all')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2020-11-30 20:00:31 +00:00
|
|
|
await openActionSheet(user.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by[textMatcher]('Direct message')).atIndex(0).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${user.username}`)))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-10-23 21:39:48 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Direct', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
await navigateToRoomActions('d');
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should block/unblock user', async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
2020-06-15 14:00:46 +00:00
|
|
|
await waitFor(element(by.id('room-actions-block-user'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-block-user')).tap();
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Unblock user')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-actions-block-user')).tap();
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Block user')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|