Add POST /api/queue/resume endpoint. Alias for start_queue that provides semantic clarity for resume action after pause/stop. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8.8 KiB
Task 11: Fix Resume Queue API Test
Test Result: FAIL — Expected status: 200, got 405 (Method Not Allowed)
File: tests/robot/api/download.robot and src/server/api/download.py
Instructions:
The test calls POST /api/queue/resume, but this endpoint does not exist. Open src/server/api/download.py. There is /queue/start, /queue/stop, and /queue/pause, but no /queue/resume. Either add a POST /queue/resume endpoint that aliases to start_queue, or update the Robot test to call /queue/start instead of /queue/resume. Ensure the test and API agree.
Task 12: Fix Remove Item From Queue API Test
Test Result: FAIL — Expected status: 201, got 422 (caused by Add To Queue failing)
File: tests/robot/api/download.robot
Instructions:
This test depends on Add To Queue working first. Fix Task 9 (Add Episodes To Queue) so items can be added. Then verify that the DELETE /api/queue/item/{item_id} endpoint in src/server/api/download.py works correctly and returns 200.
Task 13: Fix Retry Failed Item API Test
Test Result: FAIL — Expected status: 200, got 400
File: tests/robot/api/download.robot
Instructions:
The test adds an item and then immediately retries it, but there are no failed items to retry. The POST /api/queue/retry endpoint returns 400 when no failed items exist. Update the test to first add an item, simulate a failure (or mock it), and then retry. Alternatively, modify the endpoint to return 200 with retried_count: 0 when there are no failed items instead of 400.
Task 14: Fix Queue Statistics Accuracy API Test
Test Result: FAIL — Expected status: 200, got 400 (No pending downloads in queue)
File: tests/robot/api/download.robot
Instructions:
The test calls Clear Pending and then Add To Queue, but Add To Queue fails with 422 (see Task 9). Fix Task 9 first. Then verify that after adding 2 items, Get Queue Status returns statistics.pending (or statistics.pending_count) equal to 2. Update the JSON path in the test if the response field name differs.
Task 15: Fix Connect To WebSocket API Test
Test Result: FAIL — Evaluate keyword syntax error / requires custom keyword library
File: tests/robot/api/websocket.robot
Instructions:
The test tries to evaluate __import__('asyncio').run(__import__('websockets').connect(...)) inline, which is unreliable in Robot Framework. Create a small Python keyword library (e.g., tests/robot/resources/websocket_keywords.py) that wraps WebSocket connection logic using the websockets library. Import this library in websocket.robot and replace the inline Evaluate with a proper keyword like Connect To WebSocket. Ensure the library handles token-based authentication.
UI Tests
Task 16: Fix Login Page Loads UI Test
Test Result: FAIL — TimeoutError: locator.waitFor: Timeout 5000ms exceeded. Call log: waiting for locator('id=password-input') to be visible
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
The Robot test looks for id=password-input, but the HTML template uses id=password. Open src/server/web/templates/login.html and change the password input element's id from password to password-input. Also check id=login-submit-btn — the template uses id=login-button. Change it to id=login-submit-btn. Ensure all referenced element IDs in the Robot tests match the actual HTML.
Task 17: Fix Login With Valid Password UI Test
Test Result: FAIL — Same as Task 16 (id=password-input not found)
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
Fix the element ID mismatches in login.html as described in Task 16. The Perform Login keyword in tests/robot/resources/ui_keywords.resource fills id=password-input and clicks id=login-submit-btn. Update the HTML template IDs to match.
Task 18: Fix Login With Invalid Password UI Test
Test Result: FAIL — Same as Task 16
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
Fix the element ID mismatches in login.html as described in Task 16. Also verify that the error message element id=login-error exists in the template and is shown when login fails.
Task 19: Fix Login Rate Limit UI UI Test
Test Result: FAIL — Same as Task 16
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
Fix the element ID mismatches in login.html as described in Task 16. Also verify that after 5 failed attempts, the login form shows a lockout message containing the word "lockout" and the id=login-error element displays it.
Task 20: Fix Password Visibility Toggle UI Test
Test Result: FAIL — Same as Task 16
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
Fix the element ID mismatches in login.html as described in Task 16. The test clicks id=password-toggle — verify this ID exists in the template (it may be id=password-toggle already, but confirm). Ensure the toggle button changes the input type attribute between password and text.
Task 21: Fix Logout UI Test
Test Result: FAIL — Same as Task 16
File: tests/robot/ui/login.robot and src/server/web/templates/login.html
Instructions:
Fix the element ID mismatches in login.html as described in Task 16. The Perform Logout keyword clicks id=logout-btn. Verify this button exists in the dashboard/index template and redirects to /login after logout.
Task 22: Fix All Dashboard UI Tests
Test Result: FAIL — All 11 tests fail with TimeoutError: locator.fill: Timeout 10000ms exceeded. Call log: waiting for locator('id=password-input')
File: tests/robot/ui/dashboard.robot and src/server/web/templates/login.html
Instructions:
All dashboard tests depend on logging in first. The login step fails because of the id=password-input mismatch. Fix Task 16 first. Then verify that after login, the dashboard page loads and contains the elements referenced in the tests: id=search-input, theme toggle, rescan button, missing episodes filter, etc. Update element IDs in the dashboard HTML or Robot tests as needed.
Task 23: Fix All Anime Settings UI Tests
Test Result: FAIL — All 3 tests fail with the same login timeout
File: tests/robot/ui/anime_settings.robot
Instructions:
Fix Task 16 first. Then verify that the anime settings page loads after login and contains the elements expected by the Robot tests. Update IDs in the HTML or tests as needed.
Task 24: Fix All Queue Page UI Tests
Test Result: FAIL — All 6 tests fail with the same login timeout
File: tests/robot/ui/queue_page.robot
Instructions:
Fix Task 16 first. Then verify that the queue page loads after login and contains the elements expected by the Robot tests. Update IDs in the HTML or tests as needed.
Task 25: Fix All Settings Modal UI Tests
Test Result: FAIL — All tests fail with the same login timeout
File: tests/robot/ui/settings_modal.robot
Instructions:
Fix Task 16 first. Then verify that the settings modal opens from the dashboard and contains the expected form elements. Update IDs in the HTML or tests as needed.
Task 26: Fix All Setup Flow UI Tests
Test Result: FAIL — All tests fail with the same login timeout
File: tests/robot/ui/setup_flow.robot
Instructions:
Fix Task 16 first. The setup flow tests may need to run before the app is configured. Verify that tests/robot/start_server.sh correctly removes data/config.json so the app starts unconfigured. Ensure the setup page elements match the Robot test selectors.
Task 27: Fix All Responsive UI Tests
Test Result: FAIL — All tests fail with the same login timeout
File: tests/robot/ui/responsive.robot
Instructions:
Fix Task 16 first. Then verify that responsive layout tests check for viewport-specific elements that actually exist in the HTML.
Summary of Root Causes
- Config API —
POST /api/config/backupsreturns 200 instead of 201.ConfigUpdatemodel may rejectotherfield.LoggingConfigmay rejectNoneforfile/max_bytes. - Download Queue API —
DownloadRequestmodel validation fails on the test payload.GET /queue/statusresponse field names may differ from test expectations.POST /queue/resumeendpoint is missing.Start Queuereturns 400 on empty queue. - WebSocket API — Inline
Evaluatewith asyncio is unreliable; needs a proper Python keyword library. - UI Login Page — HTML element IDs (
password,login-button) do not match Robot test selectors (password-input,login-submit-btn). - All Other UI Tests — Fail because they cannot log in due to the ID mismatch above.