## Task 8: Download Log File — Endpoint should exist and return log file **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/download Expected status: 404 != 200` **Instructions:** The `Download Log File` API test expects a `200 OK` from `/api/logging/files/{filename}/download`, but gets `404 Not Found`. The endpoint does not exist or the route is incorrect. Implement or fix the route so it accepts a filename parameter and returns the log file as a binary download. --- ## Task 9: Cleanup Old Logs — Should accept cleanup request **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/cleanup Expected status: 422 != 200` **Instructions:** The `Cleanup Old Logs` API test expects a `200 OK` from `/api/logging/cleanup`, but gets `422 Unprocessable Entity`. Review the endpoint. The request body may be failing validation, or the endpoint may require parameters that the test does not provide. Ensure the endpoint accepts the cleanup request and returns 200 on success. --- ## Task 10: Repair NFO For Series — Should accept repair request **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/nfo/attack-on-titan/repair Expected status: 400 != 200` **Instructions:** The `Repair NFO For Series` API test expects a `200 OK` from `/api/nfo/{series}/repair`, but gets `400 Bad Request`. Review the endpoint. The request may be missing required fields, or the series identifier may not be found. Ensure the endpoint accepts a valid series name and triggers NFO repair, returning 200 on success. --- ## Task 11: Run NFO Scan — Endpoint should exist **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/nfo/scan Expected status: 404 != 200` **Instructions:** The `Run NFO Scan` API test expects a `200 OK` from `/api/nfo/scan`, but gets `404 Not Found`. The endpoint does not exist or the route is incorrect. Implement or fix the route so it triggers an NFO scan across all series and returns 200. --- ## Task 12: Update Scheduler Config — Should accept valid scheduler updates **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` **Instructions:** The `Update Scheduler Config` API test expects a `200 OK` when updating scheduler settings, but gets `422 Unprocessable Entity`. Review the `/api/scheduler/config` endpoint validation. The payload is likely being rejected by Pydantic or manual validation. Check which field is triggering the 422 and correct the validation logic. --- ## Task 13: Trigger Manual Rescan — Should trigger rescan successfully **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/trigger-rescan Expected status: 500 != 200` **Instructions:** The `Trigger Manual Rescan` API test expects a `200 OK` from `/api/scheduler/trigger-rescan`, but gets `500 Internal Server Error`. Review the endpoint implementation. There is likely an unhandled exception when triggering the rescan. Add proper error handling and ensure the rescan can be triggered successfully. --- ## Task 14: Invalid Schedule Time — Should reject malformed schedule_time with 422 **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` **Instructions:** The `Invalid Schedule Time` API test sends a malformed `schedule_time` and expects a `422 Unprocessable Entity`, but the server returns `200 OK`. Review the scheduler config validation. The endpoint should reject malformed schedule times (e.g., invalid format, out-of-range values) and return 422. --- ## Task 15: Invalid Schedule Days — Should reject invalid day abbreviations with 422 **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` **Instructions:** The `Invalid Schedule Days` API test sends invalid day abbreviations and expects a `422 Unprocessable Entity`, but the server returns `200 OK`. Review the scheduler config validation for `schedule_days`. The endpoint should reject invalid day values and return 422. --- ## Task 16: Empty Schedule Days — Should reject empty schedule_days with 422 **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/scheduler/config Expected status: 422 != 200` **Instructions:** The `Empty Schedule Days` API test sends an empty `schedule_days` value and expects a `422 Unprocessable Entity`, but the server returns `200 OK`. Review the scheduler config validation. The endpoint should reject empty schedule_days and return 422. --- ## Task 17: List Unresolved Folders — Should return non-empty list when folders exist **Test Result:** FAIL — `'[]' should not be empty` **Instructions:** The `List Unresolved Folders` API test expects a non-empty list of unresolved folders, but gets `[]`. Review the endpoint that lists unresolved folders. Ensure that when there are folders in the anime directory that do not match any known series, they are returned by this endpoint. Check if the folder detection logic is working correctly. --- ## Task 18: Get Unresolved Folder Details — Endpoint should exist **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/setup/unresolved/SomeFolder Expected status: 404 != 200` **Instructions:** The `Get Unresolved Folder Details` API test expects a `200 OK` from `/api/setup/unresolved/{folder}`, but gets `404 Not Found`. The endpoint does not exist or the route is incorrect. Implement or fix the route so it returns details for a specific unresolved folder. --- ## Task 19: Resolve Folder With Provider Key — Endpoint should exist **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/setup/unresolved/SomeFolder/resolve Expected status: 404 != 200` **Instructions:** The `Resolve Folder With Provider Key` API test expects a `200 OK` from `/api/setup/unresolved/{folder}/resolve`, but gets `404 Not Found`. The endpoint does not exist or the route is incorrect. Implement or fix the route so it accepts a provider key and resolves the folder to a series. --- ## Task 20: Connect To WebSocket — WebSocket keyword library missing **Test Result:** FAIL — `No keyword with name 'Connect To WebSocket' found` **Instructions:** The `Connect To WebSocket` test fails because the custom keyword library `tests/robot/resources/websocket_keywords.py` contains no keywords. Implement the missing keywords in that file, or add the required WebSocket connection keyword using the Browser library or a custom Python library. --- ## Task 21: Anime Settings Page Loads — Settings section should be visible **Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible` **Instructions:** The `Anime Settings Page Loads` UI test expects the `#settings-section` element to be visible, but it remains hidden (`class="settings-section hidden"`). Review the anime settings page frontend code. Ensure that when navigating to the anime settings page, the settings section is shown (the `hidden` class is removed or the element is otherwise made visible). --- ## Task 22: Regenerate NFO — Settings section should be visible **Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible` **Instructions:** Same root cause as Task 21. The `#settings-section` element is hidden when the test tries to interact with it during the NFO regeneration flow. Fix the anime settings page visibility logic so the settings section is shown when the page loads. --- ## Task 23: Update Series Settings — Settings section should be visible **Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible` **Instructions:** Same root cause as Task 21. The `#settings-section` element is hidden when the test tries to update series settings. Fix the anime settings page visibility logic so the settings section is shown when the page loads. --- ## Task 24: Show Missing Episodes Only — Scan overlay should not block clicks **Test Result:** FAIL — `TimeoutError: locator.click: Timeout 10000ms exceeded.