test(salix): refs #6427 improve test
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-05-23 22:32:30 +02:00
parent d534ee423b
commit 1d04ca1c8a
1 changed files with 18 additions and 16 deletions

View File

@ -21,27 +21,17 @@ fdescribe('RecoverPassword path', async() => {
await page.write(selectors.recoverPassword.email, 'fakeEmail@mydomain.com');
await page.waitToClick(selectors.recoverPassword.emailOption);
await page.waitToClick(selectors.recoverPassword.sendEmailButton);
const httpDataResponse = await page.waitForResponse(response => {
return response.status() === 204 && response.url().includes(`VnUsers/recoverPassword`);
});
const code = await httpDataResponse.ok();
expect(code).toBeTrue();
const message = await page.waitForSnackbar();
expect(message.text).toContain('Notification sent!');
});
it('should not throw error if not exist user when select sms option', async() => {
await page.waitForState('login');
await page.waitToClick(selectors.recoverPassword.recoverPasswordButton);
await page.write(selectors.recoverPassword.email, 'fakeEmail@mydomain.com');
await page.waitToClick(selectors.recoverPassword.emailOption);
// await page.waitToClick(selectors.recoverPassword.smsOption);
await page.waitToClick(selectors.recoverPassword.sendEmailButton);
const message = await page.waitForSnackbar();
// await page.waitForState('login');
expect(message.text).toContain('Credentials not valid');
expect(await page.getState()).toContain('recover-password');
});
it('should send email using email', async() => {
await page.waitForState('login');
await page.waitToClick(selectors.recoverPassword.recoverPasswordButton);
@ -68,9 +58,21 @@ fdescribe('RecoverPassword path', async() => {
expect(message.text).toContain('Notification sent!');
});
it('should send sms using username', async() => {
it('should not throw error if not exist user when select sms option', async() => {
await page.waitForState('login');
await page.waitToClick(selectors.recoverPassword.recoverPasswordButton);
await page.write(selectors.recoverPassword.email, 'fakeEmail@mydomain.com');
await page.waitToClick(selectors.recoverPassword.smsOption);
await page.waitToClick(selectors.recoverPassword.sendEmailButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Credentials not valid');
expect(await page.getState()).toContain('recover-password');
});
it('should send sms using username', async() => {
await page.clearInput(selectors.recoverPassword.email);
await page.write(selectors.recoverPassword.email, 'BruceWayne');
await page.waitToClick(selectors.recoverPassword.smsOption);