Files
Umbraco-CMS/tests/Umbraco.Tests.AcceptanceTest/tests/auth.setup.ts
Andreas Zerbst 66ea4fe29a V14 QA Added Log Viewer Tests (#15108)
* Added log viewer tests, not done yet

* Updated auth to work

* Updated the authentication test

* Cleaned up the Logviewer tests

* Removed old acceptance tests

* Fixed failing test

* Updated old tests and added additional log viewer tests

* Bumped version and deleted duplicate dependencies

* Fixed naming

* Added a TODO
2023-11-06 11:33:25 +01:00

18 lines
719 B
TypeScript

import {test as setup, expect} from '@playwright/test';
import {STORAGE_STATE} from '../playwright.config'
import {UiHelpers} from "@umbraco/playwright-testhelpers";
setup('authenticate', async ({page}) => {
const umbracoUi = new UiHelpers(page);
await page.goto(process.env.URL + '/umbraco');
await page.getByLabel('Email').fill(process.env.UMBRACO_USER_LOGIN);
await page.getByLabel( 'Password', {exact: true}).fill(process.env.UMBRACO_USER_PASSWORD);
await page.getByRole('button', {name: 'Login'}).click();
// Assert
await expect(page.getByRole('tab', {name: 'Settings'})).toBeVisible();
await umbracoUi.goToSection('Settings');
await page.context().storageState({path: STORAGE_STATE});
});