Path: redb-identity/tests/redb.Identity.Tests/FullStack/FullStackBrowserFlowTests.cs
Snapshot: redb-identity, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-identity
Page: https://redbase.app/src/dev-2026-12-06/redb-identity/tests/redb.Identity.Tests/FullStack/FullStackBrowserFlowTests.cs
----
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using AwesomeAssertions;
using redb.Identity.Tests.Infrastructure;
using Xunit;
namespace redb.Identity.Tests.FullStack;
///
/// Full-stack E2E tests for the interactive browser-based flows:
/// login → authorize → (consent) → callback, and logout.
/// Uses real HTTP with cookie handling to simulate browser behavior.
///
[Collection("ProductionHttp")]
public class FullStackBrowserFlowTests
{
private readonly ProductionHttpFixture _fx;
public FullStackBrowserFlowTests(ProductionHttpFixture fx)
{
_fx = fx;
}
// ══════════════════════════════════════════════
// Login page
// ══════════════════════════════════════════════
[Fact]
public async Task LoginPage_Get_RendersForm()
{
using var client = CreateBrowserClient();
var resp = await client.GetAsync("/login");
resp.StatusCode.Should().Be(HttpStatusCode.OK);
var body = await resp.Content.ReadAsStringAsync();
body.Should().Contain("username", "login page must have a username field");
body.Should().Contain("password", "login page must have a password field");
body.Should().Contain("