2020-07-22 16:32:21 +00:00
|
|
|
const { navigateToLogin, login, sleep } = require('../../helpers/app');
|
|
|
|
const data = require('../../data');
|
2021-07-02 17:39:39 +00:00
|
|
|
|
|
|
|
const testuser = data.users.regular;
|
2020-03-30 20:19:01 +00:00
|
|
|
|
|
|
|
async function waitForToast() {
|
2020-09-11 14:31:38 +00:00
|
|
|
await sleep(300);
|
2020-03-30 20:19:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('Status screen', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-07-22 16:32:21 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
await navigateToLogin();
|
|
|
|
await login(testuser.username, testuser.password);
|
|
|
|
|
2020-03-30 20:19:01 +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-custom-status')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-03-30 20:19:01 +00:00
|
|
|
|
|
|
|
await element(by.id('sidebar-custom-status')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('status-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-03-30 20:19:01 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have status input', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await expect(element(by.id('status-view-input'))).toBeVisible();
|
|
|
|
await expect(element(by.id('status-view-online'))).toExist();
|
2020-03-30 20:19:01 +00:00
|
|
|
await expect(element(by.id('status-view-busy'))).toExist();
|
|
|
|
await expect(element(by.id('status-view-away'))).toExist();
|
|
|
|
await expect(element(by.id('status-view-offline'))).toExist();
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should change status', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('status-view-busy')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('status-view-current-busy')))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
2020-03-30 20:19:01 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should change status text', async () => {
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('status-view-input')).typeText('status-text-new');
|
2020-03-30 20:19:01 +00:00
|
|
|
await element(by.id('status-view-submit')).tap();
|
|
|
|
await waitForToast();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.label('status-text-new').withAncestor(by.id('sidebar-custom-status'))))
|
|
|
|
.toExist()
|
|
|
|
.withTimeout(2000);
|
2020-07-22 16:32:21 +00:00
|
|
|
});
|
|
|
|
});
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|