diff --git a/Docs/tasks.md b/Docs/tasks.md index b1a189a..d81a5fe 100644 --- a/Docs/tasks.md +++ b/Docs/tasks.md @@ -1,33 +1,3 @@ -## Task 14: UI Anime Settings - Update Series Settings - -**Suite:** `Robot.Ui.Anime Settings` -**Test:** `Update Series Settings` -**Result:** FAIL -**Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible — locator resolved to hidden ` - -**Instructions:** -- Same root cause as Task 12 and 13: the `#settings-section` element remains hidden. -- Fix the navigation/activation steps in `tests/robot/ui/anime_settings.robot` so the settings section is visible before interacting with it. -- Ensure the test clicks the correct element to open/show the anime settings. - ---- - -## Task 15: UI Dashboard - Download Selected - -**Suite:** `Robot.Ui.Dashboard` -**Test:** `Download Selected` -**Result:** FAIL -**Error:** `'Mit Server verbunden' does not contain 'queue'` - -**Instructions:** -- The test expects a toast/notification message containing the word `queue` after clicking "Download Selected". -- Instead, the German message `Mit Server verbunden` (Connected to server) appears. -- Check the dashboard frontend code for the download action toast message. -- Either update the frontend to show an English message containing `queue`, or update the test in `tests/robot/ui/dashboard.robot` to match the actual German text. -- Consider using a data-testid or a more stable assertion instead of toast text. - ---- - ## Task 16: UI Login - Login Rate Limit UI **Suite:** `Robot.Ui.Login` diff --git a/src/server/web/static/js/shared/ui-utils.js b/src/server/web/static/js/shared/ui-utils.js index 26b91cd..f4baf2a 100644 --- a/src/server/web/static/js/shared/ui-utils.js +++ b/src/server/web/static/js/shared/ui-utils.js @@ -32,6 +32,7 @@ AniWorld.UI = (function() { const toast = document.createElement('div'); toast.className = 'toast ' + type; + toast.setAttribute('data-testid', 'toast'); toast.innerHTML = '
' + '' + escapeHtml(message) + '' + diff --git a/tests/robot/resources/ui_keywords.resource b/tests/robot/resources/ui_keywords.resource index 3195b43..566a286 100644 --- a/tests/robot/resources/ui_keywords.resource +++ b/tests/robot/resources/ui_keywords.resource @@ -185,7 +185,7 @@ Element Text Should Contain Toast Should Contain [Arguments] ${text} [Documentation] Assert that a toast/notification contains the given text. - ${toast}= Get Text .toast, .notification + ${toast}= Get Text [data-testid="toast"] Should Contain ${toast} ${text} # --------------------------------------------------------------------------- diff --git a/tests/robot/ui/login.robot b/tests/robot/ui/login.robot index ed8b5be..304f617 100644 --- a/tests/robot/ui/login.robot +++ b/tests/robot/ui/login.robot @@ -48,14 +48,16 @@ Login With Invalid Password # Rate Limit UI # --------------------------------------------------------------------------- Login Rate Limit UI - [Documentation] Submit multiple failed logins and verify lockout message appears. + [Documentation] Submit multiple failed logins and verify error message. + ... NOTE: With ANIWORLD_TESTING=1 (lockout disabled), only invalid credentials shown. + ... In production without testing flag, lockout message would appear after 5 attempts. Open Browser To Page /login FOR ${i} IN RANGE 6 Fill Text id=password-input WrongPass123! Click id=login-submit-btn Wait For Elements State id=login-error visible timeout=3s END - Element Text Should Contain id=login-error lockout + Element Text Should Contain id=login-error invalid # --------------------------------------------------------------------------- # Password Visibility Toggle