"Fossies" - the Fresh Open Source Software Archive

Member "Rocket.Chat-4.7.1/apps/meteor/tests/e2e/01-forgot-password.spec.ts" (13 May 2022, 1280 Bytes) of package /linux/www/Rocket.Chat-4.7.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { test, expect } from '@playwright/test';
    2 
    3 import LoginPage from './utils/pageobjects/LoginPage';
    4 import { VALID_EMAIL, INVALID_EMAIL, INVALID_EMAIL_WITHOUT_MAIL_PROVIDER } from './utils/mocks/userAndPasswordMock';
    5 
    6 test.describe('[Forgot Password]', () => {
    7     let loginPage: LoginPage;
    8 
    9     test.beforeEach(async ({ page, baseURL }) => {
   10         loginPage = new LoginPage(page);
   11         const baseUrl = baseURL as string;
   12         await loginPage.goto(baseUrl);
   13         await loginPage.gotToForgotPassword();
   14     });
   15 
   16     test('expect be required', async () => {
   17         loginPage.submit();
   18 
   19         await expect(loginPage.emailInvalidText()).toBeVisible();
   20     });
   21 
   22     test('expect invalid for email without domain', async () => {
   23         await loginPage.emailField().type(INVALID_EMAIL_WITHOUT_MAIL_PROVIDER);
   24         await loginPage.submit();
   25         await expect(loginPage.emailInvalidText()).toBeVisible();
   26     });
   27 
   28     test('expect be invalid for email with invalid domain', async () => {
   29         await loginPage.emailField().type(INVALID_EMAIL);
   30         await loginPage.submit();
   31         await expect(loginPage.emailInvalidText()).toBeVisible();
   32     });
   33 
   34     test('expect user type a valid email', async () => {
   35         await loginPage.emailField().type(VALID_EMAIL);
   36         await loginPage.submit();
   37         await expect(loginPage.getToastMessageSuccess()).toBeVisible();
   38     });
   39 });