Project templates
Precept also ships dotnet new templates so a suite starts with environment switching, precept.json
overlays and a first test already wired.
Install them from NuGet:
dotnet new install Precept.Templates
The same command installs a later version over an earlier one, so run it again to pick up templates from a new release.
Create a project:
# Plain C# tests + Precept.Web
dotnet new precept-web -n Checkout.Web.Tests
# Reqnroll feature tests + Precept.Web
dotnet new precept-web-reqnroll -n Checkout.Web.Reqnroll.Tests
Each template includes:
global.jsonset toMicrosoft.Testing.Platformfordotnet teston .NET 10. It is in the right place for a project that is a repository of its own. Inside a larger repository, move itstestsection into the rootglobal.json: the SDK reads the file from the directorydotnet testis run in, not from the project's, and a nested one also replaces the root's SDK pin for that subtree.precept.jsonwithEnvironment: localand web defaults: headless Chromium at a 1080p viewport.precept.staging.jsonas an overlay forstaging, reached with--precept-environment staging.- A starter test (plain or
.feature+ steps).
The templates leave build configurations alone — Debug and Release as the SDK defines them, and
nothing bound to PreceptEnvironment. How an environment is chosen is yours to decide; see
Environments for the ways, including a configuration per
environment.
Precept.Web uses Playwright, and installs the browser it is configured for the first time a launch
finds nothing to drive — see Browsers. To install it up front instead:
pwsh bin/Debug/net10.0/playwright.ps1 install chromium