## Task 1: API Config - Update Config **Suite:** `Robot.Api.Config` **Test:** `Update Config` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/config Expected status: 422 != 200` **Instructions:** - Investigate the `PUT /api/config` endpoint in the FastAPI application. - The test sends a valid config update but receives HTTP 422 (Unprocessable Entity) instead of 200. - Check the Pydantic model used for config updates — a field may be missing, have the wrong type, or have an unexpected validator. - Compare the test payload in `tests/robot/api/config.robot` with the request model in the backend. - Fix either the API endpoint validation or the test payload so the update succeeds. --- ## Task 2: API Download - Remove Item From Queue **Suite:** `Robot.Api.Download` **Test:** `Remove Item From Queue` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/queue/item/%5B'3'%5D Expected status: 404 != 200` **Instructions:** - The queue item ID is being serialized as a Python list (`['3']`) in the URL, producing `%5B'3'%5D`. - Open `tests/robot/api/download.robot` and find the keyword that extracts the item ID from the queue response. - Ensure the item ID is extracted as a plain string or integer, not a list. - If the backend returns a list, update the test keyword to access the first element (`${item_id}[0]`). - Verify the corrected URL becomes `/api/queue/item/3`. --- ## Task 3: API Health - Detailed Health Check **Suite:** `Robot.Api.Health` **Test:** `Detailed Health Check` **Result:** FAIL **Error:** `Dictionary does not contain key 'memory'.` **Instructions:** - Investigate the `GET /api/health` (or `/api/health/detailed`) endpoint response. - The test expects a `memory` key in the JSON response, but it is missing. - Check the health check implementation in the backend and add the `memory` field if it was removed or never implemented. - Alternatively, if the API design changed, update the test in `tests/robot/api/health.robot` to match the new response structure. --- ## Task 4: API Logging - Get Logging Config **Suite:** `Robot.Api.Logging` **Test:** `Get Logging Config` **Result:** FAIL **Error:** `Dictionary does not contain key 'level'.` **Instructions:** - Investigate the `GET /api/logging/config` endpoint response. - The test expects a `level` key in the logging config JSON, but it is missing. - Check the logging config model/response in the backend and ensure `level` is included. - If the field was renamed (e.g., to `log_level`), update the test in `tests/robot/api/logging.robot` accordingly. --- ## Task 5: API Logging - Tail Log File **Suite:** `Robot.Api.Logging` **Test:** `Tail Log File` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/tail Expected status: 404 != 200` **Instructions:** - Investigate the log file tail endpoint (`GET /api/logging/files/{filename}/tail`). - The endpoint returns 404, meaning the file `aniworld.log` does not exist or the route is not registered. - Check if the log file has a different name (e.g., `app.log`, `server.log`) or if the endpoint path is different. - Update the test in `tests/robot/api/logging.robot` to use the correct filename or endpoint path. - If the endpoint is missing, implement it in the backend. --- ## Task 6: API Logging - Download Log File **Suite:** `Robot.Api.Logging` **Test:** `Download Log File` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/download Expected status: 404 != 200` **Instructions:** - Investigate the log file download endpoint (`GET /api/logging/files/{filename}/download`). - The endpoint returns 404 for `aniworld.log`. - Verify the correct log filename and endpoint path in the backend. - Update the test in `tests/robot/api/logging.robot` to use the correct filename or path. - If the endpoint is missing, implement it in the backend. --- ## Task 7: API NFO - Repair NFO For Series **Suite:** `Robot.Api.Nfo` **Test:** `Repair NFO For Series` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/nfo/attack-on-titan/repair Expected status: 400 != 200` **Instructions:** - Investigate the `POST /api/nfo/{series_id}/repair` endpoint. - The endpoint returns 400 (Bad Request) for the series `attack-on-titan`. - Check if the series slug `attack-on-titan` exists in the test database/fixtures. - Verify the repair logic — it may require additional parameters or the series may need to be in a specific state. - Update the test to use a valid series or fix the backend validation. --- ## Task 8: API Scheduler - Trigger Manual Rescan **Suite:** `Robot.Api.Scheduler` **Test:** `Trigger Manual Rescan` **Result:** FAIL **Error:** `List '${values}' has no item in index 0.` **Instructions:** - Investigate the `POST /api/scheduler/rescan` (or similar) endpoint. - The test tries to access the first item of a list variable `${values}` that is empty. - Check the response structure in `tests/robot/api/scheduler.robot`. - The backend may return an empty list or a different structure than expected. - Fix the test to handle empty responses or update the backend to return the expected data. --- ## Task 9: API Scheduler - Empty Schedule Days **Suite:** `Robot.Api.Scheduler` **Test:** `Empty Schedule Days` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` **Instructions:** - Investigate the `PUT /api/scheduler/config` endpoint when `schedule_days` is an empty list/array. - The test expects the backend to accept empty schedule days (HTTP 200), but it returns 422. - Check the Pydantic validator for `schedule_days` — it may require at least one day. - Decide whether empty schedule days should be allowed (update backend) or rejected (update test to expect 422). --- ## Task 10: API Setup - Resolve Folder With Provider Key **Suite:** `Robot.Api.Setup` **Test:** `Resolve Folder With Provider Key` **Result:** FAIL **Error:** `Url: http://127.0.0.1:8765/api/setup/unresolved/Unknown%20Anime%20(2020)/resolve Expected status: 400 != 200` **Instructions:** - Investigate the `POST /api/setup/unresolved/{folder_name}/resolve` endpoint. - The test tries to resolve `Unknown Anime (2020)` but gets 400. - Check if the folder exists in the unresolved folders list or if the provider key is missing/invalid. - Verify the request payload in `tests/robot/api/setup.robot` includes a valid `provider_key`. - Fix the test data or the backend validation logic. --- ## Task 11: API Websocket - Connect To WebSocket **Suite:** `Robot.Api.Websocket` **Test:** `Connect To WebSocket` **Result:** FAIL **Error:** `No keyword with name 'Connect To WebSocket' found.` **Instructions:** - The custom keyword library `tests/robot/resources/websocket_keywords.py` contains no keywords (warning was shown). - Open `tests/robot/resources/websocket_keywords.py` and implement the `Connect To WebSocket` keyword. - The keyword should establish a WebSocket connection to the server (e.g., `ws://127.0.0.1:8765/ws`). - Use a Python WebSocket client library (e.g., `websocket-client`) inside the keyword. - Ensure the library is properly exported so Robot Framework can discover it. --- ## Task 12: UI Anime Settings - Anime Settings Page Loads **Suite:** `Robot.Ui.Anime Settings` **Test:** `Anime Settings Page Loads` **Result:** FAIL **Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible — locator resolved to hidden ` **Instructions:** - The `#settings-section` element has the CSS class `hidden`, preventing it from becoming visible. - Investigate the anime settings page frontend code to understand how the settings section is shown/hidden. - The test may need to click a button or navigate differently to reveal the section. - Update the test in `tests/robot/ui/anime_settings.robot` to perform the correct navigation steps before waiting for `#settings-section`. - Alternatively, if the section should be visible by default, fix the frontend logic. --- ## Task 13: UI Anime Settings - Regenerate NFO **Suite:** `Robot.Ui.Anime Settings` **Test:** `Regenerate NFO` **Result:** FAIL **Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible — locator resolved to hidden ` **Instructions:** - Same root cause as Task 12: the `#settings-section` element remains hidden. - Fix the navigation/activation steps in `tests/robot/ui/anime_settings.robot` so the settings section is visible before interacting with it. - Ensure the test clicks the correct element to open/show the anime settings. --- ## Task 14: UI Anime Settings - Update Series Settings **Suite:** `Robot.Ui.Anime Settings` **Test:** `Update Series Settings` **Result:** FAIL **Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible — locator resolved to hidden ` **Instructions:** - Same root cause as Task 12 and 13: the `#settings-section` element remains hidden. - Fix the navigation/activation steps in `tests/robot/ui/anime_settings.robot` so the settings section is visible before interacting with it. - Ensure the test clicks the correct element to open/show the anime settings. --- ## Task 15: UI Dashboard - Download Selected **Suite:** `Robot.Ui.Dashboard` **Test:** `Download Selected` **Result:** FAIL **Error:** `'Mit Server verbunden' does not contain 'queue'` **Instructions:** - The test expects a toast/notification message containing the word `queue` after clicking "Download Selected". - Instead, the German message `Mit Server verbunden` (Connected to server) appears. - Check the dashboard frontend code for the download action toast message. - Either update the frontend to show an English message containing `queue`, or update the test in `tests/robot/ui/dashboard.robot` to match the actual German text. - Consider using a data-testid or a more stable assertion instead of toast text. --- ## Task 16: UI Login - Login Rate Limit UI **Suite:** `Robot.Ui.Login` **Test:** `Login Rate Limit UI` **Result:** FAIL **Error:** `'invalid credentials' does not contain 'lockout'` **Instructions:** - The test expects a lockout message containing `lockout` after multiple failed login attempts. - Instead, the message `invalid credentials` is shown. - Investigate the login rate-limiting logic in the backend and frontend. - Check if rate limiting is actually triggered (may require more attempts or a different timing). - Update the test in `tests/robot/ui/login.robot` to match the actual error message, or fix the rate-limiting display in the frontend. --- ## Task 17: UI Settings Modal - Close Settings Modal Via Overlay **Suite:** `Robot.Ui.Settings Modal` **Test:** `Close Settings Modal Via Overlay` **Result:** FAIL **Error:** `TimeoutError: locator.click: Timeout 10000ms exceeded. waiting for locator('id=config-modal .modal-overlay')` **Instructions:** - The test tries to click a `.modal-overlay` element inside `#config-modal`, but the element is not found. - Inspect the settings modal HTML structure in the frontend. - The overlay element may have a different class name (e.g., `.modal-backdrop`, `.overlay`) or may not exist as a separate element. - Update the locator in `tests/robot/ui/settings_modal.robot` to match the actual DOM structure. - If the overlay click-to-close behavior is missing, implement it in the frontend. --- ## Task 18: UI Settings Modal - Close Settings Modal Via Escape **Suite:** `Robot.Ui.Settings Modal` **Test:** `Close Settings Modal Via Escape` **Result:** FAIL **Error:** `TimeoutError: locator.waitFor: Timeout 3000ms exceeded. waiting for locator('id=config-modal') to be hidden — locator resolved to visible