Dariten
A web test of Dariten, a public personal finance demo. Each browser keeps its own sample household, so the tests only read the app and never check specific balances.
- Source:
samples/E2E.Sample(NUnit) andsamples/E2E.XUnit.V3.Sample(xUnit v3). - Platform: web,
WebEngine.
The tests
Section titled “The tests”The_dashboard_links_to_the_transaction_register uses locators only and needs no model:
await App.OpenAsync("/");await Expect.That(Screen.GetByRole("heading", "Dashboard")).ToBeVisibleAsync();await Expect.That(Screen.GetByTestId("demo-banner")).ToContainTextAsync("Local demo");
await Screen.GetByRole("link", "Transactions").ClickAsync();await Expect.That(Screen.GetByRole("heading", "Transactions")).ToBeVisibleAsync();An_agent_filters_the_register_by_category hands the goal to the agent, then judges the result. It is in the RealModel category:
await App.OpenAsync("/transactions");await Agent.ActAsync("filter the register to show only the Groceries category");await Agent.AssertAsync("every transaction listed is in the Groceries category, or the register says no transactions match");await Expect.That(Screen.GetByRole("heading", "Transactions")).ToBeVisibleAsync();Run it
Section titled “Run it”dotnet test --project samples/E2E.Sample # NUnitdotnet test --project samples/E2E.XUnit.V3.Sample # xUnit v3dotnet test --project samples/E2E.Sample --filter "TestCategory!=RealModel" # no modelE2E_HEADLESS=0 dotnet test --project samples/E2E.Sample # watch the browserThe config’s agents.default.context tells the agent this browser keeps its own sample household, and that it must not enter real bank data or add, edit, or delete data. Use that pattern when a test must not mutate the app’s stored data.
To use an API key, change agents.default in e2e.config.json, for example to "provider": "openai", "model": "gpt-4.1-mini" with OPENAI_API_KEY set.