2021-09-13 20:41:05 +00:00
|
|
|
const { login, navigateToLogin, logout, tapBack } = require('../../helpers/app');
|
2020-09-11 17:10:16 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
|
|
|
|
describe('Server history', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-09-11 17:10:16 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should login, save server as history and logout', async () => {
|
2020-09-11 17:10:16 +00:00
|
|
|
await navigateToLogin();
|
|
|
|
await login(data.users.regular.username, data.users.regular.password);
|
|
|
|
await logout();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-server-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-09-11 17:10:16 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should show servers history', async () => {
|
2020-09-11 17:10:16 +00:00
|
|
|
await element(by.id('new-server-view-input')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`server-history-${data.server}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-09-11 17:10:16 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap on a server history and navigate to login', async () => {
|
|
|
|
await element(by.id(`server-history-${data.server}`)).tap();
|
|
|
|
await waitFor(element(by.id('login-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(5000);
|
2020-09-11 17:10:16 +00:00
|
|
|
await expect(element(by.id('login-view-email'))).toHaveText(data.users.regular.username);
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should delete server from history', async () => {
|
2020-09-11 17:10:16 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('workspace-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-09-11 17:10:16 +00:00
|
|
|
await tapBack();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-server-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-09-11 17:10:16 +00:00
|
|
|
await element(by.id('new-server-view-input')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`server-history-${data.server}`)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
|
|
|
await element(by.id(`server-history-delete-${data.server}`)).tap();
|
2020-09-11 17:10:16 +00:00
|
|
|
await element(by.id('new-server-view-input')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id(`server-history-${data.server}`)))
|
|
|
|
.toBeNotVisible()
|
|
|
|
.withTimeout(2000);
|
2020-09-11 17:10:16 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|