feat(e2e): #147 group creation and bot invitation scenario

- Add GroupSetupScenario: create supergroup, invite GmRelay bot, send /start,
  wait for reply, then delete the group
- Extend TelegramUserClient with DeleteGroupAsync and channel cache
- Update Program.cs to run the scenario with cleanup in finally
- Update README status table and runner documentation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-16 12:17:58 +03:00
parent 4b0f328f2e
commit f4a61269c2
4 changed files with 106 additions and 15 deletions
+6 -3
View File
@@ -11,8 +11,8 @@ Tracked as a Gitea milestone: [E2E Automation](https://git.codeanddice.ru/toutsu
|-------|-------|--------|
| #144 | initData / Login Widget helper for mock Telegram auth | ✅ Done |
| #145 | Playwright tests for Blazor dashboard with mocked Telegram auth | ✅ Done |
| #146 | Telegram user client (MTProto) | 🚧 In progress |
| #147 | Automate group creation and bot invitation | ⏳ Planned |
| #146 | Telegram user client (MTProto) | ✅ Done |
| #147 | Automate group creation and bot invitation | 🚧 In progress |
| #148 | Scenario: /newsession from creation to publication | ⏳ Planned |
| #149 | Join/leave, waitlist, reschedule and notification scenarios | ⏳ Planned |
| #150 | Dashboard display and editing verification | ⏳ Planned |
@@ -36,6 +36,7 @@ tests/e2e/
├── GmRelay.E2E.Runner.csproj # C# console runner using WTelegramClient (MTProto)
├── Program.cs # Entry point for quick manual checks
├── TelegramUserClient.cs # Reusable MTProto user client wrapper
├── GroupSetupScenario.cs # Create group + invite bot + verify /start
├── RunnerConfig.cs # Configuration model
├── .env.example # Required environment variables
├── .gitignore # Ignore .env and session files
@@ -85,7 +86,7 @@ python tests/e2e/helpers/test_telegram_init_data.py
## Run the MTProto user client runner
The runner logs in to a real Telegram user account, creates a supergroup, and invites the test bot.
The runner logs in to a real Telegram user account, creates a supergroup, invites the test bot, sends `/start`, waits for a reply, and deletes the group.
1. Copy the example environment file and fill in real values:
```bash
@@ -115,6 +116,8 @@ The runner logs in to a real Telegram user account, creates a supergroup, and in
- Login as a Telegram user.
- Create a supergroup (`Channels_CreateChannel` with `megagroup: true`).
- Resolve a bot by username and invite it to the group.
- Send `/start` to the bot inside the group and wait for any reply.
- Delete the test supergroup after the scenario (cleanup).
- Send messages/commands and read recent messages.
- Wait for a bot reply.