Writes ABP MVC/Razor integration tests using AbpWebApplicationFactoryIntegratedTest. Drives real HTTP against the app, supports auth faking and 302 checking.
Ships in abp-testing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ABP's Volo.Abp.AspNetCore.TestBase boots the real web app in-process so you can request pages/endpoints over HTTP and assert on the response. This is the ASP.NET Core web counterpart to the application-layer *TestBase chain.
Subclass AbpWebApplicationFactoryIntegratedTest<TProgram> where TProgram is the SUT's Program entry-point class, not an ABP module. It gives you Client (an HttpClient with AllowAutoRedirect = false, so an unauthenticated request returns a 302, not the login page body), plus GetService<T> / GetRequiredService<T> / GetUrl<TController>().
The GetResponseAs* helpers the ABP docs show are not in the package — each solution copies them into its own *WebTestBase (they use Shouldly). Put them there:
using System.Net;
using System.Text.Json;
using Shouldly;
using Volo.Abp.AspNetCore.TestBase;
using MyCompanyName.MyProjectName.Web; // the SUT's Program lives here
public abstract class MyProjectNameWebTestBase
: AbpWebApplicationFactoryIntegratedTest<Program>
{
protected virtual async Task<string> GetResponseAsStringAsync(
string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
var response = await Client.GetAsync(url);
response.StatusCode.ShouldBe(expectedStatusCode);
return await response.Content.ReadAsStringAsync();
}
protected virtual async Task<T?> GetResponseAsObjectAsync<T>(
string url, HttpStatusCode expectedStatusCode = HttpStatusCode.OK)
{
var str = await GetResponseAsStringAsync(url, expectedStatusCode);
return JsonSerializer.Deserialize<T>(str, new JsonSerializerOptions(JsonSerializerDefaults.Web));
}
}
A test then just requests a URL:
public class Index_Tests : MyProjectNameWebTestBase
{
[Fact]
public async Task Welcome_Page()
{
var html = await GetResponseAsStringAsync("/");
html.ShouldContain("Welcome");
}
}
The web-test startup module depends on AbpAspNetCoreTestBaseModule and the SUT's *WebModule, and does two load-bearing things in PreConfigureServices: register a CompiledRazorAssemblyPart for the Web assembly (without it the compiled Razor pages 404), and turn on the OpenIddict development certificate.
[DependsOn(
typeof(AbpAspNetCoreTestBaseModule),
typeof(MyProjectNameWebModule),
typeof(MyProjectNameApplicationTestModule),
typeof(MyProjectNameEntityFrameworkCoreTestModule)
)]
public class MyProjectNameWebTestModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.PreConfigure<IMvcBuilder>(b =>
b.PartManager.ApplicationParts.Add(
new CompiledRazorAssemblyPart(typeof(MyProjectNameWebModule).Assembly)));
context.Services.GetPreConfigureActions<OpenIddictServerBuilder>().Clear();
PreConfigure<AbpOpenIddictAspNetCoreOptions>(o =>
o.AddDevelopmentEncryptionAndSigningCertificate = true);
}
}
There is no built-in always-allow for web tests, and the FakeAuthentication scheme + FakeUserClaims bag live in ABP's own test project — not in any NuGet package. Copy that pattern: register AddAuthentication(...).AddFakeAuthentication() in the test module, then per test resolve FakeUserClaims and push a claim before the request:
var fakeClaims = GetRequiredService<FakeUserClaims>();
fakeClaims.Claims.Add(new Claim(AbpClaimTypes.UserId, userId.ToString()));
var page = await GetResponseAsStringAsync("/Identity/Users"); // now authenticated
With no claim pushed the request is anonymous, so a protected page returns 302 (remember AllowAutoRedirect = false).
/ and assert 200 + expected markup.302; push an AbpClaimTypes.UserId claim and assert 200.AbpWebApplicationFactoryIntegratedTest<Program> — the SUT entry-point class, not the ABP module.GetResponseAs* from the package. They aren't shipped; copy them into your *WebTestBase.Client has AllowAutoRedirect = false, so you get a 302 — assert the status, not page content.CompiledRazorAssemblyPart registration for the Web assembly.FakeAuthentication scheme + FakeUserClaims pattern; it isn't in a NuGet package.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
abp, mvc-testing, razor-pages, integration-testing, aspnet-core-testing
/abp-testing:test-mvc-razor-uifrom abp-testing
npx claudepluginhub abpframework/abp-skills --plugin abp-testing3 skills in this plugin
/test-abp-applicationsWrite or fix integration tests for an ABP application against the generated *TestBase — resolving services, controlling the unit of work, seeding data, faking the current user/tenant, exercising the real `[Authorize]` pipeline, and proving transaction rollback across EF Core and MongoDB. USE FOR: the `AbpIntegratedTest`/`*TestBase` chain, per-provider test classes, `GetRequiredService`, `WithUnitOfWorkAsync`/`IUnitOfWorkManager.Begin`, `*TestDataSeedContributor`, `ICurrentPrincipalAccessor.Change`, undoing `AddAlwaysAllowAuthorization` (DENY) / `AddAlwaysDisableUnitOfWorkTransaction` (EF rollback), `ICurrentTenant.Change`, SQLite/MongoSandbox differences. DO NOT USE FOR: production unit-of-work config (use manage-units-of-work); production data seeding (use seed-application-data); production multi-tenant setup (use configure-multi-tenancy); production permission definitions (use permissions-and-authorization); Angular component tests (use test-angular-ui); MVC/Razor page tests (use test-mvc-razor-ui).
/test-angular-uiWrite ABP Angular component/service unit tests using ABP's testing modules on the app's Vitest or Jest stack. USE FOR: CoreTestingModule.withConfig from @abp/ng.core/testing, ThemeSharedTestingModule.withConfig from @abp/ng.theme.shared/testing, ThemeBasicTestingModule.withConfig (takes no args) when the app uses theme.basic, the clearPage and wait helpers for body-level UI (modals, toasts, confirmation dialogs) jsdom doesn't tear down, TestBed.configureTestingModule with a standalone component placed in imports, mocking AuthService and other providers, and picking the runner per the target project (current template = Vitest; some packages still use Jest). DO NOT USE FOR: server-side/integration tests through the AbpIntegratedTest/*TestBase chain (test-abp-applications); MVC/Razor page or HTTP integration tests (test-mvc-razor-ui); building the components under test (build-angular-lists-and-forms, extend-angular-module-ui, angular-ui).
Other plugins' skills for the same job