2018-05-23 13:39:18 +00:00
|
|
|
const {
|
|
|
|
device, expect, element, by, waitFor
|
|
|
|
} = require('detox');
|
|
|
|
const { takeScreenshot } = require('./helpers/screenshot');
|
|
|
|
const data = require('./data');
|
|
|
|
|
|
|
|
describe('Forgot password screen', () => {
|
|
|
|
before(async() => {
|
|
|
|
await element(by.id('welcome-view-login')).tap();
|
|
|
|
await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
await element(by.id('login-view-forgot-password')).tap();
|
|
|
|
await waitFor(element(by.id('forgot-password-view'))).toBeVisible().withTimeout(2000);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Render', async() => {
|
|
|
|
it('should have forgot password screen', async() => {
|
|
|
|
await expect(element(by.id('forgot-password-view'))).toBeVisible();
|
|
|
|
});
|
2019-05-28 13:03:08 +00:00
|
|
|
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have email input', async() => {
|
|
|
|
await expect(element(by.id('forgot-password-view-email'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should have submit button', async() => {
|
|
|
|
await expect(element(by.id('forgot-password-view-submit'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
after(async() => {
|
|
|
|
takeScreenshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('Usage', async() => {
|
|
|
|
it('should reset password and navigate to login', async() => {
|
2018-12-05 20:52:08 +00:00
|
|
|
await element(by.id('forgot-password-view-email')).replaceText('diego.mello@rocket.chat');
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('forgot-password-view-submit')).tap();
|
2019-05-28 13:03:08 +00:00
|
|
|
await element(by.text('OK')).tap();
|
2018-05-23 13:39:18 +00:00
|
|
|
await waitFor(element(by.id('login-view'))).toBeVisible().withTimeout(60000);
|
|
|
|
await expect(element(by.id('login-view'))).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(async() => {
|
|
|
|
takeScreenshot();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|