Files
Aniworld/Docs/tasks.md
Lukas 1d06f8a00a fix(settings_modal): force click on modal overlay
Caveman commit: overlay click target area small, click miss. Add force=True.

- Remove completed Task 4 from Docs/tasks.md
- Fix flaky close modal via overlay test
2026-07-02 20:54:20 +02:00

4.5 KiB

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:
Click    css=#config-modal .modal-overlay    force=True
  1. Or try using page.locator(...).click(position={...}) with coordinates:
Click At Position    css=#config-modal .modal-overlay    x=0    y=0
  1. Or try using JavaScript click as a workaround (but use Browser's Evaluate):
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:
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
  1. Or try focusing the modal first:
Open Settings Modal
Click    id=config-modal    # Focus the modal first
Press Keys    Escape
Wait For Elements State    id=config-modal    hidden    timeout=3s
  1. Or use a different locator for the Escape key:
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

Error:

TimeoutError: locator.check: Timeout 10000ms exceeded.

Root Cause: A checkbox (id=scheduler-rescan-enabled or similar) isn't being checked within the timeout. The element might not be visible or interactable.

Fix Instructions:

  1. Verify the checkbox ID is correct - check the actual HTML in the settings modal
  2. Try using force=True:
Check Checkbox    id=scheduled-rescan-enabled    force=True
  1. Or use JavaScript to check the checkbox:
Evaluate JavaScript    document.getElementById('scheduled-rescan-enabled').checked = true

Task 8: Fix Robot.Ui.Settings Modal.Disable Scheduler

Test File: tests/robot/ui/settings_modal.robot

Error:

TimeoutError: locator.check: Timeout 10000ms exceeded.

Root Cause: Similar to Task 7 - checkbox interaction is failing.

Fix Instructions: Same as Task 7. The xpath //label[contains(., 'Enable Scheduler')] might not be correct or clicking the label isn't triggering the checkbox properly.

Try:

Click    //label[contains(., 'Enable Scheduler')]    force=True

Or find the actual checkbox ID and use Uncheck Checkbox directly.


Task 9: Fix Robot.Ui.Settings Modal.Edit Backup Settings

Test File: tests/robot/ui/settings_modal.robot

Error:

No keyword with name 'Execute JavaScript' found.

Context: Uses Execute JavaScript to scroll the modal:

Execute JavaScript    document.querySelector('#config-modal .modal-body').scrollTop = 10000

Fix Instructions: Replace with Browser library's scroll method:

# Instead of Execute JavaScript, use:
Evaluate JavaScript    document.querySelector('#config-modal .modal-body').scrollTop = 10000

Or use Playwright's built-in scrolling:

# Scroll within the modal content area
Scroll    css=#config-modal .modal-body    down

Task 10: Fix Robot.Ui.Settings Modal.Edit NFO Settings

Test File: tests/robot/ui/settings_modal.robot

Error:

No keyword with name 'Execute JavaScript' found.

Same fix as Task 9. Replace Execute JavaScript with Evaluate JavaScript.


Task 11: Fix Robot.Ui.Settings Modal.Create Config Backup

Test File: tests/robot/ui/settings_modal.robot

Error:

No keyword with name 'Execute JavaScript' found.

Same fix as Task 9. Replace Execute JavaScript with Evaluate JavaScript.