Backend (pytest): - Auth flow tests (login, token, protected routes) - Portfolio CRUD and transaction tests - Strategy endpoint tests - Backtest flow tests - Snapshot and returns tests Frontend (Playwright): - Auth page tests - Portfolio navigation tests - Strategy page tests - Backtest page tests - Playwright configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
test.describe("Strategy", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
// Mock login
|
|
await page.addInitScript(() => {
|
|
localStorage.setItem("token", "test-token");
|
|
});
|
|
});
|
|
|
|
test("should show strategy list page", async ({ page }) => {
|
|
await page.goto("/strategy");
|
|
|
|
// Check page title
|
|
await expect(page.locator("h1")).toContainText("전략");
|
|
});
|
|
|
|
test("should show multi-factor strategy option", async ({ page }) => {
|
|
await page.goto("/strategy");
|
|
|
|
// Look for multi-factor strategy card or link
|
|
await expect(
|
|
page.locator('text=멀티 팩터, a[href*="multi-factor"]').first()
|
|
).toBeVisible();
|
|
});
|
|
|
|
test("should show quality strategy option", async ({ page }) => {
|
|
await page.goto("/strategy");
|
|
|
|
// Look for quality strategy card or link
|
|
await expect(
|
|
page.locator('text=퀄리티, a[href*="quality"]').first()
|
|
).toBeVisible();
|
|
});
|
|
|
|
test("should show value-momentum strategy option", async ({ page }) => {
|
|
await page.goto("/strategy");
|
|
|
|
// Look for value-momentum strategy card or link
|
|
await expect(
|
|
page.locator('text=밸류 모멘텀, a[href*="value-momentum"]').first()
|
|
).toBeVisible();
|
|
});
|
|
|
|
test("should navigate to multi-factor strategy page", async ({ page }) => {
|
|
await page.goto("/strategy/multi-factor");
|
|
|
|
// Check for form elements
|
|
await expect(page.locator("form, [role='form']").first()).toBeVisible();
|
|
});
|
|
|
|
test("should navigate to quality strategy page", async ({ page }) => {
|
|
await page.goto("/strategy/quality");
|
|
|
|
// Check for form elements
|
|
await expect(page.locator("form, [role='form']").first()).toBeVisible();
|
|
});
|
|
|
|
test("should navigate to value-momentum strategy page", async ({ page }) => {
|
|
await page.goto("/strategy/value-momentum");
|
|
|
|
// Check for form elements
|
|
await expect(page.locator("form, [role='form']").first()).toBeVisible();
|
|
});
|
|
});
|