From 2e6db754722ebbb4ba6d0895c3f80f3c5d967ab5 Mon Sep 17 00:00:00 2001 From: Zhi Date: Fri, 13 Mar 2026 19:26:01 +0000 Subject: [PATCH] fix test to use axios for API calls --- tests/wizard.spec.ts | 46 ++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/tests/wizard.spec.ts b/tests/wizard.spec.ts index 89adc96..5ac00f7 100644 --- a/tests/wizard.spec.ts +++ b/tests/wizard.spec.ts @@ -1,40 +1,36 @@ import { test, expect } from '@playwright/test'; +import axios from 'axios'; const FRONTEND_URL = process.env.FRONTEND_URL || 'http://frontend:3000'; const BACKEND_URL = process.env.BACKEND_URL || 'http://backend:8000'; const WIZARD_URL = process.env.WIZARD_URL || 'http://wizard:8080'; test.describe('Setup Wizard', () => { - test('complete wizard flow', async ({ request }) => { + test('complete wizard flow', async ({ page }) => { // First configure wizard via API - await request.put(`${WIZARD_URL}/api/v1/config/harborforge.json`, { - data: { - initialized: true, - admin: { - username: "admin", - password: "admin123", - email: "admin@test.com", - full_name: "Admin" - }, - database: { - host: "mysql", - port: 3306, - user: "harborforge", - password: "harborforge_pass", - database: "harborforge" - }, - backend_url: BACKEND_URL, - default_project: { - name: "TestProject", - description: "Test project" - } + await axios.put(`${WIZARD_URL}/api/v1/config/harborforge.json`, { + initialized: true, + admin: { + username: "admin", + password: "admin123", + email: "admin@test.com", + full_name: "Admin" + }, + database: { + host: "mysql", + port: 3306, + user: "harborforge", + password: "harborforge_pass", + database: "harborforge" + }, + backend_url: BACKEND_URL, + default_project: { + name: "TestProject", + description: "Test project" } }); // Now test the wizard flow in browser - const page = await request.context().newPage(); - - // Go to frontend which should redirect to wizard await page.goto(FRONTEND_URL); // Step 0: Welcome - Click "Connect to Wizard"