feat(e2e): #148 /newsession scenario from creation to publication

- Add NewSessionScenario that walks the Telegram wizard:
  single game, title, skip description/cover, D&D 5e, 4h, datetime,
  capacity, online format, join link, public visibility, publish, confirm
- Add ClickInlineButtonAsync / ClickInlineButtonByTextAsync to TelegramUserClient
- Add local WizardCallback/Step constants mirroring GmRelay.Shared wizard wire format
- Program.cs now runs full flow: group setup + /newsession + cleanup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 12:22:10 +03:00
parent f4a61269c2
commit 892f39401c
4 changed files with 231 additions and 5 deletions
+13 -5
View File
@@ -15,13 +15,22 @@ var config = new RunnerConfig
using var client = new TelegramUserClient(config);
await client.ConnectAsync();
var scenario = new GroupSetupScenario(client, config);
var setup = new GroupSetupScenario(client, config);
ScenarioResult? result = null;
try
{
result = await scenario.RunAsync();
Console.WriteLine("Scenario completed successfully.");
result = await setup.RunAsync();
var newSession = new NewSessionScenario(client, config);
var inputs = new NewSessionInputs(
Title: "E2E One-Shot Adventure",
ScheduledAtMoscow: DateTime.UtcNow.AddDays(7).AddHours(3).ToString("dd.MM.yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture),
MaxPlayers: 5,
JoinLink: "https://example.com/join-e2e");
await newSession.RunAsync(result.Group, inputs);
Console.WriteLine("Full scenario completed successfully.");
}
catch (Exception ex)
{
@@ -32,9 +41,8 @@ finally
{
if (result is not null)
{
await scenario.CleanupAsync(result);
await setup.CleanupAsync(result);
}
// Keep the session file written to disk.
await Task.Delay(TimeSpan.FromSeconds(2));
}