Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 19 additions & 37 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,44 +50,26 @@ export default defineConfig({
video: 'on',
},
projects: [
{ name: 'setup', testMatch: /auth\.setup\.ts/, use: { trace: 'off' } },
...(process.env.INTEGRATION
? [
{
name: 'Integration',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
testDir: './playwright/Integration/',
dependencies: ['setup'],
},
]
: [
{
name: 'UI-default-user',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
testDir: './playwright/UI/',
testIgnore: ['**/AdvisoriesTests.spec.ts'],
dependencies: ['setup'],
{ name: 'setup', testMatch: /.*\.setup\.ts/, use: { trace: 'off' } },
process.env.INTEGRATION
? {
name: 'Integration',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
{
name: 'UI-advisory-remediation-user',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADVISORY_REMEDIATION_TOKEN.json',
extraHTTPHeaders: process.env.ADVISORY_REMEDIATION_TOKEN
? { Authorization: process.env.ADVISORY_REMEDIATION_TOKEN }
: {},
},
testDir: './playwright/UI/',
testMatch: ['**/AdvisoriesTests.spec.ts'],
// Run after all default-user UI tests to prevent auth state conflicts
dependencies: ['setup', 'UI-default-user'],
testDir: './playwright/Integration/',
dependencies: ['setup'],
}
:
{
name: 'UI',
use: {
...devices['Desktop Chrome'],
storageState: '.auth/ADMIN_TOKEN.json',
},
]),
testDir: './playwright/UI/',
dependencies: ['setup'],
},
],
});
7 changes: 7 additions & 0 deletions playwright/UI/AdvisoriesTests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import {
import { cleanupRemediationPlan } from 'test-utils/helpers/cleaners';

test.describe('Advisories Tests', () => {
test.use({
storageState: '.auth/ADVISORY_REMEDIATION_TOKEN.json',
extraHTTPHeaders: process.env.ADVISORY_REMEDIATION_TOKEN
? { Authorization: process.env.ADVISORY_REMEDIATION_TOKEN }
: {},
});

// Disable retries for this test, systems are not deleted immediately in patch so second attempt will likely fail
test.describe.configure({ retries: 0 });

Expand Down
Loading