eventuras-testing
Running and managing tests in the Eventuras monorepo (xUnit backend tests, Playwright E2E tests, integration tests)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Running and managing tests in the Eventuras monorepo (xUnit backend tests, Playwright E2E tests, integration tests)
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | eventuras-testing |
| description | Running and managing tests in the Eventuras monorepo (xUnit backend tests, Playwright E2E tests, integration tests) |
| license | MIT |
This skill provides comprehensive testing capabilities for the Eventuras monorepo, covering backend xUnit tests, frontend Playwright E2E tests, and integration testing patterns.
cd apps/api
dotnet test
# Unit tests
dotnet test tests/Eventuras.UnitTests
# Integration tests
dotnet test tests/Eventuras.IntegrationTests
# Web API tests
dotnet test tests/Eventuras.WebApi.Tests
dotnet test --filter "FullyQualifiedName~Eventuras.WebApi.Tests.EventsControllerTests"
dotnet test --filter "FullyQualifiedName~Eventuras.WebApi.Tests.EventsControllerTests.GetEvents_ShouldReturnOk"
dotnet test --logger "console;verbosity=detailed"
dotnet test /p:CollectCoverage=true /p:CoverageReportsDirectory=./coverage
cd apps/web-e2e
pnpm test
cd apps/web-e2e
pnpm playwright test playwright-e2e/admin-events.spec.ts
cd apps/web-e2e
pnpm playwright test --ui
cd apps/web-e2e
pnpm playwright test --headed
cd apps/web-e2e
pnpm playwright test --project=chromium
pnpm playwright test --project=firefox
pnpm playwright test --project=webkit
cd apps/web-e2e
pnpm playwright show-report
Integration tests use a PostgreSQL database. Connection string:
Host=localhost;Port=5432;Database=eventuras_test;Username=postgres;Password=postgres
The database is automatically configured when running in GitHub Actions environment.
Backend integration tests use mock authentication:
// System admin
var client = _factory.CreateClient().AuthenticatedAsSystemAdmin();
// Specific user
var client = _factory.CreateClient().AuthenticatedAs(user.Entity);
// User with specific role
var client = _factory.CreateClient().AuthenticatedAs(admin.Entity, Roles.Admin);
// Generic role
var client = _factory.CreateClient().Authenticated(role: "Admin");
Frontend E2E tests use setup projects defined in playwright.config.ts:
admin.auth.setup.ts - Admin authenticationuser.auth.setup.ts - User authentication[Fact]
public async Task MethodName_Scenario_ExpectedBehavior()
{
// Arrange
var client = _factory.CreateClient().AuthenticatedAsSystemAdmin();
var eventData = new EventDto { /* ... */ };
// Act
var response = await client.PostAsync("/api/v3/events", eventData);
// Assert
response.StatusCode.Should().Be(HttpStatusCode.Created);
var result = await response.Content.ReadFromJsonAsync<EventDto>();
result.Should().NotBeNull();
}
test('should create new event', async ({ page }) => {
// Arrange
await page.goto('/admin/events');
// Act
await page.getByRole('button', { name: 'New Event' }).click();
await page.getByLabel('Title').fill('Test Event');
await page.getByRole('button', { name: 'Save' }).click();
// Assert
await expect(page.getByText('Event created successfully')).toBeVisible();
});
--logger "console;verbosity=detailed" for more information--ui mode for interactive debugging--headed mode to see browser actions--debug flag to pause execution# Run all tests (backend + frontend)
pnpm test
# Build and test web app
pnpm --filter @eventuras/web test
# Build and test API
cd apps/api && dotnet test
Tests run automatically in GitHub Actions: