Improve backtest lazy loading and test automation

This commit is contained in:
Bu5hm4nn
2026-04-07 12:18:50 +02:00
parent ccc10923d9
commit b2bc4db41a
18 changed files with 504 additions and 300 deletions

View File

@@ -3,23 +3,25 @@ from __future__ import annotations
from pathlib import Path
from uuid import uuid4
import pytest
from playwright.sync_api import expect, sync_playwright
BASE_URL = "http://127.0.0.1:8100"
pytestmark = [pytest.mark.playwright, pytest.mark.e2e]
ARTIFACTS = Path("tests/artifacts")
ARTIFACTS.mkdir(parents=True, exist_ok=True)
def test_hedge_builder_saves_template_and_reuses_it_in_backtests() -> None:
def test_hedge_builder_saves_template_and_reuses_it_in_backtests(base_url: str) -> None:
template_name = f"Crash Guard 95 {uuid4().hex[:8]}"
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page(viewport={"width": 1440, "height": 1000})
page.goto(BASE_URL, wait_until="domcontentloaded", timeout=30000)
page.goto(base_url, wait_until="domcontentloaded", timeout=30000)
page.get_by_role("button", name="Get started").click()
page.wait_for_url(f"{BASE_URL}/*", timeout=15000)
page.wait_for_url(f"{base_url}/*", timeout=15000)
workspace_url = page.url
page.goto(f"{workspace_url}/hedge", wait_until="domcontentloaded", timeout=30000)