From f76c46dca53e8bb69e3443a12c2c077ab9458d0f Mon Sep 17 00:00:00 2001 From: Bryttanie House Date: Wed, 20 May 2026 10:28:00 -0400 Subject: [PATCH] fix(test): remove workaround for multi user tests This reverts the workaround we had that split users into different UI projects to prevent auth state conflicts. The conflicts were caused by the frontend-development-proxy caching parallel responses by URL, and this has been fixed. --- playwright.config.ts | 56 +++++++++------------------ playwright/UI/AdvisoriesTests.spec.ts | 7 ++++ 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 2afb9cf2c..f33f5817f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -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'], + }, ], }); diff --git a/playwright/UI/AdvisoriesTests.spec.ts b/playwright/UI/AdvisoriesTests.spec.ts index 599c76188..59eb00f01 100644 --- a/playwright/UI/AdvisoriesTests.spec.ts +++ b/playwright/UI/AdvisoriesTests.spec.ts @@ -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 });