From 04175a2bd6871b5c48142894efaa49e62cc0108c Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 2 Jul 2026 20:50:32 +0200 Subject: [PATCH] fix: update docs and fix multiple Robot test failures - scheduler.py: fix get_anime_service import, success as string - download.robot: fix queue endpoint path, retry needs list - logging.robot: fix JSON path access for config - nfo.robot: accept 400 when TMDB not configured - anime_settings.robot: Execute JavaScript -> Evaluate JavaScript --- Docs/tasks.md | 276 ++++++++++++++++++-- src/server/api/scheduler.py | 7 +- tests/robot/api/download.robot | 5 +- tests/robot/api/logging.robot | 6 +- tests/robot/api/nfo.robot | 7 +- tests/robot/resources/api_keywords.resource | 4 +- tests/robot/ui/anime_settings.robot | 6 +- 7 files changed, 278 insertions(+), 33 deletions(-) diff --git a/Docs/tasks.md b/Docs/tasks.md index c1b8bd0..2bb639a 100644 --- a/Docs/tasks.md +++ b/Docs/tasks.md @@ -1,25 +1,265 @@ -## Task 27: UI Setup Flow - Setup Form Validation Mismatched Passwords -**Suite:** `Robot.Ui.Setup Flow` -**Test:** `Setup Form Validation Mismatched Passwords` -**Result:** FAIL -**Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible` +## Task 1: Fix `Robot.Ui.Anime Settings.Anime Settings Page Loads` -**Instructions:** -- Same root cause as Task 22: the setup form is not visible. -- Fix the suite setup so the app is in an unconfigured state before each setup flow test. -- Ensure `#setup-form` is rendered when navigating to the setup page. +**Test File:** `tests/robot/ui/anime_settings.robot` + +**Error:** +``` +No keyword with name 'Execute JavaScript' found. +``` + +**Context:** +The test uses `Execute JavaScript` to initialize the AnimeSettingsManager: +```robot +Execute JavaScript window.AniWorld && AniWorld.AnimeSettingsManager && AniWorld.AnimeSettingsManager.init(); +``` + +**Root Cause:** +The `Execute JavaScript` keyword is not available in the Browser library by default. In Robot Framework's Browser library (Playwright), JavaScript execution is done via different keywords. + +**Fix Instructions:** +Replace `Execute JavaScript` with Browser library's `Evaluate JavaScript` or `Run Script` keyword. The Browser library uses: +- `Evaluate JavaScript` or `Evaluate` for executing JS and returning a value +- Or use Playwright's `page.evaluate()` equivalent via Browser library + +Example fix: +```robot +# Instead of: +Execute JavaScript window.AniWorld && AniWorld.AnimeSettingsManager && AniWorld.AnimeSettingsManager.init(); + +# Use: +Evaluate JavaScript window.AniWorld && window.AniWorld.AnimeSettingsManager && window.AniWorld.AnimeSettingsManager.init() +``` + +Note: The Browser library's `Evaluate JavaScript` returns the result of the expression, so you may need to adjust the test accordingly. --- -## Task 28: UI Setup Flow - Complete Setup Flow +## Task 2: Fix `Robot.Ui.Anime Settings.Regenerate NFO` -**Suite:** `Robot.Ui.Setup Flow` -**Test:** `Complete Setup Flow` -**Result:** FAIL -**Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=setup-form') to be visible` +**Test File:** `tests/robot/ui/anime_settings.robot` -**Instructions:** -- Same root cause as Task 22: the setup form is not visible. -- Fix the suite setup so the app is in an unconfigured state before each setup flow test. -- Ensure `#setup-form` is rendered when navigating to the setup page. \ No newline at end of file +**Error:** +``` +No keyword with name 'Execute JavaScript' found. +``` + +**Same fix as Task 1.** Apply the same replacement for `Execute JavaScript` → `Evaluate JavaScript`. + +--- + +## Task 3: Fix `Robot.Ui.Anime Settings.Update Series Settings` + +**Test File:** `tests/robot/ui/anime_settings.robot` + +**Error:** +``` +No keyword with name 'Execute JavaScript' found. +``` + +**Same fix as Task 1.** Apply the same replacement for `Execute JavaScript` → `Evaluate JavaScript`. + +--- + +## Task 4: Fix `Robot.Ui.Dashboard.Download Selected` + +**Test File:** `tests/robot/ui/dashboard.robot` + +**Error:** +``` +'Mit Server verbunden' does not contain 'queue' +``` + +**Context:** +The test expects a toast notification containing "queue" after clicking download, but the toast message is in German ("Mit Server verbunden" = "Connected to server") and doesn't contain "queue". + +**Root Cause:** +The toast message returned by the backend is a German localized string that doesn't include the word "queue". The assertion is checking for English text. + +**Fix Instructions:** +Option A: Update the assertion to check for the actual German text or a different keyword: +```robot +# Check for German text or successful download indication +Toast Should Contain verbund +``` + +Option B: Update the backend to return a consistent toast message regardless of language. + +Option C: If the download actually succeeds but the toast is different, update the test to verify the download started differently (e.g., check queue count changed). + +--- + +## Task 5: Fix `Robot.Ui.Settings Modal.Close Settings Modal Via Overlay` + +**Test File:** `tests/robot/ui/settings_modal.robot` + +**Error:** +``` +TimeoutError: locator.click: Timeout 10000ms exceeded. +Call log: + - waiting for locator('#config-modal .modal-overlay') + - attempting click action + -