Files
Aniworld/tests/robot/ui/settings_modal.robot
Lukas 097138376a fix(settings_modal.robot): replace Execute JavaScript with Evaluate JavaScript
Browser library uses Evaluate JavaScript, not Execute JavaScript.
Update scrollTop assignments in modal tests to use correct keyword.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-02 20:51:45 +02:00

134 lines
5.7 KiB
Plaintext

*** Settings ***
Documentation Settings modal UI tests for Aniworld.
... Covers open/close, edit all config sections, save, backup/restore, and export/import.
Resource ${CURDIR}/../resources/common.resource
Resource ${CURDIR}/../resources/ui_keywords.resource
Test Setup Run Keywords
... Create Anonymous Session
... AND Setup Master Password
... AND Open Browser To Page /login
... AND Perform Login
... AND Wait For Elements State id=search-input visible timeout=5s
Test Teardown Close Browser
*** Test Cases ***
# ---------------------------------------------------------------------------
# Modal Open/Close
# ---------------------------------------------------------------------------
Open Settings Modal
[Documentation] Click the config button and verify the modal opens.
Open Settings Modal
Element Should Be Visible id=config-modal
Close Settings Modal Via Button
[Documentation] Click the close button and verify the modal closes.
Open Settings Modal
Close Settings Modal
Element Should Be Hidden id=config-modal
Close Settings Modal Via Overlay
[Documentation] Click the modal overlay and verify the modal closes.
Open Settings Modal
Wait For Elements State css=#config-modal .modal-overlay visible timeout=5s
Click css=#config-modal .modal-overlay
Wait For Elements State id=config-modal hidden timeout=3s
Element Should Be Hidden id=config-modal
Close Settings Modal Via Escape
[Documentation] Press Escape and verify the modal closes.
Open Settings Modal
Press Keys id=config-modal Escape
Wait For Elements State id=config-modal hidden timeout=3s
Element Should Be Hidden id=config-modal
# ---------------------------------------------------------------------------
# General Settings
# ---------------------------------------------------------------------------
Edit General Settings
[Documentation] Change app name, data dir, and anime directory.
Open Settings Modal
Fill General Settings UpdatedApp data /tmp/updated_anime
Save Settings
Toast Should Contain saved
# ---------------------------------------------------------------------------
# Scheduler Settings
# ---------------------------------------------------------------------------
Edit Scheduler Settings
[Documentation] Toggle scheduler enabled and change time/days.
Open Settings Modal
Check Checkbox id=scheduled-rescan-enabled
Fill Text id=scheduled-rescan-time 04:30
Save Settings
Toast Should Contain saved
Disable Scheduler
[Documentation] Uncheck scheduler enabled and save.
Open Settings Modal
Click xpath=//label[contains(., 'Enable Scheduler')]
Save Settings
Toast Should Contain saved
# ---------------------------------------------------------------------------
# Logging Settings
# ---------------------------------------------------------------------------
Edit Logging Settings
[Documentation] Change log level, file path, max bytes, and backup count.
Open Settings Modal
Select Options By id=log-level text DEBUG
Fill Text id=log-file logs/test.log
Fill Text id=log-max-bytes 1048576
Fill Text id=log-backup-count 5
Save Settings
Toast Should Contain saved
# ---------------------------------------------------------------------------
# Backup Settings
# ---------------------------------------------------------------------------
Edit Backup Settings
[Documentation] Toggle backup enabled and change path/retention.
Open Settings Modal
# Backup section is below other sections - scroll to make it visible
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
Wait For Elements State id=backup-enabled visible timeout=5s
Check Checkbox id=backup-enabled
Fill Text id=backup-path /tmp/aniworld_backups
Fill Text id=backup-keep-days 14
Save Settings
Toast Should Contain saved
# ---------------------------------------------------------------------------
# NFO Settings
# ---------------------------------------------------------------------------
Edit NFO Settings
[Documentation] Enter TMDB key and toggle auto-create/media downloads.
Open Settings Modal
# NFO section is below other sections - scroll to make it visible
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
Wait For Elements State id=nfo-auto-create visible timeout=5s
Fill Text id=tmdb-api-key test_tmdb_key_123
Check Checkbox id=nfo-auto-create
Check Checkbox id=nfo-download-poster
Check Checkbox id=nfo-download-logo
Check Checkbox id=nfo-download-fanart
Save Settings
Toast Should Contain saved
# ---------------------------------------------------------------------------
# Backup Management
# NOTE: restore/delete backup and import functionality not implemented yet
# ---------------------------------------------------------------------------
Create Config Backup
[Documentation] Click create backup and verify success notification.
Open Settings Modal
# Scroll to bottom to make the create-config-backup button visible
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
Wait For Elements State id=create-config-backup visible timeout=5s
Click id=create-config-backup
# Backup creation shows toast (stub implementation - no actual file created)
${toast}= Get Text .toast
Should Contain ${toast} backup