"Fossies" - the Fresh Open Source Software Archive

Member "Rocket.Chat-4.7.2/apps/meteor/tests/e2e/00-wizard.spec.ts" (20 May 2022, 2700 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 SetupWizard from './utils/pageobjects/SetupWizard';
    4 import { VALID_EMAIL, adminLogin } from './utils/mocks/userAndPasswordMock';
    5 import { setupWizardStepRegex } from './utils/mocks/urlMock';
    6 import { HOME_SELECTOR } from './utils/mocks/waitSelectorsMock';
    7 import LoginPage from './utils/pageobjects/LoginPage';
    8 
    9 test.describe('[Wizard]', () => {
   10     let setupWizard: SetupWizard;
   11     let loginPage: LoginPage;
   12     test.beforeEach(async ({ page }) => {
   13         setupWizard = new SetupWizard(page);
   14         loginPage = new LoginPage(page);
   15     });
   16 
   17     test.describe('[Step 2]', async () => {
   18         test.beforeEach(async ({ baseURL }) => {
   19             const baseUrl = baseURL;
   20             await setupWizard.goto(baseUrl as string);
   21             await loginPage.login(adminLogin);
   22         });
   23 
   24         test('expect required field alert showed when user dont inform data', async () => {
   25             await setupWizard.stepTwoFailedWithBlankFields();
   26         });
   27 
   28         test('expect go to Step 3 successfully', async () => {
   29             await setupWizard.stepTwoSuccess();
   30             await expect(setupWizard.getPage()).toHaveURL(setupWizardStepRegex._3);
   31         });
   32     });
   33 
   34     test.describe('[Step 3]', async () => {
   35         test.beforeEach(async () => {
   36             await setupWizard.goto('');
   37             await loginPage.login(adminLogin);
   38             await setupWizard.stepTwoSuccess();
   39         });
   40 
   41         test('expect have email field to register the server', async () => {
   42             await expect(setupWizard.registeredServer()).toBeVisible();
   43         });
   44 
   45         test('expect start "Register" button disabled', async () => {
   46             await expect(setupWizard.registerButton()).toBeDisabled();
   47         });
   48 
   49         test('expect show an error on invalid email', async () => {
   50             await setupWizard.stepThreeFailedWithInvalidField();
   51         });
   52 
   53         test('expect enable "Register" button when email is valid and terms checked', async () => {
   54             await setupWizard.registeredServer().type(VALID_EMAIL);
   55             await setupWizard.agreementField().click();
   56             await expect(setupWizard.registerButton()).toBeEnabled();
   57         });
   58 
   59         test('expect have option for standalone server', async () => {
   60             await expect(setupWizard.standaloneServer()).toBeVisible();
   61         });
   62     });
   63 
   64     test.describe('[Final Step]', async () => {
   65         test.beforeEach(async () => {
   66             await setupWizard.goto('');
   67             await loginPage.login(adminLogin);
   68             await setupWizard.stepTwoSuccess();
   69             await setupWizard.stepThreeSuccess();
   70         });
   71 
   72         test('expect confirm the standalone option', async () => {
   73             await expect(setupWizard.goToWorkspace()).toBeVisible();
   74             await expect(setupWizard.standaloneConfirmText()).toBeVisible();
   75         });
   76 
   77         test('expect confirm standalone', async () => {
   78             await setupWizard.goToWorkspace().click();
   79             await setupWizard.waitForSelector(HOME_SELECTOR);
   80         });
   81     });
   82 });