2023-03-07 12:28:51 +00:00
|
|
|
import { device, waitFor, element, by, expect } from 'detox';
|
2022-09-12 14:51:33 +00:00
|
|
|
|
|
|
|
import {
|
2021-12-02 13:19:15 +00:00
|
|
|
navigateToLogin,
|
|
|
|
login,
|
|
|
|
tapBack,
|
|
|
|
sleep,
|
|
|
|
searchRoom,
|
2022-09-12 14:51:33 +00:00
|
|
|
platformTypes,
|
2023-03-07 12:28:51 +00:00
|
|
|
TTextMatcher,
|
|
|
|
tapAndWaitFor,
|
|
|
|
tryTapping,
|
|
|
|
mockMessage
|
2022-09-12 14:51:33 +00:00
|
|
|
} from '../../helpers/app';
|
2023-03-07 12:28:51 +00:00
|
|
|
import { createRandomRoom, createRandomUser, ITestUser, post } from '../../helpers/data_setup';
|
|
|
|
import random from '../../helpers/random';
|
2022-09-12 14:51:33 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const { sendMessage } = require('../../helpers/data_setup');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
async function starMessage(message: string) {
|
|
|
|
const deviceType = device.getPlatform();
|
|
|
|
const { textMatcher } = platformTypes[deviceType];
|
|
|
|
await waitFor(element(by[textMatcher](message)).atIndex(0)).toExist();
|
|
|
|
await tryTapping(element(by[textMatcher](message)).atIndex(0), 2000, true);
|
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
|
|
|
await element(by[textMatcher]('Star')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.not.toExist()
|
|
|
|
.withTimeout(5000);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function pinMessage(message: string) {
|
|
|
|
const deviceType = device.getPlatform();
|
|
|
|
const { textMatcher } = platformTypes[deviceType];
|
|
|
|
await waitFor(element(by[textMatcher](message)).atIndex(0)).toExist();
|
|
|
|
await tryTapping(element(by[textMatcher](message)).atIndex(0), 2000, true);
|
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id('action-sheet-handle')).swipe('up', 'fast', 0.5);
|
|
|
|
await element(by[textMatcher]('Pin')).atIndex(0).tap();
|
|
|
|
await waitFor(element(by.id('action-sheet')))
|
|
|
|
.not.toExist()
|
|
|
|
.withTimeout(5000);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function navigateToRoomActions() {
|
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
|
|
|
}
|
|
|
|
|
2020-11-30 20:00:31 +00:00
|
|
|
async function waitForToast() {
|
|
|
|
await sleep(1000);
|
|
|
|
}
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
let user: ITestUser;
|
|
|
|
let otherUser: ITestUser;
|
|
|
|
let room: string;
|
|
|
|
|
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;
|
2023-03-07 12:28:51 +00:00
|
|
|
beforeAll(async () => {
|
|
|
|
user = await createRandomUser();
|
|
|
|
otherUser = await createRandomUser();
|
|
|
|
({ name: room } = await createRandomRoom(user));
|
2020-07-22 16:32:21 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
2023-03-07 12:28:51 +00:00
|
|
|
await login(user.username, user.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('Channel/Group', () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
beforeAll(async () => {
|
|
|
|
await navigateToRoomActions();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
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
|
|
|
|
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();
|
2023-04-28 15:16:14 +00:00
|
|
|
await expect(element(by[textMatcher]('1 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();
|
2023-03-07 12:28:51 +00:00
|
|
|
const messageToStar = await mockMessage('messageToStar');
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Star the message
|
2023-03-07 12:28:51 +00:00
|
|
|
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);
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by[textMatcher](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
|
2023-03-07 12:28:51 +00:00
|
|
|
await element(by[textMatcher](messageToStar)).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
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by[textMatcher](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();
|
2023-03-07 12:28:51 +00:00
|
|
|
const messageToPin = await mockMessage('messageToPin');
|
2020-07-22 16:32:21 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
// Pin the message
|
2023-03-07 12:28:51 +00:00
|
|
|
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);
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by[textMatcher](messageToPin).withAncestor(by.id('pinned-messages-view'))))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(6000);
|
2023-03-07 12:28:51 +00:00
|
|
|
await element(by[textMatcher](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
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by[textMatcher](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
|
|
|
});
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
afterAll(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', () => {
|
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';
|
2023-03-07 12:28:51 +00:00
|
|
|
await post('im.create', { username: rocketCat }, user);
|
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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await element(by.id('select-users-view-search')).replaceText(otherUser.username);
|
2021-12-02 13:19:15 +00:00
|
|
|
await sleep(300);
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(10000);
|
2023-03-07 12:28:51 +00:00
|
|
|
await element(by.id(`select-users-view-item-${otherUser.username}`)).tap();
|
|
|
|
await waitFor(element(by.id(`selected-user-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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();
|
2023-04-28 15:16:14 +00:00
|
|
|
await waitFor(element(by[textMatcher]('3 members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Room Members', () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
beforeAll(async () => {
|
2022-08-26 13:21:25 +00:00
|
|
|
await waitFor(element(by.id('room-actions-members')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2023-05-18 21:09:33 +00:00
|
|
|
await sleep(300); // wait for animation
|
2023-03-07 12:28:51 +00:00
|
|
|
await tapAndWaitFor(element(by.id('room-actions-members')), element(by.id('room-members-view')), 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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('room-members-view-search')).replaceText('rocket');
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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 () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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 () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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 () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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 () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.username);
|
2023-12-13 15:50:03 +00:00
|
|
|
await element(by[textMatcher]('Disable writing in room')).atIndex(0).tap();
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Are you sure?')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2023-12-13 15:50:03 +00:00
|
|
|
await element(by[textMatcher]('Disable writing in room').and(by.type(alertButtonType))).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.username);
|
2023-12-13 15:50:03 +00:00
|
|
|
await element(by[textMatcher]('Enable writing in room')).atIndex(0).tap();
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Are you sure?')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2023-12-13 15:50:03 +00:00
|
|
|
await element(by[textMatcher]('Enable writing in room').and(by.type(alertButtonType))).tap();
|
2020-11-30 20:00:31 +00:00
|
|
|
await waitForToast();
|
|
|
|
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.username);
|
2020-11-30 20:00:31 +00:00
|
|
|
// Tests if Remove as mute worked
|
2023-12-13 15:50:03 +00:00
|
|
|
await waitFor(element(by[textMatcher]('Disable writing in room')))
|
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 () => {
|
2023-03-07 12:28:51 +00:00
|
|
|
const message = `${random()}ignoredmessagecontent`;
|
|
|
|
await sendMessage(otherUser, room, message);
|
|
|
|
await openActionSheet(otherUser.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);
|
2023-03-07 12:28:51 +00:00
|
|
|
await tapAndWaitFor(
|
|
|
|
element(by[textMatcher]('Message ignored. Tap to display it.')).atIndex(0),
|
|
|
|
element(by[textMatcher](message)).atIndex(0),
|
|
|
|
2000
|
|
|
|
);
|
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();
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-members-view-item-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(60000);
|
2023-03-07 12:28:51 +00:00
|
|
|
await openActionSheet(otherUser.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);
|
2023-03-07 12:28:51 +00:00
|
|
|
await waitFor(element(by.id(`room-view-title-${otherUser.username}`)))
|
2021-09-13 20:41:05 +00:00
|
|
|
.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
|
|
|
});
|
|
|
|
});
|