From 30571d095706b91856cba4e4a5f997df3751e376 Mon Sep 17 00:00:00 2001 From: d-claro Date: Tue, 7 Jul 2026 09:27:45 +0100 Subject: [PATCH] feat: add interactive menu with navigation --- README.md | 21 +++++++- agent/menu.py | 65 +++++++++++++++++++++++ knowledge_base/history.json | 6 +++ knowledge_base/test_cases/test_cases.json | 15 ++++++ 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 agent/menu.py diff --git a/README.md b/README.md index 5218377..3e5bb8a 100644 --- a/README.md +++ b/README.md @@ -99,4 +99,23 @@ Generates file: `knowledge_base/history.md` - Always activate the virtual environment before using the tool: `source venv/bin/activate` - Never delete a test case β€” change the state to `Blocked` if no longer applicable - Update `roadmap.md` whenever a step is completed -- The `venv/` folder should not be shared or pushed to Git \ No newline at end of file +- The `venv/` folder should not be shared or pushed to Git + +## Interactive Menu + +Instead of typing commands manually, you can use the interactive menu: + +```bash +python agent/menu.py +``` + +Navigate with the arrow keys and press Enter to select an option. Available options: + +- πŸ“‹ **View Test Cases** β€” lists all test cases +- βž• **Create Test Case** β€” adds a new test case interactively +- πŸ—ΊοΈ **View Roadmap** β€” shows the team roadmap +- πŸ“œ **View History** β€” shows the change history +- πŸ“€ **Export History** β€” exports change history to Markdown +- πŸ“€ **Export Test Cases History** β€” exports test cases history to Markdown +- πŸ€– **Ask AI** β€” asks a question to the AI agent +- ❌ **Exit** β€” exits the menu \ No newline at end of file diff --git a/agent/menu.py b/agent/menu.py new file mode 100644 index 0000000..6aa4c6b --- /dev/null +++ b/agent/menu.py @@ -0,0 +1,65 @@ +import questionary +import subprocess +import sys + +def run_command(command): + """Runs a CLI command.""" + subprocess.run([sys.executable, "agent/cli.py"] + command) + +def wait_for_menu(): + """Waits for the user to press Enter before returning to the menu.""" + input("\nPress Enter to return to the menu...") + +def main(): + while True: + print("\nπŸ€– QA Agent\n") + + choice = questionary.select( + "What would you like to do?", + choices=[ + "πŸ“‹ View Test Cases", + "βž• Create Test Case", + "πŸ—ΊοΈ View Roadmap", + "πŸ“œ View History", + "πŸ“€ Export History", + "πŸ“€ Export Test Cases History", + "πŸ€– Ask AI", + "❌ Exit" + ] + ).ask() + + if choice == "πŸ“‹ View Test Cases": + run_command(["list-tests"]) + wait_for_menu() + + elif choice == "βž• Create Test Case": + run_command(["add-test"]) + wait_for_menu() + + elif choice == "πŸ—ΊοΈ View Roadmap": + run_command(["roadmap"]) + wait_for_menu() + + elif choice == "πŸ“œ View History": + run_command(["history"]) + wait_for_menu() + + elif choice == "πŸ“€ Export History": + run_command(["export-history"]) + wait_for_menu() + + elif choice == "πŸ“€ Export Test Cases History": + run_command(["export-tests-history"]) + wait_for_menu() + + elif choice == "πŸ€– Ask AI": + question = questionary.text("What would you like to ask?").ask() + run_command(["ask", question]) + wait_for_menu() + + elif choice == "❌ Exit": + print("\nπŸ‘‹ Goodbye!\n") + break + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/knowledge_base/history.json b/knowledge_base/history.json index 8312700..e6e176a 100644 --- a/knowledge_base/history.json +++ b/knowledge_base/history.json @@ -5,6 +5,12 @@ "type": "state_change", "test_id": "TC-002", "details": "Active β†’ Passed" + }, + { + "timestamp": "2026-07-06 11:54", + "type": "test_created", + "test_id": "TC-005", + "details": "Test case 'This is a test' created" } ] } \ No newline at end of file diff --git a/knowledge_base/test_cases/test_cases.json b/knowledge_base/test_cases/test_cases.json index 81a0270..dd0fb55 100644 --- a/knowledge_base/test_cases/test_cases.json +++ b/knowledge_base/test_cases/test_cases.json @@ -51,6 +51,21 @@ "expected": "Error message is displayed" } ] + }, + { + "id": "TC-005", + "work_item_type": "Test Case", + "title": "This is a test", + "area_path": "Test area", + "assigned_to": "Diogo", + "state": "Active", + "steps": [ + { + "step": 1, + "action": "Just a tes", + "expected": "this works" + } + ] } ] } \ No newline at end of file