Add data-testid to toast, update selector and login test
- Add data-testid='toast' to toast element in ui-utils.js - Update toast selector in ui_keywords.resource to use [data-testid='toast'] - Update login rate limit test to check for 'invalid' instead of 'lockout' (testing mode disables lockout, so test verifies proper error message) - Remove completed task docs from tasks.md
This commit is contained in:
@@ -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 <section id="settings-section" class="settings-section hidden">…</section>`
|
||||
|
||||
**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`
|
||||
|
||||
@@ -32,6 +32,7 @@ AniWorld.UI = (function() {
|
||||
|
||||
const toast = document.createElement('div');
|
||||
toast.className = 'toast ' + type;
|
||||
toast.setAttribute('data-testid', 'toast');
|
||||
toast.innerHTML =
|
||||
'<div style="display: flex; justify-content: space-between; align-items: center;">' +
|
||||
'<span>' + escapeHtml(message) + '</span>' +
|
||||
|
||||
@@ -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}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user