2018-05-23 13:39:18 +00:00
|
|
|
const {
|
|
|
|
device, expect, element, by, waitFor
|
|
|
|
} = require('detox');
|
|
|
|
const { takeScreenshot } = require('./helpers/screenshot');
|
2018-07-10 13:40:32 +00:00
|
|
|
const { tapBack } = require('./helpers/app');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
describe('Welcome screen', () => {
|
2018-11-14 21:42:03 +00:00
|
|
|
before(async() => {
|
|
|
|
await device.reloadReactNative();
|
|
|
|
await element(by.id('join-community-button')).tap();
|
|
|
|
await waitFor(element(by.id('welcome-view'))).toBeVisible().withTimeout(60000);
|
|
|
|
})
|
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
describe('Render', async() => {
|
|
|
|
it('should have welcome screen', async() => {
|
|
|
|
await expect(element(by.id('welcome-view'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have register button', async() => {
|
|
|
|
await expect(element(by.id('welcome-view-register'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have login button', async() => {
|
|
|
|
await expect(element(by.id('welcome-view-login'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
// TODO: oauth
|
|
|
|
|
|
|
|
after(async() => {
|
|
|
|
takeScreenshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', async() => {
|
|
|
|
it('should navigate to login', async() => {
|
|
|
|
await element(by.id('welcome-view-login')).tap();
|
|
|
|
await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await expect(element(by.id('login-view'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to register', async() => {
|
2018-11-14 21:42:03 +00:00
|
|
|
await tapBack();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('welcome-view-register')).tap();
|
|
|
|
await waitFor(element(by.id('register-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await expect(element(by.id('register-view'))).toBeVisible();
|
2018-11-14 21:42:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to legal', async() => {
|
2018-08-31 18:13:30 +00:00
|
|
|
await tapBack();
|
2018-11-14 21:42:03 +00:00
|
|
|
await element(by.id('welcome-view-more')).tap();
|
|
|
|
await waitFor(element(by.id('legal-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await expect(element(by.id('legal-view'))).toBeVisible();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(async() => {
|
|
|
|
takeScreenshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|