diff --git a/src/dotnet/QuantEngine.Web/wwwroot/login.html b/src/dotnet/QuantEngine.Web/wwwroot/login.html new file mode 100644 index 0000000..2719551 --- /dev/null +++ b/src/dotnet/QuantEngine.Web/wwwroot/login.html @@ -0,0 +1,326 @@ + + + + + + 로그인 - QuantEngine + + + +
+
+ +

QuantEngine

+ +
+ +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ + + + diff --git a/test-results/login-html-actual.png b/test-results/login-html-actual.png new file mode 100644 index 0000000..b4791dd Binary files /dev/null and b/test-results/login-html-actual.png differ diff --git a/tests/e2e/test-static-login.spec.ts b/tests/e2e/test-static-login.spec.ts new file mode 100644 index 0000000..70235af --- /dev/null +++ b/tests/e2e/test-static-login.spec.ts @@ -0,0 +1,51 @@ +import { test, expect } from '@playwright/test'; + +test('정적 login.html 검증', async ({ page }) => { + console.log('\n🧪 /login.html 접속\n'); + + const response = await page.goto('http://localhost:5265/login.html', { waitUntil: 'load' }); + + console.log(`📍 URL: ${page.url()}`); + console.log(`📊 상태: ${response?.status()}`); + console.log(`📄 제목: ${await page.title()}`); + + // 로그인 폼 확인 + const form = await page.locator('#loginForm').isVisible(); + console.log(`📋 로그인 폼: ${form ? '✅' : '❌'}`); + + // 입력 필드 확인 + const username = await page.locator('#username').isVisible(); + const password = await page.locator('#password').isVisible(); + console.log(`🔐 입력 필드 (아이디/비밀번호): ${username && password ? '✅' : '❌'}`); + + // 제출 버튼 확인 + const button = await page.locator('#loginBtn').isVisible(); + console.log(`🔘 제출 버튼: ${button ? '✅' : '❌'}`); + + // 텍스트 확인 + const text = await page.textContent('body'); + console.log(`📝 "QuantEngine": ${text?.includes('QuantEngine') ? '✅' : '❌'}`); + console.log(`📝 "로그인": ${text?.includes('로그인') ? '✅' : '❌'}`); + + // 로그인 테스트 + console.log('\n🔐 로그인 시도...\n'); + + await page.fill('#username', 'admin'); + await page.fill('#password', 'admin'); + await page.click('#loginBtn'); + + // 응답 대기 + await page.waitForTimeout(3000); + + console.log(`📍 최종 URL: ${page.url()}`); + console.log(`📄 최종 제목: ${await page.title()}`); + + // 홈페이지 확인 + if (page.url().includes('/') && !page.url().includes('login')) { + console.log('✅ 로그인 성공! 홈페이지로 이동'); + } + + // 스크린샷 + await page.screenshot({ path: 'test-results/login-html-actual.png', fullPage: true }); + console.log('\n📸 스크린샷: test-results/login-html-actual.png\n'); +}); diff --git a/tests/e2e/verify-login-page.spec.ts b/tests/e2e/verify-login-page.spec.ts new file mode 100644 index 0000000..ae575da --- /dev/null +++ b/tests/e2e/verify-login-page.spec.ts @@ -0,0 +1,58 @@ +import { test, expect } from '@playwright/test'; + +test('직접 로그인 페이지 검증 - /Account/Login', async ({ page }) => { + console.log('\n🧪 직접 /Account/Login 접속 테스트\n'); + + try { + const response = await page.goto('http://localhost:5265/Account/Login', { + waitUntil: 'networkidle', + timeout: 10000 + }); + + console.log(`📍 최종 URL: ${page.url()}`); + console.log(`📊 상태 코드: ${response?.status()}`); + console.log(`📄 제목: ${await page.title()}`); + + // 실제 콘텐츠 확인 + const bodyText = await page.content(); + + if (bodyText.includes('Not Found')) { + console.log('❌ "Not Found" 발견됨'); + } + if (bodyText.includes('로그인')) { + console.log('✅ "로그인" 텍스트 발견'); + } + if (bodyText.includes('QuantEngine')) { + console.log('✅ "QuantEngine" 텍스트 발견'); + } + if (bodyText.includes('아이디')) { + console.log('✅ 입력 필드 발견'); + } + + // 로그인 폼 존재 확인 + const form = await page.locator('form').first(); + const formExists = await form.isVisible().catch(() => false); + console.log(`📋 로그인 폼 존재: ${formExists ? '✅' : '❌'}`); + + // 입력 필드 확인 + const usernameInput = await page.locator('input[name="username"]').first(); + const usernameExists = await usernameInput.isVisible().catch(() => false); + console.log(`🔐 아이디 입력 필드: ${usernameExists ? '✅' : '❌'}`); + + const passwordInput = await page.locator('input[name="password"]').first(); + const passwordExists = await passwordInput.isVisible().catch(() => false); + console.log(`🔐 비밀번호 입력 필드: ${passwordExists ? '✅' : '❌'}`); + + // 제출 버튼 확인 + const submitButton = await page.locator('button[type="submit"]').first(); + const submitExists = await submitButton.isVisible().catch(() => false); + console.log(`🔘 제출 버튼: ${submitExists ? '✅' : '❌'}`); + + // 스크린샷 + await page.screenshot({ path: 'test-results/login-page-actual.png', fullPage: true }); + console.log('📸 스크린샷 저장: test-results/login-page-actual.png'); + + } catch (error) { + console.log(`❌ 오류: ${error}`); + } +});