* test(e2e): Address deprecation * test(e2e): Add additional connection assertions on tests * CR: Fix flake when waiting for sessions If no sessions are available and the page needs to reload, we should wait to ensure that the page has loaded before checking what the state of the sessions are * CR: Address flake in connect methods Noticed an issue where a session recording was not playable. The theory is that the session didn't last long enough before it was cancelled. This adds a 2 second wait after establishing a connection before continuing. * CR: Use authenticated state by default * CR: Update dynamic host catalog assertion * CR: Simplify host set checks - Use .all() when looping - Add check to see if we need to reload the page or not * CR: Be more specific with locator Ran into a conflict with the Static/Dynamic host catalog type and the Static/Dynamic credential type. * CR: Update connection methods to be more resilient Rather than using a hardcoded sleep, we will now run a command on the target and wait for a specific string to return before continuing. * CR
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
import { authenticatedState } from '../global-setup';
|
|
|
|
/** @type {import('@playwright/test').PlaywrightTestConfig} */
|
|
export default defineConfig({
|
|
globalSetup: '../global-setup',
|
|
outputDir: './artifacts/test-failures',
|
|
timeout: 90000, // Each test is given 90s to complete
|
|
workers: 1, // Tests need to be run in serial, otherwise there may be conflicts when using the CLI
|
|
use: {
|
|
baseURL: process.env.BOUNDARY_ADDR,
|
|
extraHTTPHeaders: {
|
|
// This token is set in global-setup.js
|
|
Authorization: `Bearer ${process.env.E2E_TOKEN}`,
|
|
},
|
|
screenshot: 'only-on-failure',
|
|
storageState: authenticatedState,
|
|
trace: 'retain-on-failure',
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: { ...devices['Desktop Chrome'] },
|
|
},
|
|
{
|
|
name: 'firefox',
|
|
use: { ...devices['Desktop Firefox'] },
|
|
},
|
|
{
|
|
name: 'webkit',
|
|
use: { ...devices['Desktop Safari'] },
|
|
},
|
|
],
|
|
});
|