diff --git a/frontend/admin/scripts/run-playwright-auth-e2e.ps1 b/frontend/admin/scripts/run-playwright-auth-e2e.ps1 index 3247278..9388d05 100644 --- a/frontend/admin/scripts/run-playwright-auth-e2e.ps1 +++ b/frontend/admin/scripts/run-playwright-auth-e2e.ps1 @@ -160,32 +160,30 @@ $backendBaseUrl = "http://127.0.0.1:$selectedBackendPort" $frontendBaseUrl = "http://127.0.0.1:$selectedFrontendPort" try { - Push-Location $projectRoot + $serverSrcPath = Join-Path $projectRoot 'cmd\server' try { $env:GOCACHE = $goCacheDir - $env:GOMODCACHE = $goModCacheDir - $env:GOPATH = $goPathDir - go build -o $serverExePath ./cmd/server + go build -o $serverExePath $serverSrcPath if ($LASTEXITCODE -ne 0) { throw 'server build failed' } } finally { Pop-Location Remove-Item Env:GOCACHE -ErrorAction SilentlyContinue - Remove-Item Env:GOMODCACHE -ErrorAction SilentlyContinue - Remove-Item Env:GOPATH -ErrorAction SilentlyContinue } - $env:UMS_SERVER_PORT = "$selectedBackendPort" - $env:UMS_DATABASE_SQLITE_PATH = $e2eDbPath -$env:UMS_SERVER_MODE = 'debug' -$env:UMS_PASSWORD_RESET_SITE_URL = $frontendBaseUrl -$env:UMS_CORS_ALLOWED_ORIGINS = "$frontendBaseUrl,http://localhost:$selectedFrontendPort" - $env:UMS_LOGGING_OUTPUT = 'stdout' - $env:UMS_EMAIL_HOST = '127.0.0.1' - $env:UMS_EMAIL_PORT = "$selectedSMTPPort" - $env:UMS_EMAIL_FROM_EMAIL = 'noreply@test.local' - $env:UMS_EMAIL_FROM_NAME = 'UMS E2E' + $env:SERVER_PORT = "$selectedBackendPort" + $env:DATABASE_DBNAME = $e2eDbPath +$env:SERVER_MODE = 'debug' +$env:SERVER_FRONTEND_URL = $frontendBaseUrl +$env:CORS_ALLOWED_ORIGINS = "$frontendBaseUrl,http://localhost:$selectedFrontendPort" + $env:LOGGING_OUTPUT = 'stdout' + $env:EMAIL_HOST = '127.0.0.1' + $env:EMAIL_PORT = "$selectedSMTPPort" + $env:EMAIL_FROM_EMAIL = 'noreply@test.local' + $env:EMAIL_FROM_NAME = 'UMS E2E' + # JWT secret must be at least 32 bytes + $env:JWT_SECRET = 'e2e-test-jwt-secret-at-least-32-bytes-long-for-security' Write-Host "playwright e2e backend: $backendBaseUrl" Write-Host "playwright e2e frontend: $frontendBaseUrl" @@ -280,18 +278,21 @@ $env:UMS_CORS_ALLOWED_ORIGINS = "$frontendBaseUrl,http://localhost:$selectedFron Remove-ManagedProcessLogs $backendHandle Stop-ManagedProcess $smtpHandle Remove-ManagedProcessLogs $smtpHandle - Remove-Item Env:UMS_SERVER_PORT -ErrorAction SilentlyContinue - Remove-Item Env:UMS_DATABASE_SQLITE_PATH -ErrorAction SilentlyContinue - Remove-Item Env:UMS_SERVER_MODE -ErrorAction SilentlyContinue - Remove-Item Env:UMS_PASSWORD_RESET_SITE_URL -ErrorAction SilentlyContinue - Remove-Item Env:UMS_CORS_ALLOWED_ORIGINS -ErrorAction SilentlyContinue - Remove-Item Env:UMS_LOGGING_OUTPUT -ErrorAction SilentlyContinue - Remove-Item Env:UMS_EMAIL_HOST -ErrorAction SilentlyContinue - Remove-Item Env:UMS_EMAIL_PORT -ErrorAction SilentlyContinue - Remove-Item Env:UMS_EMAIL_FROM_EMAIL -ErrorAction SilentlyContinue - Remove-Item Env:UMS_EMAIL_FROM_NAME -ErrorAction SilentlyContinue + Remove-Item Env:SERVER_PORT -ErrorAction SilentlyContinue + Remove-Item Env:DATABASE_DBNAME -ErrorAction SilentlyContinue + Remove-Item Env:SERVER_MODE -ErrorAction SilentlyContinue + Remove-Item Env:SERVER_FRONTEND_URL -ErrorAction SilentlyContinue + Remove-Item Env:CORS_ALLOWED_ORIGINS -ErrorAction SilentlyContinue + Remove-Item Env:LOGGING_OUTPUT -ErrorAction SilentlyContinue + Remove-Item Env:EMAIL_HOST -ErrorAction SilentlyContinue + Remove-Item Env:EMAIL_PORT -ErrorAction SilentlyContinue + Remove-Item Env:EMAIL_FROM_EMAIL -ErrorAction SilentlyContinue + Remove-Item Env:EMAIL_FROM_NAME -ErrorAction SilentlyContinue Remove-Item Env:VITE_API_PROXY_TARGET -ErrorAction SilentlyContinue Remove-Item Env:VITE_API_BASE_URL -ErrorAction SilentlyContinue + Remove-Item Env:JWT_SECRET -ErrorAction SilentlyContinue + Remove-Item Env:DEFAULT_ADMIN_EMAIL -ErrorAction SilentlyContinue + Remove-Item Env:DEFAULT_ADMIN_PASSWORD -ErrorAction SilentlyContinue Remove-Item $serverExePath -Force -ErrorAction SilentlyContinue Remove-Item $e2eRunRoot -Recurse -Force -ErrorAction SilentlyContinue } diff --git a/frontend/admin/src/components/common/ui-consistency.test.tsx b/frontend/admin/src/components/common/ui-consistency.test.tsx index fd88781..9c8520b 100644 --- a/frontend/admin/src/components/common/ui-consistency.test.tsx +++ b/frontend/admin/src/components/common/ui-consistency.test.tsx @@ -86,6 +86,10 @@ describe('PageHeader Component', () => { // ============================================================================= describe('Form Validation Consistency', () => { + beforeEach(() => { + vi.spyOn(window, 'alert').mockImplementation(() => {}) + }) + it('validates required fields', async () => { const user = userEvent.setup() const handleSubmit = vi.fn()