2021-12-02 13:19:15 +00:00
|
|
|
const { navigateToLogin, login, sleep, tapBack, mockMessage, searchRoom, logout, platformTypes } = require('../../helpers/app');
|
|
|
|
|
2020-10-30 18:31:04 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
const testuser = data.users.regular;
|
|
|
|
const otheruser = data.users.alternate;
|
2020-10-30 18:31:04 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const checkServer = async server => {
|
|
|
|
const label = `Connected to ${server}`;
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('rooms-list-view-sidebar')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('sidebar-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await waitFor(element(by.label(label)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('sidebar-close-drawer')).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
};
|
2021-04-01 19:27:46 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const checkBanner = async () => {
|
2021-12-02 13:19:15 +00:00
|
|
|
// TODO: Assert 'Save Your Encryption Password'
|
|
|
|
await waitFor(element(by.id('listheader-encryption')))
|
|
|
|
.toExist()
|
2021-09-13 20:41:05 +00:00
|
|
|
.withTimeout(10000);
|
2021-07-02 17:39:39 +00:00
|
|
|
};
|
2021-04-01 19:27:46 +00:00
|
|
|
|
2020-10-30 18:31:04 +00:00
|
|
|
async function navigateToRoom(roomName) {
|
2021-09-13 20:41:05 +00:00
|
|
|
await searchRoom(`${roomName}`);
|
|
|
|
await element(by.id(`rooms-list-view-item-${roomName}`)).tap();
|
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2020-10-30 18:31:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function waitForToast() {
|
|
|
|
await sleep(300);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function navigateSecurityPrivacy() {
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('rooms-list-view-sidebar')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('sidebar-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await waitFor(element(by.id('sidebar-settings')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('sidebar-settings')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('settings-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('settings-view-security-privacy')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('security-privacy-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('E2E Encryption', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
const room = `encrypted${data.random}`;
|
2020-10-30 18:31:04 +00:00
|
|
|
const newPassword = 'abc';
|
2021-12-02 13:19:15 +00:00
|
|
|
let alertButtonType;
|
|
|
|
let scrollViewType;
|
|
|
|
let textMatcher;
|
2020-10-30 18:31:04 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
2021-12-02 13:19:15 +00:00
|
|
|
({ alertButtonType, scrollViewType, textMatcher } = platformTypes[device.getPlatform()]);
|
2020-10-30 18:31:04 +00:00
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Banner', () => {
|
|
|
|
describe('Render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have encryption badge', async () => {
|
2021-04-01 19:27:46 +00:00
|
|
|
await checkBanner();
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap encryption badge and open save password modal', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('listheader-encryption')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('e2e-save-password-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap "How it works" and navigate', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('e2e-save-password-view-how-it-works').and(by.label('How It Works'))).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('e2e-how-it-works-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap "Save my password" and close modal', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('e2e-save-password-view-saved-password').and(by.label('I Saved My E2E Password'))).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should create encrypted room', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('rooms-list-view-create-channel')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-message-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('new-message-view-create-channel')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('select-users-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('select-users-view-search')).replaceText(otheruser.username);
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`select-users-view-item-${otheruser.username}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
|
|
|
await element(by.id(`select-users-view-item-${otheruser.username}`)).tap();
|
|
|
|
await waitFor(element(by.id(`selected-user-${otheruser.username}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('selected-users-view-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('create-channel-view')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(5000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('create-channel-name')).replaceText(room);
|
|
|
|
await element(by.id('create-channel-encrypted')).longPress();
|
|
|
|
await element(by.id('create-channel-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('room-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
|
|
|
await waitFor(element(by.id(`room-view-title-${room}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should send message and be able to read it', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await mockMessage('message');
|
|
|
|
await tapBack();
|
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-10-30 18:31:04 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Security and Privacy', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to security privacy', async () => {
|
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('rooms-list-view-sidebar')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('sidebar-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await waitFor(element(by.id('sidebar-settings')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('sidebar-settings')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('settings-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('settings-view-security-privacy')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('security-privacy-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('render', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await expect(element(by.id('security-privacy-view-e2e-encryption'))).toExist();
|
|
|
|
await expect(element(by.id('security-privacy-view-screen-lock'))).toExist();
|
|
|
|
await expect(element(by.id('security-privacy-view-analytics-events'))).toExist();
|
|
|
|
await expect(element(by.id('security-privacy-view-crash-report'))).toExist();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('E2E Encryption Security', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to e2e encryption security', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('security-privacy-view-e2e-encryption')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('e2e-encryption-security-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have items', async () => {
|
|
|
|
await waitFor(element(by.id('e2e-encryption-security-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await expect(element(by.id('e2e-encryption-security-view-password'))).toExist();
|
|
|
|
await expect(element(by.id('e2e-encryption-security-view-change-password').and(by.label('Save Changes')))).toExist();
|
|
|
|
await expect(element(by.id('e2e-encryption-security-view-reset-key').and(by.label('Reset E2E Key')))).toExist();
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-10-30 18:31:04 +00:00
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Change password', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should change password', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('e2e-encryption-security-view-password')).typeText(newPassword);
|
|
|
|
await element(by.id('e2e-encryption-security-view-change-password')).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(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await expect(element(by[textMatcher]("Make sure you've saved it carefully somewhere else."))).toExist();
|
|
|
|
await element(by[textMatcher]('Yes, change it')).atIndex(0).tap();
|
2020-10-30 18:31:04 +00:00
|
|
|
await waitForToast();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to the room and messages should remain decrypted', async () => {
|
|
|
|
await waitFor(element(by.id('e2e-encryption-security-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('security-privacy-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('settings-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('settings-view-drawer')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('sidebar-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('sidebar-chats')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await navigateToRoom(room);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}message`)).atIndex(0))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should logout, login and messages should be encrypted', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await logout();
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
await navigateToRoom(room);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}message`)).atIndex(0))
|
2021-09-13 20:41:05 +00:00
|
|
|
.not.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await expect(element(by.label('Encrypted message')).atIndex(0)).toExist();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should enter new e2e password and messages should be decrypted', async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
// TODO: assert 'Enter Your E2E Password'
|
|
|
|
await waitFor(element(by.id('listheader-encryption')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by.id('listheader-encryption')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('e2e-enter-your-password-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('e2e-enter-your-password-view-password')).typeText(newPassword);
|
|
|
|
await element(by.id('e2e-enter-your-password-view-confirm')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('listheader-encryption')))
|
|
|
|
.not.toExist()
|
|
|
|
.withTimeout(10000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await navigateToRoom(room);
|
2021-12-02 13:19:15 +00:00
|
|
|
await waitFor(element(by[textMatcher](`${data.random}message`)).atIndex(0))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Reset E2E key', () => {
|
2021-12-02 13:19:15 +00:00
|
|
|
before(async () => {
|
2020-10-30 18:31:04 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
});
|
|
|
|
it('should reset e2e key', async () => {
|
|
|
|
// FIXME: too flaky on Android for now... let's fix it later
|
|
|
|
// It's also flaky on iOS, but it works from time to time
|
|
|
|
if (device.getPlatform() === 'android') {
|
|
|
|
return;
|
|
|
|
}
|
2020-10-30 18:31:04 +00:00
|
|
|
await navigateSecurityPrivacy();
|
|
|
|
await element(by.id('security-privacy-view-e2e-encryption')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('e2e-encryption-security-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('e2e-encryption-security-view-reset-key').and(by.label('Reset E2E Key'))).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(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await expect(element(by[textMatcher]("You're going to be logged out."))).toExist();
|
|
|
|
await element(by[textMatcher]('Yes, reset it').and(by.type(alertButtonType))).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
await sleep(2000);
|
2021-12-02 13:19:15 +00:00
|
|
|
|
|
|
|
await waitFor(element(by[textMatcher]("You've been logged out by the server. Please log in again.")))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(20000);
|
|
|
|
await element(by[textMatcher]('OK').and(by.type(alertButtonType))).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('workspace-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await element(by.id('workspace-view-login')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('login-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-10-30 18:31:04 +00:00
|
|
|
await login(testuser.username, testuser.password);
|
2021-12-02 13:19:15 +00:00
|
|
|
// TODO: assert 'Save Your Encryption Password'
|
|
|
|
await waitFor(element(by.id('listheader-encryption')))
|
2021-09-13 20:41:05 +00:00
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-10-30 18:31:04 +00:00
|
|
|
});
|
|
|
|
});
|
2021-04-01 19:27:46 +00:00
|
|
|
|
|
|
|
describe('Persist Banner', () => {
|
2021-12-02 13:19:15 +00:00
|
|
|
before(async () => {
|
|
|
|
// reinstall the app because of one flaky test above
|
|
|
|
if (device.getPlatform() === 'android') {
|
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
}
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
it('check save banner', async () => {
|
2021-04-01 19:27:46 +00:00
|
|
|
await checkServer(data.server);
|
|
|
|
await checkBanner();
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should add server and create new user', async () => {
|
2021-04-01 19:27:46 +00:00
|
|
|
await sleep(5000);
|
|
|
|
await element(by.id('rooms-list-header-server-dropdown-button')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-header-server-dropdown')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('rooms-list-header-server-add')).tap();
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-04-01 19:27:46 +00:00
|
|
|
// TODO: refactor
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-server-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by.id('new-server-view-input')).typeText(`${data.alternateServer}`);
|
|
|
|
await element(by.id('new-server-view-input')).tapReturnKey();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('workspace-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('workspace-view-register')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('register-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-04-01 19:27:46 +00:00
|
|
|
// Register new user
|
|
|
|
await element(by.id('register-view-name')).replaceText(data.registeringUser.username);
|
|
|
|
await element(by.id('register-view-username')).replaceText(data.registeringUser.username);
|
|
|
|
await element(by.id('register-view-email')).replaceText(data.registeringUser.email);
|
2021-12-02 13:19:15 +00:00
|
|
|
await element(by.id('register-view-password')).replaceText(data.registeringUser.password);
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('register-view-submit')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-04-01 19:27:46 +00:00
|
|
|
await checkServer(data.alternateServer);
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should change back', async () => {
|
2021-04-01 19:27:46 +00:00
|
|
|
await element(by.id('rooms-list-header-server-dropdown-button')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-header-server-dropdown')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
|
|
|
await element(by.id(`rooms-list-header-server-${data.server}`)).tap();
|
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
2021-04-01 19:27:46 +00:00
|
|
|
await checkServer(data.server);
|
|
|
|
await checkBanner();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should reopen the app and have banner', async () => {
|
2021-04-01 19:27:46 +00:00
|
|
|
await device.launchApp({
|
|
|
|
permissions: { notifications: 'YES' },
|
|
|
|
newInstance: true
|
|
|
|
});
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('rooms-list-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(10000);
|
2021-04-01 19:27:46 +00:00
|
|
|
await checkBanner();
|
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|