Overview
editMeziantou.AspNetCore.Testing runs your tests in a browser engine written in .NET (Meziantou.Framework.WebPlatform): the pages have a real DOM, the CSS applies, the layout computes the boxes, the scripts run, and the input of the tests goes through the hit testing of the page, as the input of a user does.
dotnet package add Meziantou.AspNetCore.TestingThe package tests two things:
| You test | Use | Page |
|---|---|---|
| A Blazor component alone, with fake services | ComponentTestHost | Blazor components |
| The pages of an application (MVC, Razor Pages, Blazor, minimal APIs...), in memory or on a server | WebAppBrowser | Web applications, Blazor applications |
Both pages are a TestPage: they share the locators and the assertions (find the elements by role, label or text as Playwright does, wait until they are actionable, retry the assertions), the user input and the snapshots.