Skip to content

Commit 703b408

Browse files
committed
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.
1 parent 1b14cdc commit 703b408

2 files changed

Lines changed: 26 additions & 37 deletions

File tree

playwright.config.ts

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -50,44 +50,26 @@ export default defineConfig({
5050
video: 'on',
5151
},
5252
projects: [
53-
{ name: 'setup', testMatch: /auth\.setup\.ts/, use: { trace: 'off' } },
54-
...(process.env.INTEGRATION
55-
? [
56-
{
57-
name: 'Integration',
58-
use: {
59-
...devices['Desktop Chrome'],
60-
storageState: '.auth/ADMIN_TOKEN.json',
61-
},
62-
testDir: './playwright/Integration/',
63-
dependencies: ['setup'],
64-
},
65-
]
66-
: [
67-
{
68-
name: 'UI-default-user',
69-
use: {
70-
...devices['Desktop Chrome'],
71-
storageState: '.auth/ADMIN_TOKEN.json',
72-
},
73-
testDir: './playwright/UI/',
74-
testIgnore: ['**/AdvisoriesTests.spec.ts'],
75-
dependencies: ['setup'],
53+
{ name: 'setup', testMatch: /.*\.setup\.ts/, use: { trace: 'off' } },
54+
process.env.INTEGRATION
55+
? {
56+
name: 'Integration',
57+
use: {
58+
...devices['Desktop Chrome'],
59+
storageState: '.auth/ADMIN_TOKEN.json',
7660
},
77-
{
78-
name: 'UI-advisory-remediation-user',
79-
use: {
80-
...devices['Desktop Chrome'],
81-
storageState: '.auth/ADVISORY_REMEDIATION_TOKEN.json',
82-
extraHTTPHeaders: process.env.ADVISORY_REMEDIATION_TOKEN
83-
? { Authorization: process.env.ADVISORY_REMEDIATION_TOKEN }
84-
: {},
85-
},
86-
testDir: './playwright/UI/',
87-
testMatch: ['**/AdvisoriesTests.spec.ts'],
88-
// Run after all default-user UI tests to prevent auth state conflicts
89-
dependencies: ['setup', 'UI-default-user'],
61+
testDir: './playwright/Integration/',
62+
dependencies: ['setup'],
63+
}
64+
:
65+
{
66+
name: 'UI',
67+
use: {
68+
...devices['Desktop Chrome'],
69+
storageState: '.auth/ADMIN_TOKEN.json',
9070
},
91-
]),
71+
testDir: './playwright/UI/',
72+
dependencies: ['setup'],
73+
},
9274
],
9375
});

playwright/UI/AdvisoriesTests.spec.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ import {
99
import { cleanupRemediationPlan } from 'test-utils/helpers/cleaners';
1010

1111
test.describe('Advisories Tests', () => {
12+
test.use({
13+
storageState: '.auth/ADVISORY_REMEDIATION_TOKEN.json',
14+
extraHTTPHeaders: process.env.ADVISORY_REMEDIATION_TOKEN
15+
? { Authorization: process.env.ADVISORY_REMEDIATION_TOKEN }
16+
: {},
17+
});
18+
1219
// Disable retries for this test, systems are not deleted immediately in patch so second attempt will likely fail
1320
test.describe.configure({ retries: 0 });
1421

0 commit comments

Comments
 (0)