.claude/skills/write-e2e-tests/SKILL.md
Use when writing or modifying end-to-end tests in the Alkaa project — triggers on tasks like "add an E2E test", "write a flow test", "test this feature end-to-end", "add a test to shared module", or "cover this user journey with a test".
npx skillsauth add igorescodro/alkaa write-e2e-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
E2E tests exercise full application flows through a real Koin DI graph and a live AlkaaMultiplatformApp Compose tree. They live in shared/src/commonTest/kotlin/com/escodro/alkaa/ — one file per feature domain (e.g., TaskFlowTest, CategoryFlowTest).
AlkaaTest(), KoinTest; @BeforeTest calls beforeTest() first, then cleans DAOs → see references/SETUP.md= uiTest { } for all tests; = flakyUiTest { } only for known timing-sensitive tests → see references/SETUP.md@BeforeTest using runTest → see references/SETUP.mdComposeUiTest extension functions using content descriptions → see references/SETUP.mdreferences/SETUP.mddeclare<T> { FakeImpl() } to override external dependencies → see references/SETUP.mdDescriptive, underscore-separated. Two styles:
when_no_query_then_all_tasks_are_visible()add_and_open_task(), complete_task_from_list()No camelCase, no backtick names.
| Rule | Details |
|------|---------|
| beforeTest() first | Call beforeTest() before any DAO injection or by inject() use |
| cleanTable() in @BeforeTest | Call on every DAO used to avoid state leakage between tests |
| DAO-based seeding | Insert test data directly via DAOs — not via use cases |
| Content descriptions for navigation | Navigate via content descriptions, not raw text |
| Resource strings | getString(Res.string.xyz) inside uiTest or runComposeUiTest — never hardcode |
| Fakes over mocks | Use declare<T> { FakeImpl() } for external dependencies |
| @AfterTest always | Always call afterTest() to stop Koin after each test |
| Mistake | Fix |
|---------|-----|
| Calling by inject() before beforeTest() | Always call beforeTest() first |
| Skipping cleanTable() | Call on every DAO to avoid state leakage |
| Using flakyUiTest by default | Reserve for tests with known timing sensitivity |
| Hardcoding UI strings | Use getString(...) inside uiTest or runComposeUiTest |
| Testing multiple flows in one test | One scenario per test |
| Missing @AfterTest / afterTest() | Always stop Koin after each test |
| Navigation via raw text | Navigate via content descriptions |
| Using mocks | Use fakes via declare<T> { FakeImpl() } |
development
A skill for reviewing Android code before it is pushed to production.
documentation
Use when writing a new ViewModel or modifying an existing one in the Alkaa project. Triggers on tasks like "add a ViewModel", "create VM for X screen", "implement state handling", or "connect use case to UI".
testing
Use when writing or modifying unit tests in the Alkaa project — triggers on tasks like "add a test", "write tests for X", "test this ViewModel", "cover this use case with tests", or "add unit test coverage".
testing
Use when writing or modifying UI/Compose instrumented tests in the Alkaa project — triggers on tasks like "add a UI test", "test this composable", "add instrumented test", "test this screen behavior".