Marketplace tunit
Run TUnit tests with Playwright. Use when user asks to run tests, execute tests, or check if tests pass.
install
source · Clone the upstream repo
git clone https://github.com/aiskillstore/marketplace
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/aiskillstore/marketplace "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/andrehogberg/tunit" ~/.claude/skills/aiskillstore-marketplace-tunit && rm -rf "$T"
manifest:
skills/andrehogberg/tunit/SKILL.mdsource content
Running TUnit Tests
This project uses TUnit with Playwright for testing. Tests are located in
tests/SummitUI.Tests.Playwright/.
Run All Tests
dotnet run --project tests/SummitUI.Tests.Playwright
Run Tests with Limited Parallelism (Recommended)
To prevent system overload when running Playwright tests, limit parallel test execution:
# Run with maximum 1 parallel test (sequential) dotnet run --project tests/SummitUI.Tests.Playwright -- --maximum-parallel-tests 1 # Run with maximum 2 parallel tests dotnet run --project tests/SummitUI.Tests.Playwright -- --maximum-parallel-tests 2
Run Tests with Filters
TUnit uses
--treenode-filter with path pattern: /assembly/namespace/class/test
Filter by class name:
dotnet run --project SummitUI.Tests.Playwright -- --treenode-filter '/*/*/ClassName/*'
Filter by exact test name:
dotnet run --project SummitUI.Tests.Playwright -- --treenode-filter '/*/*/*/TestName'
Examples:
# Run all Select accessibility tests dotnet run --project tests/SummitUI.Tests.Playwright -- --treenode-filter '/*/*/SelectAccessibilityTests/*' # Run specific test by name dotnet run --project tests/SummitUI.Tests.Playwright -- --treenode-filter '/*/*/*/Trigger_ShouldHave_RoleCombobox' # Run tests matching pattern (wildcard in test name) dotnet run --project tests/SummitUI.Tests.Playwright -- --treenode-filter '/*/*/*/Keyboard*' # Run all tests in namespace dotnet run --project tests/SummitUI.Tests.Playwright -- --treenode-filter '/*/SummitUI.Tests.Playwright/*/*'
Run Tests in Debug Mode
When a debugger is attached, Playwright will run in debug mode (
PWDEBUG=1) automatically via the Hooks.cs setup.
View Test Output
Add
--report flags for different output formats:
# Console output with details dotnet run --project tests/SummitUI.Tests.Playwright -- --output-format console-detailed # Generate TRX report dotnet run --project tests/SummitUI.Tests.Playwright -- --report-trx
Flakiness Mitigation
The test project includes several features to reduce flakiness:
- Automatic Retries: Tests are automatically retried up to 2 times on failure (
in GlobalSetup.cs)[Retry(2)] - Fully Sequential Execution: All tests run sequentially via
in GlobalSetup.cs[assembly: NotInParallel] - Server Readiness Check:
waits for the Blazor server to be fully ready before tests startHooks.cs - Extended Timeouts: Configured via
for longer test and hook timeoutstunit.json
Project Structure
- Assembly-level test configuration (retries, parallelism)GlobalSetup.cs
- Test session setup/teardown (starts Blazor server)Hooks.cs
- WebApplicationFactory for hosting the test serverBlazorWebApplicationFactory.cs
- TUnit configuration filetunit.json
- Accessibility test classes inheriting from*AccessibilityTests.csPageTest
Test Conventions
- Tests inherit from
to getTUnit.Playwright.PageTest
accessPage - Use
for per-test setup[Before(Test)] - Use
/[Before(TestSession)]
for session-wide setup[After(TestSession)] - Access the running server via
Hooks.ServerUrl