"Fossies" - the Fresh Open Source Software Archive

Member "Rocket.Chat-4.7.2/apps/meteor/tests/e2e/03-login.spec.ts" (20 May 2022, 862 Bytes) of package /linux/www/Rocket.Chat-4.7.2.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 { validUser } from './utils/mocks/userAndPasswordMock';
    4 import LoginPage from './utils/pageobjects/LoginPage';
    5 import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock';
    6 
    7 test.describe('[Login]', () => {
    8     let loginPage: LoginPage;
    9 
   10     test.beforeEach(async ({ page, baseURL }) => {
   11         const baseUrl = baseURL;
   12         loginPage = new LoginPage(page);
   13         await loginPage.goto(baseUrl as string);
   14     });
   15 
   16     test('expect user write a password incorrectly', async () => {
   17         const invalidUserPassword = {
   18             email: validUser.email,
   19             password: 'any_password1',
   20         };
   21         await loginPage.login(invalidUserPassword);
   22         await expect(loginPage.getToastError()).toBeVisible();
   23     });
   24 
   25     test('expect user make login', async () => {
   26         await loginPage.login(validUser);
   27         await loginPage.waitForSelector(HOME_SELECTOR);
   28     });
   29 });