*** 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 Click id=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=scheduler-time-input 04:30 # Select days (simplified - actual implementation depends on UI widgets) Save Settings Toast Should Contain saved Disable Scheduler [Documentation] Uncheck scheduler enabled and save. Open Settings Modal Uncheck Checkbox id=scheduled-rescan-enabled 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=logging-level-select text DEBUG Fill Text id=logging-file-input logs/test.log Fill Text id=logging-max-bytes-input 1048576 Fill Text id=logging-backup-count-input 5 Save Settings Toast Should Contain saved # --------------------------------------------------------------------------- # Backup Settings # --------------------------------------------------------------------------- Edit Backup Settings [Documentation] Toggle backup enabled and change path/retention. Open Settings Modal Check Checkbox id=backup-enabled Fill Text id=backup-path-input /tmp/aniworld_backups Fill Text id=backup-keep-days-input 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 Fill Text id=tmdb-api-key-input 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 # --------------------------------------------------------------------------- Create Config Backup [Documentation] Click create backup and verify success notification. Open Settings Modal Click id=create-backup-btn Toast Should Contain backup Restore Config Backup [Documentation] Select a backup and click restore. Open Settings Modal Click id=create-backup-btn Toast Should Contain backup # Select first backup in list ${count}= Get Element Count .backup-item IF ${count} > 0 Click .backup-item >> nth=0 Click id=restore-backup-btn Toast Should Contain restore END Delete Config Backup [Documentation] Select a backup and click delete. Open Settings Modal Click id=create-backup-btn Toast Should Contain backup ${count}= Get Element Count .backup-item IF ${count} > 0 Click .backup-item >> nth=0 Click id=delete-backup-btn Toast Should Contain delete END # --------------------------------------------------------------------------- # Export / Import # --------------------------------------------------------------------------- Export Config [Documentation] Click export config and verify download starts. Open Settings Modal ${dl_promise}= Promise To Wait For Event download Click id=export-config-btn ${download}= Wait For ${dl_promise} Should Not Be Empty ${download} Import Config [Documentation] Upload a config file and verify it is applied. Open Settings Modal Upload File By Selector id=import-config-input ${CURDIR}/../fixtures/sample_config.json Click id=import-config-btn Toast Should Contain import