## Task 1: Get Series Episodes — Episode list should not be empty **Test Result:** FAIL — `'[]' should not be empty` **Instructions:** The `Get Series Episodes` API test expects the episode list for a series to contain at least one episode after a series is added. Currently the endpoint returns an empty array `[]`. Investigate the endpoint that returns episodes for a series. Ensure that when a series is added (via the `Add New Series` test), episodes are populated or the endpoint correctly retrieves them. Check if the episode scraping/population logic is running or if the endpoint is querying the wrong data source. --- ## Task 2: Update Config — Should accept valid config updates **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/config Expected status: 422 != 200` **Instructions:** The `Update Config` API test sends a valid configuration payload and expects a `200 OK` response, but the server returns `422 Unprocessable Entity`. Review the `/api/config` PUT/POST endpoint validation logic. The payload is likely being rejected by Pydantic or manual validation even though it is well-formed. Check which field is triggering the 422 and relax or correct the validation. --- ## Task 3: Resume Queue — Should resume paused queue **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/queue/resume Expected status: 400 != 200` **Instructions:** The `Resume Queue` API test expects a `200 OK` when resuming the queue, but the server returns `400 Bad Request`. Review the `/api/queue/resume` endpoint. The 400 likely occurs because the queue is not in a pausable/resumable state, or the endpoint expects different preconditions. Ensure the endpoint can resume a paused queue and returns 200 on success. --- ## Task 4: Remove Item From Queue — Should remove item by ID **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/queue/item/%5B'2'%5D Expected status: 404 != 200` **Instructions:** The `Remove Item From Queue` API test expects a `200 OK` when removing an item, but gets `404 Not Found`. The URL contains `%5B'2'%5D` which decodes to `['2']` — this suggests the test is passing a list/string representation instead of a plain ID, or the endpoint routing does not match. Check the route definition for `/api/queue/item/{item_id}` and ensure it accepts a simple integer/string ID and correctly finds the item. --- ## Task 5: Detailed Health Check — Should include uptime field **Test Result:** FAIL — `Dictionary does not contain key 'uptime'` **Instructions:** The `Detailed Health Check` API test expects the response JSON to contain an `uptime` key, but it is missing. Review the detailed health endpoint implementation. Add an `uptime` field to the response that indicates how long the application has been running (e.g., seconds since start or a human-readable duration). --- ## Task 6: Get Logging Config — Should include level field **Test Result:** FAIL — `Dictionary does not contain key 'level'` **Instructions:** The `Get Logging Config` API test expects the response JSON to contain a `level` key, but it is missing. Review the logging configuration endpoint. Ensure the response includes the current logging level (e.g., `INFO`, `DEBUG`, `WARNING`) under the key `level`. --- ## Task 7: Tail Log File — Endpoint should exist and return log tail **Test Result:** FAIL — `Url: http://127.0.0.1:8765/api/logging/files/aniworld.log/tail Expected status: 404 != 200` **Instructions:** The `Tail Log File` API test expects a `200 OK` from `/api/logging/files/{filename}/tail`, 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 last N lines of the requested log file. --- ## 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.