fix ui tests: close modal via escape, scheduler settings

- Remove Task 5/6 from docs (tests now fixed)
- Close Settings Modal Via Escape: click focus + sleep before Escape key
- Edit Scheduler Settings: use checkbox-custom selector
- Disable Scheduler: use force=True on checkbox id

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-07-02 21:03:07 +02:00
parent 1d06f8a00a
commit 9a3a2cbdcb
2 changed files with 5 additions and 73 deletions

View File

@@ -1,73 +1,3 @@
## 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
- <label for="anime-directory-input" ...> from <div class="modal-content"> subtree intercepts pointer events
```
**Root Cause:**
The modal overlay element is being obscured by other elements (the label for anime-directory-input is intercepting pointer events). The click is failing because the element isn't properly accessible.
**Fix Instructions:**
1. Try using `force=True` to bypass actionability checks:
```robot
Click css=#config-modal .modal-overlay force=True
```
2. Or try using `page.locator(...).click(position={...})` with coordinates:
```robot
Click At Position css=#config-modal .modal-overlay x=0 y=0
```
3. Or try using JavaScript click as a workaround (but use Browser's Evaluate):
```robot
Evaluate JavaScript document.querySelector('#config-modal .modal-overlay').click()
```
---
## Task 6: Fix `Robot.Ui.Settings Modal.Close Settings Modal Via Escape`
**Test File:** `tests/robot/ui/settings_modal.robot`
**Error:**
```
TimeoutError: locator.waitFor: Timeout 3000ms exceeded.
```
**Root Cause:**
The modal isn't closing when Escape is pressed. This could be a timing issue or the keyboard event isn't being captured properly.
**Fix Instructions:**
1. Try adding a small delay before pressing Escape:
```robot
Open Settings Modal
Sleep 500ms # Give modal time to fully render
Press Keys id=config-modal Escape
Wait For Elements State id=config-modal hidden timeout=3s
```
2. Or try focusing the modal first:
```robot
Open Settings Modal
Click id=config-modal # Focus the modal first
Press Keys Escape
Wait For Elements State id=config-modal hidden timeout=3s
```
3. Or use a different locator for the Escape key:
```robot
Press Keys None Escape # Press Escape without targeting specific element
```
---
## Task 7: Fix `Robot.Ui.Settings Modal.Edit General Settings`
**Test File:** `tests/robot/ui/settings_modal.robot`

View File

@@ -40,7 +40,9 @@ Close Settings Modal Via Overlay
Close Settings Modal Via Escape
[Documentation] Press Escape and verify the modal closes.
Open Settings Modal
Press Keys id=config-modal Escape
Click id=config-modal
Sleep 300ms
Press Keys None Escape
Wait For Elements State id=config-modal hidden timeout=3s
Element Should Be Hidden id=config-modal
@@ -60,7 +62,7 @@ Edit General Settings
Edit Scheduler Settings
[Documentation] Toggle scheduler enabled and change time/days.
Open Settings Modal
Check Checkbox id=scheduled-rescan-enabled
Click css=#scheduled-rescan-enabled ~ .checkbox-custom
Fill Text id=scheduled-rescan-time 04:30
Save Settings
Toast Should Contain saved
@@ -68,7 +70,7 @@ Edit Scheduler Settings
Disable Scheduler
[Documentation] Uncheck scheduler enabled and save.
Open Settings Modal
Click xpath=//label[contains(., 'Enable Scheduler')]
Uncheck Checkbox id=scheduled-rescan-enabled force=True
Save Settings
Toast Should Contain saved