2020-05-20 16:33:40 +00:00
|
|
|
const data = require('../../data');
|
|
|
|
const { navigateToLogin } = require('../../helpers/app');
|
2021-06-23 21:00:26 +00:00
|
|
|
const { prepareAndroid } = require('../../helpers/platformFunctions');
|
2018-05-23 13:39:18 +00:00
|
|
|
|
|
|
|
describe('Forgot password screen', () => {
|
|
|
|
before(async() => {
|
2021-06-11 18:23:43 +00:00
|
|
|
await device.launchApp({ permissions: { notifications: 'YES' }, delete: true });
|
2021-06-27 20:47:57 +00:00
|
|
|
await prepareAndroid();
|
2020-05-20 16:33:40 +00:00
|
|
|
await navigateToLogin();
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('login-view-forgot-password')).tap();
|
2020-05-20 16:33:40 +00:00
|
|
|
await waitFor(element(by.id('forgot-password-view'))).toExist().withTimeout(2000);
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Render', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should have forgot password screen', async() => {
|
2020-05-20 16:33:40 +00:00
|
|
|
await expect(element(by.id('forgot-password-view'))).toExist();
|
2018-05-23 13:39:18 +00:00
|
|
|
});
|
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();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-07-02 17:39:39 +00:00
|
|
|
describe('Usage', () => {
|
2018-05-23 13:39:18 +00:00
|
|
|
it('should reset password and navigate to login', async() => {
|
2020-07-15 16:28:34 +00:00
|
|
|
await element(by.id('forgot-password-view-email')).replaceText(data.users.existing.email);
|
2018-05-23 13:39:18 +00:00
|
|
|
await element(by.id('forgot-password-view-submit')).tap();
|
2021-04-19 14:31:43 +00:00
|
|
|
await waitFor(element(by.text('OK'))).toExist().withTimeout(10000);
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|