2020-05-20 16:33:40 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
|
|
|
|
describe('Onboarding', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
before(async () => {
|
2020-07-15 16:28:34 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('onboarding-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(20000);
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('Render', () => {
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have onboarding screen', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await expect(element(by.id('onboarding-view'))).toBeVisible();
|
2021-07-02 17:39:39 +00:00
|
|
|
});
|
2020-05-20 16:33:40 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have "Join a workspace"', async () => {
|
2021-07-02 17:39:39 +00:00
|
|
|
await expect(element(by.id('join-workspace'))).toBeVisible();
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should have "Create a new workspace"', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await expect(element(by.id('create-workspace-button'))).toBeVisible();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', () => {
|
|
|
|
// it('should navigate to create new workspace', async() => {
|
|
|
|
// // webviews are not supported by detox: https://github.com/wix/detox/issues/136#issuecomment-306591554
|
|
|
|
// });
|
2021-07-02 17:39:39 +00:00
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should navigate to join a workspace', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('join-workspace')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-server-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should enter an invalid server and get error', async () => {
|
2021-04-19 14:31:43 +00:00
|
|
|
await element(by.id('new-server-view-input')).typeText('invalidtest\n');
|
2020-05-20 16:33:40 +00:00
|
|
|
const errorText = 'Oops!';
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.text(errorText)))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.text('OK')).tap();
|
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should tap on "Join our open workspace" and navigate', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('new-server-view-open')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('workspace-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
it('should enter a valid server without login services and navigate to login', async () => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await device.launchApp({ newInstance: true });
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('onboarding-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(2000);
|
2020-05-20 16:33:40 +00:00
|
|
|
await element(by.id('join-workspace')).tap();
|
2021-09-13 20:41:05 +00:00
|
|
|
await waitFor(element(by.id('new-server-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
|
|
|
await element(by.id('new-server-view-input')).typeText(`${data.server}\n`);
|
|
|
|
await waitFor(element(by.id('workspace-view')))
|
|
|
|
.toBeVisible()
|
|
|
|
.withTimeout(60000);
|
2020-05-20 16:33:40 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|