2022-11-09 13:51:30 +00:00
|
|
|
import selectors from '../../helpers/selectors';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
2022-12-16 08:01:30 +00:00
|
|
|
// https://redmine.verdnatura.es/issues/4995 fix login
|
|
|
|
xdescribe('RecoverPassword path', async() => {
|
2022-11-09 13:51:30 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
|
|
|
|
await page.waitToClick(selectors.recoverPassword.recoverPasswordButton);
|
2022-11-23 07:23:58 +00:00
|
|
|
await page.waitForState('recoverPassword');
|
2022-11-09 13:51:30 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not throw error if not exist user', async() => {
|
|
|
|
await page.write(selectors.recoverPassword.email, 'fakeEmail@mydomain.com');
|
|
|
|
await page.waitToClick(selectors.recoverPassword.sendEmailButton);
|
|
|
|
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Notification sent!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should send email', async() => {
|
|
|
|
await page.waitForState('login');
|
|
|
|
await page.waitToClick(selectors.recoverPassword.recoverPasswordButton);
|
|
|
|
|
|
|
|
await page.write(selectors.recoverPassword.email, 'BruceWayne@mydomain.com');
|
|
|
|
await page.waitToClick(selectors.recoverPassword.sendEmailButton);
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
await page.waitForState('login');
|
|
|
|
|
|
|
|
expect(message.text).toContain('Notification sent!');
|
|
|
|
});
|
|
|
|
});
|