Abstraction and Improvement
This commit is contained in:
parent
54ac5db64c
commit
8da3ed6022
|
@ -5,7 +5,6 @@ const {
|
|||
const platformTypes = require('../../helpers/platformTypes');
|
||||
|
||||
const data = require('../../data');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const testuser = data.users.regular;
|
||||
const otheruser = data.users.alternate;
|
||||
|
@ -51,7 +50,6 @@ describe('E2E Encryption', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
|
|
|
@ -5,7 +5,6 @@ const {
|
|||
navigateToLogin, login, mockMessage, tapBack, searchRoom
|
||||
} = require('../../helpers/app');
|
||||
const data = require('../../data');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const testuser = data.users.regular;
|
||||
const otheruser = data.users.alternate;
|
||||
|
@ -13,7 +12,6 @@ const otheruser = data.users.alternate;
|
|||
describe('Broadcast room', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@ const { navigateToLogin, login, sleep } = require('../../helpers/app');
|
|||
const data = require('../../data');
|
||||
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { closeKeyboardAndroid, prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const { closeKeyboardAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const profileChangeUser = data.users.profileChanges;
|
||||
|
||||
|
@ -22,7 +22,6 @@ describe('Profile screen', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
({ textInputType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||
await navigateToLogin();
|
||||
await login(profileChangeUser.username, profileChangeUser.password);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const { navigateToLogin, login } = require('../../helpers/app');
|
||||
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const data = require('../../data');
|
||||
|
||||
|
@ -11,7 +10,6 @@ describe('Settings screen', () => {
|
|||
let alertButtonType;
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
|
|
|
@ -4,7 +4,6 @@ const {
|
|||
} = require('../../helpers/app');
|
||||
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const testuser = data.users.regular;
|
||||
const room = data.channels.detoxpublic.name;
|
||||
|
@ -24,7 +23,6 @@ describe('Join public room', () => {
|
|||
let scrollViewType;
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const { navigateToLogin, login, sleep } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const data = require('../../data');
|
||||
|
||||
|
@ -12,7 +11,6 @@ async function waitForToast() {
|
|||
describe('Status screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
const data = require('../../data');
|
||||
const { navigateToLogin, login, checkServer } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const reopenAndCheckServer = async(server) => {
|
||||
await device.terminateApp();
|
||||
|
@ -12,7 +11,6 @@ const reopenAndCheckServer = async(server) => {
|
|||
describe('Change server', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, mockMessage, searchRoom
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const testuser = data.users.regular;
|
||||
const room = data.channels.detoxpublicprotected.name;
|
||||
|
@ -22,7 +21,6 @@ async function openJoinCode() {
|
|||
describe('Join protected room', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
await navigateToRoom();
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, tapBack, sleep
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const testuser = data.users.regular;
|
||||
|
||||
|
@ -18,7 +17,6 @@ async function navigateToRoom(search) {
|
|||
describe('Join room from directory', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(testuser.username, testuser.password);
|
||||
});
|
||||
|
|
|
@ -4,14 +4,12 @@ const {
|
|||
} = require('../../helpers/app');
|
||||
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
describe('Delete server', () => {
|
||||
let scrollViewType;
|
||||
let alertButtonType;
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
({ alertButtonType, scrollViewType } = platformTypes[device.getPlatform()]);
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
|
|
|
@ -2,7 +2,7 @@ const data = require('../../data');
|
|||
const { tapBack, checkServer, navigateToRegister } = require('../../helpers/app');
|
||||
const { get, login } = require('../../helpers/data_setup');
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { closeKeyboardAndroid, prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const { closeKeyboardAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const DEEPLINK_METHODS = { AUTH: 'auth', ROOM: 'room' };
|
||||
|
||||
|
@ -34,7 +34,6 @@ describe('Deep linking', () => {
|
|||
delete: true,
|
||||
url: getDeepLink(DEEPLINK_METHODS.AUTH, data.server, `userId=123${ amp }token=abc`)
|
||||
});
|
||||
await prepareAndroid();
|
||||
await waitFor(element(by.text('You\'ve been logged out by the server. Please log in again.'))).toExist().withTimeout(10000); // TODO: we need to improve this message
|
||||
});
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const { navigateToLogin, login, sleep } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const { post } = require('../../helpers/data_setup');
|
||||
|
||||
const data = require('../../data');
|
||||
|
@ -20,7 +19,6 @@ const navToLanguage = async() => {
|
|||
|
||||
describe('i18n', () => {
|
||||
before(async() => {
|
||||
await prepareAndroid();
|
||||
});
|
||||
|
||||
describe('OS language', () => {
|
||||
|
|
|
@ -2,9 +2,11 @@ const detox = require('detox');
|
|||
const adapter = require('detox/runners/mocha/adapter');
|
||||
const config = require('../../package.json').detox;
|
||||
const { setup } = require('../helpers/data_setup');
|
||||
const { prepareAndroid } = require('../helpers/platformFunctions');
|
||||
|
||||
before(async() => {
|
||||
await Promise.all([setup(), detox.init(config, { launchApp: false })]);
|
||||
await prepareAndroid(); // Make Android less flaky
|
||||
// await dataSetup()
|
||||
// await detox.init(config, { launchApp: false });
|
||||
// await device.launchApp({ permissions: { notifications: 'YES' } });
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
const data = require('../../data');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
describe('Onboarding', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await waitFor(element(by.id('onboarding-view'))).toBeVisible().withTimeout(20000);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
const { navigateToRegister, navigateToLogin } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
describe('Legal screen', () => {
|
||||
describe('From Login', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
const data = require('../../data');
|
||||
const { navigateToLogin } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
describe('Forgot password screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await element(by.id('login-view-forgot-password')).tap();
|
||||
await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000);
|
||||
|
|
|
@ -2,13 +2,11 @@ const {
|
|||
device, expect, element, by, waitFor
|
||||
} = require('detox');
|
||||
const { navigateToRegister } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const data = require('../../data');
|
||||
|
||||
describe('Create user screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToRegister();
|
||||
});
|
||||
|
||||
|
|
|
@ -2,13 +2,11 @@ const {
|
|||
expect, element, by, waitFor
|
||||
} = require('detox');
|
||||
const { navigateToLogin, tapBack } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const data = require('../../data');
|
||||
|
||||
describe('Login screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
});
|
||||
|
||||
|
|
|
@ -4,13 +4,11 @@ const {
|
|||
const {
|
||||
login, navigateToLogin, logout, tapBack, searchRoom
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const data = require('../../data');
|
||||
|
||||
describe('Rooms list screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
|
|
@ -4,13 +4,11 @@ const {
|
|||
const {
|
||||
login, navigateToLogin, logout, tapBack
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const data = require('../../data');
|
||||
|
||||
describe('Server history', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
});
|
||||
|
||||
describe('Usage', () => {
|
||||
|
|
|
@ -2,14 +2,12 @@ const data = require('../../data');
|
|||
const {
|
||||
tapBack, navigateToLogin, login, tryTapping
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
|
||||
|
||||
describe('Create room screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, mockMessage, tapBack, sleep, searchRoom, starMessage, pinMessage, dismissReviewNag, tryTapping
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
async function navigateToRoom(roomName) {
|
||||
await searchRoom(`${ roomName }`);
|
||||
|
@ -15,7 +14,6 @@ describe('Room screen', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
await navigateToRoom(mainRoom);
|
||||
|
@ -197,6 +195,8 @@ describe('Room screen', () => {
|
|||
});
|
||||
|
||||
it('should react to message', async() => {
|
||||
await waitFor(element(by.id('action-sheet-handle'))).toBeNotVisible();
|
||||
await sleep(300);
|
||||
await element(by.text(`${ data.random }message`)).atIndex(0).longPress();
|
||||
await expect(element(by.id('action-sheet'))).toExist();
|
||||
await expect(element(by.id('action-sheet-handle'))).toBeVisible();
|
||||
|
@ -230,9 +230,10 @@ describe('Room screen', () => {
|
|||
await waitFor(element(by.id('message-reaction-:grimacing:'))).toExist().withTimeout(60000);
|
||||
});
|
||||
|
||||
it('should ask for review', async() => {
|
||||
await dismissReviewNag(); // TODO: Create a proper test for this elsewhere.
|
||||
});
|
||||
// it('should ask for review', async() => {
|
||||
// await dismissReviewNag(); // TODO: Create a proper test for this elsewhere.
|
||||
// });
|
||||
// Moved in previous test because toExist doesn't detect element while review popup covers it, on Android
|
||||
|
||||
it('should remove reaction', async() => {
|
||||
await element(by.id('message-reaction-:grinning:')).tap();
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, tapBack, sleep, searchRoom, mockMessage, starMessage, pinMessage
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const { sendMessage } = require('../../helpers/data_setup');
|
||||
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
|
@ -41,7 +40,6 @@ describe('Room actions screen', () => {
|
|||
let alertButtonType;
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
({ alertButtonType } = platformTypes[device.getPlatform()]);
|
||||
|
@ -384,6 +382,8 @@ describe('Room actions screen', () => {
|
|||
|
||||
const closeActionSheet = async() => {
|
||||
await element(by.id('action-sheet-handle')).swipe('down', 'fast', 0.6);
|
||||
await waitFor(element(by.id('action-sheet'))).toBeNotVisible().withTimeout(1000);
|
||||
await sleep(100);
|
||||
};
|
||||
|
||||
it('should show all users', async() => {
|
||||
|
@ -520,9 +520,9 @@ describe('Room actions screen', () => {
|
|||
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
||||
await waitFor(element(by.id('room-actions-block-user'))).toExist();
|
||||
await element(by.id('room-actions-block-user')).tap();
|
||||
await waitFor(element(by.label('Unblock user'))).toExist().withTimeout(60000);
|
||||
await waitFor(element(by.text('Unblock user'))).toExist().withTimeout(60000);
|
||||
await element(by.id('room-actions-block-user')).tap();
|
||||
await waitFor(element(by.label('Block user'))).toExist().withTimeout(60000);
|
||||
await waitFor(element(by.text('Block user'))).toExist().withTimeout(60000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,7 +3,6 @@ const {
|
|||
} = require('../../helpers/app');
|
||||
const data = require('../../data');
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const channel = data.groups.private.name;
|
||||
|
||||
|
@ -18,7 +17,6 @@ describe('Discussion', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, newInstance: true, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
({ scrollViewType } = platformTypes[device.getPlatform()]);
|
||||
|
|
|
@ -2,11 +2,9 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, mockMessage, tapBack, sleep, searchRoom, mockMessageWithNag
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
async function navigateToRoom(roomName) {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
await searchRoom(`${ roomName }`);
|
||||
|
|
|
@ -2,13 +2,11 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
|
||||
describe('Group DM', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, searchRoom, sleep
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const { sendMessage } = require('../../helpers/data_setup');
|
||||
|
||||
async function navigateToRoom(user) {
|
||||
|
@ -16,7 +15,6 @@ describe('Mark as unread', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
await navigateToRoom(user);
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, tapBack, sleep, searchRoom
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const privateRoomName = data.groups.private.name;
|
||||
|
||||
|
@ -33,7 +32,6 @@ async function waitForToast() {
|
|||
describe('Room info screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
const data = require('../../data');
|
||||
const {
|
||||
navigateToLogin, tapBack, login, searchRoom
|
||||
navigateToLogin, tapBack, login, searchRoom, sleep
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
const platformTypes = require('../../helpers/platformTypes');
|
||||
|
||||
async function navigateToRoom(roomName) {
|
||||
await searchRoom(`${ roomName }`);
|
||||
|
@ -11,6 +11,7 @@ async function navigateToRoom(roomName) {
|
|||
}
|
||||
|
||||
async function clearCache() {
|
||||
const { alertButtonType } = platformTypes[device.getPlatform()];
|
||||
await waitFor(element(by.id('room-view'))).toBeVisible().withTimeout(5000);
|
||||
await tapBack();
|
||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(10000);
|
||||
|
@ -20,20 +21,24 @@ async function clearCache() {
|
|||
await waitFor(element(by.id('settings-view'))).toBeVisible().withTimeout(2000);
|
||||
await element(by.id('settings-view-clear-cache')).tap();
|
||||
await waitFor(element(by.text('This will clear all your offline data.'))).toExist().withTimeout(2000);
|
||||
await element(by.label('Clear').and(by.type('_UIAlertControllerActionView'))).tap();
|
||||
await element(by.text('Clear').and(by.type(alertButtonType))).tap();
|
||||
await waitFor(element(by.id('rooms-list-view'))).toBeVisible().withTimeout(5000);
|
||||
await waitFor(element(by.id('rooms-list-view-item-jumping'))).toExist().withTimeout(10000);
|
||||
}
|
||||
|
||||
async function waitForLoading() {
|
||||
await waitFor(element(by.id('loading'))).toBeVisible().withTimeout(5000);
|
||||
if (device.getPlatform() === 'android') {
|
||||
await sleep(10000);
|
||||
return;
|
||||
}
|
||||
await waitFor(element(by.id('loading'))).toBeVisible().withTimeout(5000); // Fails on Android
|
||||
await waitFor(element(by.id('loading'))).toBeNotVisible().withTimeout(5000);
|
||||
}
|
||||
|
||||
describe('Room', () => {
|
||||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.adminUser, data.adminPassword);
|
||||
});
|
||||
|
@ -76,6 +81,7 @@ describe('Room', () => {
|
|||
await element(by.id('room-view-search')).tap();
|
||||
await waitFor(element(by.id('search-messages-view'))).toExist().withTimeout(5000);
|
||||
await element(by.id('search-message-view-input')).typeText('30\n');
|
||||
await sleep(1000);
|
||||
await waitFor(element(by.text('30')).atIndex(0)).toExist().withTimeout(5000);
|
||||
await element(by.text('30')).atIndex(0).tap();
|
||||
await waitForLoading();
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
const data = require('../../data');
|
||||
const { navigateToLogin, login } = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const teamName = `team-${ data.random }`;
|
||||
|
||||
describe('Create team screen', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, tapBack, sleep, searchRoom
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
async function navigateToRoom(roomName) {
|
||||
await searchRoom(`${ roomName }`);
|
||||
|
@ -44,7 +43,6 @@ describe('Team', () => {
|
|||
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
await navigateToRoom(team);
|
||||
|
@ -111,6 +109,7 @@ describe('Team', () => {
|
|||
await element(by.id('add-channel-team-view-create-channel')).tap();
|
||||
|
||||
await element(by.id('select-users-view-search')).replaceText('rocket.cat');
|
||||
await waitFor(element(by.id('select-users-view-item-rocket.cat'))).toBeVisible().withTimeout(2000);
|
||||
await element(by.id('select-users-view-item-rocket.cat')).tap();
|
||||
await waitFor(element(by.id('selected-user-rocket.cat'))).toBeVisible().withTimeout(10000);
|
||||
await element(by.id('selected-users-view-submit')).tap();
|
||||
|
@ -158,7 +157,7 @@ describe('Team', () => {
|
|||
|
||||
it('should activate/deactivate auto-join to channel', async() => {
|
||||
await element(by.id(`rooms-list-view-item-${ existingRoom }`)).atIndex(0).longPress();
|
||||
|
||||
await element(by.id('action-sheet')).swipe('up', 'fast', 0.3);
|
||||
await waitFor(element(by.id('action-sheet-auto-join'))).toBeVisible().withTimeout(5000);
|
||||
await waitFor(element(by.id('auto-join-unchecked'))).toBeVisible().withTimeout(5000);
|
||||
await waitFor(element(by.id('action-sheet-remove-from-team'))).toBeVisible().withTimeout(5000);
|
||||
|
@ -217,7 +216,7 @@ describe('Team', () => {
|
|||
await waitFor(element(by.id(`select-list-view-item-${ existingRoom }`))).toExist().withTimeout(2000);
|
||||
await element(by.id(`select-list-view-item-${ room }`)).tap();
|
||||
|
||||
await waitFor(element(by.label('You are the last owner of this channel. Once you leave the team, the channel will be kept inside the team but you will be managing it from outside.'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.text('You are the last owner of this channel. Once you leave the team, the channel will be kept inside the team but you will be managing it from outside.'))).toExist().withTimeout(2000);
|
||||
await element(by.text('OK')).tap();
|
||||
await waitFor(element(by.id('select-list-view-submit'))).toExist().withTimeout(2000);
|
||||
await element(by.id('select-list-view-submit')).tap();
|
||||
|
@ -249,6 +248,7 @@ describe('Team', () => {
|
|||
|
||||
it('should remove member from team', async() => {
|
||||
await openActionSheet('rocket.cat');
|
||||
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
||||
await element(by.id('action-sheet-remove-from-team')).tap();
|
||||
await waitFor(element(by.id('select-list-view'))).toExist().withTimeout(5000);
|
||||
await waitFor(element(by.id(`select-list-view-item-${ room }`))).toExist().withTimeout(5000);
|
||||
|
|
|
@ -2,7 +2,6 @@ const data = require('../../data');
|
|||
const {
|
||||
navigateToLogin, login, tapBack, searchRoom, sleep
|
||||
} = require('../../helpers/app');
|
||||
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
||||
|
||||
const toBeConverted = `to-be-converted-${ data.random }`;
|
||||
const toBeMoved = `to-be-moved-${ data.random }`;
|
||||
|
@ -38,7 +37,6 @@ async function navigateToRoomActions(room) {
|
|||
describe('Move/Convert Team', () => {
|
||||
before(async() => {
|
||||
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
||||
await prepareAndroid();
|
||||
await navigateToLogin();
|
||||
await login(data.users.regular.username, data.users.regular.password);
|
||||
});
|
||||
|
@ -53,7 +51,7 @@ describe('Move/Convert Team', () => {
|
|||
await element(by.id('room-actions-scrollview')).scrollTo('bottom');
|
||||
await waitFor(element(by.id('room-actions-convert-to-team'))).toExist().withTimeout(2000);
|
||||
await element(by.id('room-actions-convert-to-team')).tap();
|
||||
await waitFor(element(by.label('You are converting this Channel to a Team. All Members will be kept.'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.text('You are converting this Channel to a Team. All Members will be kept.'))).toExist().withTimeout(2000);
|
||||
await element(by.text('Convert')).tap();
|
||||
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
|
||||
await waitFor(element(by.id(`room-view-title-${ toBeConverted }`))).toExist().withTimeout(6000);
|
||||
|
@ -82,7 +80,7 @@ describe('Move/Convert Team', () => {
|
|||
await waitFor(element(by.id(`select-list-view-item-${ toBeConverted }`))).toExist().withTimeout(2000);
|
||||
await element(by.id(`select-list-view-item-${ toBeConverted }`)).tap();
|
||||
await element(by.id('select-list-view-submit')).atIndex(0).tap();
|
||||
await waitFor(element(by.label('After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.text('After reading the previous intructions about this behavior, do you still want to move this channel to the selected team?'))).toExist().withTimeout(2000);
|
||||
await element(by.text('Yes, move it!')).tap();
|
||||
await waitFor(element(by.id('room-view-header-team-channels'))).toExist().withTimeout(10000);
|
||||
});
|
||||
|
@ -105,7 +103,7 @@ describe('Move/Convert Team', () => {
|
|||
await element(by.id(`select-list-view-item-${ toBeMoved }`)).tap();
|
||||
await waitFor(element(by.id('select-list-view-submit'))).toExist().withTimeout(2000);
|
||||
await element(by.id('select-list-view-submit')).tap();
|
||||
await waitFor(element(by.label('You are converting this Team to a Channel'))).toExist().withTimeout(2000);
|
||||
await waitFor(element(by.text('You are converting this Team to a Channel'))).toExist().withTimeout(2000);
|
||||
await element(by.text('Convert')).tap();
|
||||
await waitFor(element(by.id('room-view'))).toExist().withTimeout(20000);
|
||||
await waitFor(element(by.id(`room-view-title-${ toBeConverted }`))).toExist().withTimeout(6000);
|
||||
|
|
Loading…
Reference in New Issue