write-an-e2e-scenario

Write end-to-end test scenarios for a Telegram bot using a fake-chat harness.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/oleg-vasilyev/FoolProof --skill write-an-e2e-scenario-oleg-vasilyev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-an-e2e-scenario
Source: https://github.com/oleg-vasilyev/FoolProof/tree/main/.claude/skills/write-an-e2e-scenario
Command: npx skills add https://github.com/oleg-vasilyev/FoolProof --skill write-an-e2e-scenario-oleg-vasilyev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? End-to-end tests are the slowest and most expensive tests in a project, so writing unnecessary ones — or ones that assert nothing meaningful — wastes CI time while giving false confidence. This Skill guides you through deciding when an e2e scenario is actually owed, and how to write one that genuinely guards behavior rather than just confirming a message arrived. ## Core Features & Use Cases - Necessity gate: Decides whether a change earns an e2e scenario at all — only callback-keyboard dispatch, bugs that escaped unit tests, or extreme real-input cases qualify. - Scenario authoring rules: Enforces the describeScenario structure, chat-driving verbs (say, tap, replyToPrompt, tapRaw, restartBot), and assertion discipline (assert text before captions, capture button data from the hardest state, never import from src/). - Clean-ending enforcement: Ensures every scenario closes all keyboards the way a real evening ends, since leftover tappable screens corrupt later runs. - Use Case: After adding a new inline-keyboard feature to the bot, use this Skill to write a *.e2e.spec.ts that plays a full game against a real bot process and asserts what the scenario can actually see. ## Quick Start Write an e2e scenario for the new seating-order keyboard feature following the rules in this skill.

Frequently Asked Questions about write-an-e2e-scenario

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write an e2e test for a Telegram bot?▼

Use the describeScenario harness with chat verbs like say, tap, and replyToPrompt to drive a real bot process against a fake Telegram. Each describe block shares one chat with cases running in order, and every scenario must end with no keyboards left open.

When should I write an end-to-end test instead of a unit test?▼

Write an e2e scenario only for keyboards carrying callback_data, bugs that escaped unit tests, or extreme real-input cases like the fullest table. Anything a unit test can prove belongs in a unit test, since scenarios are the slowest tests in the suite.

Why does my e2e test pass while testing the wrong screen?▼

This happens when a scenario asserts only button captions, since a newly inserted screen often lists the same names. Assert the message text before the captions whenever a screen boundary is involved so the test fails if it starts watching a different message.

Can e2e scenarios import constants or types from the app source?▼

No, scenarios must never import anything from src/, including copy tables or types. Importing the copy table would assert a constant against itself, so all expected text must be written out in full using relative imports only.

What can an e2e scenario assert about generated images?▼

A scenario holds a rasterized PNG, so it can prove the picture arrives, its width, and that it fits Telegram's height limits. It cannot assert font sizes or truncated words — those belong in integration tests where the SVG is still a string.