Improve backtest lazy loading and test automation
This commit is contained in:
@@ -2,22 +2,24 @@ from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
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_overview_shows_ltv_history_and_exports_csv() -> None:
|
||||
def test_overview_shows_ltv_history_and_exports_csv(base_url: str) -> None:
|
||||
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)
|
||||
expect(page.locator("text=Create a private workspace URL").first).to_be_visible(timeout=15000)
|
||||
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)
|
||||
|
||||
expect(page.locator("text=Overview").first).to_be_visible(timeout=15000)
|
||||
expect(page.locator("text=Historical LTV").first).to_be_visible(timeout=15000)
|
||||
|
||||
Reference in New Issue
Block a user