Files
Umbraco-CMS/tests/Umbraco.Tests.AcceptanceTest/playwright.config.ts
Andreas Zerbst 3d6c5850dc V14 added test for the Templates (#15179)
* Updated existing locator as it was prone to failing

* Removed old tests from earlier versions

* Added a timeout and an await. This was because the locator sometimes failed

* Added missing import for crypto

* Updated locator as it sometimes failed.

* Updated the README to include information for using the UI mode for playwright

* Bumped the timeout time for our tests

* We updated the naming for out methods in our testHelpers, so we need to update the usage as well

* Added additional timeout

* Updated the config so it is easier to understand what you need to input

* Added UI acceptance tests for templates

* Added types/node, allows us to use crypto. Updated the testhelpers to use the newest version.

* fixed error with testhelper dependency

* Bumped testhelper version

* Moved to settings instead of templating
2023-11-13 09:36:23 +01:00

55 lines
1.7 KiB
TypeScript

import {defineConfig, devices} from '@playwright/test';
import * as path from "path";
require('dotenv').config();
export const STORAGE_STATE = path.join(__dirname, 'playwright/.auth/user.json');
export default defineConfig({
testDir: './tests/',
/* Maximum time one test can run for. */
timeout: 60 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000
},
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 5 : 2,
// We don't want to run parallel, as tests might differ in state
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: process.env.CI ? 'line' : 'html',
outputDir: "./results",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
// When working locally it can be a good idea to use trace: 'on-first-retry' instead of 'retain-on-failure', it can cut the local test times in half.
trace: 'retain-on-failure',
ignoreHTTPSErrors: true,
},
/* Configure projects for major browsers */
projects: [
// Setup project
{
name: 'setup',
testMatch: '**/*.setup.ts',
},
{
name: 'chromium',
dependencies: ['setup'],
use: {
...devices['Desktop Chrome'],
// Use prepared auth state.
storageState: STORAGE_STATE,
},
},
],
});