40fc435bda
- Add DeleteSessionAsync to ISessionStore/SessionService (unpublish portfolio card, remove bot-created empty forum topic, update batch message). - Add DeleteSessionForCurrentUserAsync to AuthorizedSessionService with audit log. - Add delete button + confirmation dialog to GroupDetails.razor. - Extend dashboard Playwright tests with edit persistence and delete verification. - Update AuthorizedSessionServiceTests with delete authorization coverage. - Mark issue #150 as done in tests/e2e/README.md. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using dotenv.net;
|
|
using GmRelay.E2E.Runner;
|
|
|
|
DotEnv.Load(new DotEnvOptions(envFilePaths: [".env"], ignoreExceptions: false));
|
|
|
|
var config = new RunnerConfig
|
|
{
|
|
ApiId = int.Parse(Environment.GetEnvironmentVariable("api_id")!),
|
|
ApiHash = Environment.GetEnvironmentVariable("api_hash")!,
|
|
PhoneNumber = Environment.GetEnvironmentVariable("phone_number")!,
|
|
BotUsername = Environment.GetEnvironmentVariable("TELEGRAM_BOT_USERNAME")!,
|
|
BotToken = Environment.GetEnvironmentVariable("TELEGRAM_BOT_TOKEN")!,
|
|
DatabaseUrl = Environment.GetEnvironmentVariable("GMRELAY_E2E_DATABASE_URL")!,
|
|
};
|
|
|
|
using var client = new TelegramUserClient(config);
|
|
await client.ConnectAsync();
|
|
|
|
var setup = new GroupSetupScenario(client, config);
|
|
ScenarioResult? result = null;
|
|
|
|
try
|
|
{
|
|
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("Wizard scenario completed successfully.");
|
|
|
|
var lifecycle = new JoinLeaveWaitlistRescheduleScenario(client, config);
|
|
await lifecycle.RunAsync(result.Group);
|
|
Console.WriteLine("Lifecycle scenario completed successfully.");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Console.WriteLine($"Scenario failed: {ex.Message}");
|
|
throw;
|
|
}
|
|
finally
|
|
{
|
|
if (result is not null)
|
|
{
|
|
await setup.CleanupAsync(result);
|
|
}
|
|
|
|
await Task.Delay(TimeSpan.FromSeconds(2));
|
|
}
|