fix(ci): update conditions for artifact uploads and cleanup steps in E2E tests

This commit is contained in:
GitHub Actions
2026-02-05 00:24:21 +00:00
parent 631ffebe69
commit 9730008b39
2 changed files with 8 additions and 3 deletions

View File

@@ -5,11 +5,14 @@ import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
/**
* Read environment variables from file.
* Read environment variables from file (local development only).
* In CI, environment variables are provided by GitHub secrets.
* https://github.com/motdotla/dotenv
*/
import dotenv from 'dotenv';
dotenv.config({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') });
if (!process.env.CI) {
dotenv.config({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') });
}
/**
* Auth state storage path - shared across all browser projects

View File

@@ -13,6 +13,7 @@
import { test, expect, loginUser } from '../fixtures/auth-fixtures';
import { request } from '@playwright/test';
import type { APIRequestContext } from '@playwright/test';
import { STORAGE_STATE } from '../constants';
import { waitForLoadingComplete, waitForToast } from '../utils/wait-helpers';
import { clickSwitch } from '../utils/ui-helpers';
import {
@@ -130,9 +131,10 @@ test.describe('Security Dashboard', () => {
return;
}
// Create fresh request context for cleanup (cannot reuse fixture from beforeAll)
// Create authenticated request context for cleanup (cannot reuse fixture from beforeAll)
const cleanupRequest = await request.newContext({
baseURL: 'http://localhost:8080',
storageState: STORAGE_STATE,
});
try {