Files
Aniworld/Docs/tasks.md
Lukas ad2320dbbb Add NFO scan endpoint and fix scheduler test payload
- Implement /api/nfo/scan endpoint returning scan results
- Fix Robot Framework scheduler test: use Evaluate+json.loads instead of Create Dictionary for nested data
- Remove completed task docs
2026-06-27 15:14:56 +02:00

249 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 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. <div id="scan-progress-overlay" class="scan-progress-overlay visible"> intercepts pointer events`
**Instructions:**
The `Show Missing Episodes Only` UI test tries to click the `#show-missing-only` button, but the scan progress overlay intercepts pointer events. Review the dashboard frontend. Ensure the scan overlay either: (a) hides itself when scanning is complete, (b) allows clicks to pass through to underlying elements, or (c) is not shown when there is no active scan.
---
## Task 25: Download Selected — Toast should mention queue
**Test Result:** FAIL — `'Mit Server verbunden' does not contain 'queue'`
**Instructions:**
The `Download Selected` UI test expects a toast/notification message containing the word `queue`, but sees `'Mit Server verbunden'` (German for "Connected to server"). Review the download selected action. Ensure that when episodes are added to the download queue, the success toast message explicitly mentions "queue" so the test can verify the action.
---
## Task 26: Login Rate Limit UI — Should show lockout message
**Test Result:** FAIL — `'invalid credentials' does not contain 'lockout'`
**Instructions:**
The `Login Rate Limit UI` test expects the login form to display a message containing `lockout` after repeated failed attempts, but it shows `'invalid credentials'` instead. Review the login frontend and backend rate-limiting logic. After exceeding the allowed number of failed attempts, the UI should display a lockout message (e.g., "Account locked, try again in X minutes") instead of the generic "invalid credentials" message.
---
## Task 27: Close Settings Modal Via Overlay — Overlay click should close modal
**Test Result:** FAIL — `TimeoutError: locator.click: Timeout 10000ms exceeded. waiting for locator('id=config-modal .modal-overlay')`
**Instructions:**
The `Close Settings Modal Via Overlay` UI test tries to click the settings modal overlay to close it, but the click times out. Review the settings modal component. Ensure clicking the modal overlay (the dark background outside the modal content) triggers the modal to close.
---
## Task 28: Close Settings Modal Via Escape — Escape key should close modal
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 3000ms exceeded. waiting for locator('id=config-modal') to be hidden`
**Instructions:**
The `Close Settings Modal Via Escape` UI test presses the Escape key and expects the `#config-modal` to be hidden, but it remains visible. Review the settings modal component. Add an Escape key event listener that closes the modal when the user presses Escape.
---
## Task 29: Disable Scheduler — Checkbox should be visible and clickable
**Test Result:** FAIL — `TimeoutError: locator.uncheck: Timeout 10000ms exceeded. waiting for locator('id=scheduled-rescan-enabled') element is not visible`
**Instructions:**
The `Disable Scheduler` UI test tries to uncheck the `#scheduled-rescan-enabled` checkbox, but it is not visible. Review the settings modal scheduler tab. Ensure the scheduler checkbox is visible when the scheduler settings tab is active, or that the test navigates to the correct tab before interacting with the checkbox.
---
## Task 30: Edit Backup Settings — Checkbox should be visible and clickable
**Test Result:** FAIL — `TimeoutError: locator.check: Timeout 10000ms exceeded. waiting for locator('id=backup-enabled') element is not visible`
**Instructions:**
The `Edit Backup Settings` UI test tries to check the `#backup-enabled` checkbox, but it is not visible. Review the settings modal backup tab. Ensure the backup settings form is visible when the backup tab is active, or that the test navigates to the correct tab before interacting with the checkbox.
---
## Task 31: Edit NFO Settings — Checkbox should be visible and clickable
**Test Result:** FAIL — `TimeoutError: locator.check: Timeout 10000ms exceeded. waiting for locator('id=nfo-auto-create') element is not visible`
**Instructions:**
The `Edit NFO Settings` UI test tries to check the `#nfo-auto-create` checkbox, but it is not visible. Review the settings modal NFO tab. Ensure the NFO settings form is visible when the NFO tab is active, or that the test navigates to the correct tab before interacting with the checkbox.
---
## Task 32: Setup Page Loads — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
The `Setup Page Loads` UI test expects the `#setup-form` to be visible, but it is not found. Review the setup page frontend. The test may be running when the app is already configured (which redirects away from setup), or the setup form element ID may be different. Ensure the setup form is rendered with `id="setup-form"` when the app is unconfigured.
---
## Task 33: Password Strength Weak — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to check password strength. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured.
---
## Task 34: Password Strength Medium — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to check password strength. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured.
---
## Task 35: Password Strength Strong — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to check password strength. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured.
---
## Task 36: Setup Form Validation Empty Password — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to validate empty password. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured.
---
## Task 37: Setup Form Validation Mismatched Passwords — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to validate mismatched passwords. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured.
---
## Task 38: Complete Setup Flow — Setup form should be visible
**Test Result:** FAIL — `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible`
**Instructions:**
Same root cause as Task 32. The setup form is not visible when the test tries to complete the setup flow. Ensure the setup page renders the form with `id="setup-form"` when the app is unconfigured. Also verify that the setup flow can be completed end-to-end and redirects correctly after submission.
---
## Notes for Agent
- **Fix the application code, not the tests.** The Robot Framework tests define expected behavior; your job is to make the application conform.
- **Run the specific failing test** after each fix to verify: `robot tests/robot/api/<suite>.robot` or `robot tests/robot/ui/<suite>.robot`
- **Group related fixes** when multiple tests fail for the same root cause (e.g., Tasks 2123, 3238) to avoid redundant work.
- **Check existing tests** in `tests/robot/api/` and `tests/robot/ui/` to understand the expected request/response format and UI interactions.