mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 16:02:05 +00:00
Added docs/TEST_INVENTORY.md as a central index for all tests and runners. Created scripts/interactive_agent_tui_test.py for password-free TUI v2 exploratory testing. Integrated standalone permission tests into main suite and fixed TUI v2 parity regression tests broken by auto-selection removal. Updated AGENTS.md and CLAUDE.md with strategic plan references.
39 lines
2.0 KiB
Markdown
39 lines
2.0 KiB
Markdown
# Interactive Agent TUI Testing Protocol
|
|
|
|
This document defines how AI agents should perform exploratory and regression testing on the SeedPass TUI v2 using the `scripts/interactive_agent_tui_test.py` harness.
|
|
|
|
## 1. Overview
|
|
The testing harness uses **Dependency Injection** to replace the real SeedPass service layer with a `MockService`. This allows agents to:
|
|
1. **Bypass Encryption:** Test the UI without knowing passwords or seeds.
|
|
2. **Avoid Side Effects:** No changes are made to the real vault or filesystem.
|
|
3. **Simulate Edge Cases:** Mock specific failures (e.g., sync errors) to see how the UI recovers.
|
|
|
|
## 2. How to Run
|
|
Execute the harness using the project's virtual environment:
|
|
```bash
|
|
.venv/bin/python scripts/interactive_agent_tui_test.py
|
|
```
|
|
|
|
## 3. How to Extend
|
|
To add a new test case:
|
|
1. **Update the Mock:** If testing a new service method, add it to `AgentMockService`.
|
|
2. **Add a Step:** In `run_full_walkthrough`, use `app._run_palette_command("your-command")` or direct action calls (e.g., `app.action_toggle_archive()`).
|
|
3. **Verify State:** Use `pilot.pause()` to let the TUI update, then query widgets:
|
|
```python
|
|
status = str(app.query_one("#status").render())
|
|
assert "Expected" in status
|
|
```
|
|
|
|
## 4. Key Testing Areas
|
|
* **Palette Commands:** Ensure `_run_palette_command` correctly routes inputs to services.
|
|
* **Selection Persistence:** Verify that the "Selected Entry" remains correct after archiving or refreshing.
|
|
* **Layout Adaptability:** Test compact vs. comfortable density.
|
|
* **Reactive UI:** Verify that `_load_entries` is called automatically after mutations.
|
|
|
|
## 5. Agent Instructions for Future Runs
|
|
If you are an agent tasked with "looking for bugs":
|
|
1. **Run the script:** Confirm the baseline walkthrough passes.
|
|
2. **Introduce Chaos:** Modify the mock to throw exceptions randomly.
|
|
3. **Check Transitions:** Rapidly switch between entries and layouts.
|
|
4. **Document Failures:** If a widget isn't found or a status message is wrong, report the line number in `app.py`.
|