一键导入
tunit
Run TUnit tests with Playwright. Use when user asks to run tests, execute tests, or check if tests pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run TUnit tests with Playwright. Use when user asks to run tests, execute tests, or check if tests pass.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | tunit |
| description | Run TUnit tests with Playwright. Use when user asks to run tests, execute tests, or check if tests pass. |
This project uses TUnit with Playwright for testing. Tests are located in tests/SummitUI.Tests.Playwright/.
dotnet run --project tests/SummitUI.Tests.Playwright
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 8 parallel tests
dotnet run --project tests/SummitUI.Tests.Playwright -- --maximum-parallel-tests 8
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/*/*'
When a debugger is attached, Playwright will run in debug mode (PWDEBUG=1) automatically via the Hooks.cs setup.
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
The test project includes several features to reduce flakiness:
[Retry(2)] in GlobalSetup.cs)[assembly: NotInParallel] in GlobalSetup.csHooks.cs waits for the Blazor server to be fully ready before tests starttunit.json for longer test and hook timeoutsGlobalSetup.cs - Assembly-level test configuration (retries, parallelism)Hooks.cs - Test session setup/teardown (starts Blazor server)BlazorWebApplicationFactory.cs - WebApplicationFactory for hosting the test servertunit.json - TUnit configuration file*AccessibilityTests.cs - Accessibility test classes inheriting from PageTestTUnit.Playwright.PageTest to get Page access[Before(Test)] for per-test setup[Before(TestSession)] / [After(TestSession)] for session-wide setupHooks.ServerUrl