Files
Aniworld/tests/robot/ui/anime_settings.robot
Lukas fd8d9636cb Fix anime settings UI tests: add series via API before testing
Tests were failing because settings page requires series in DB.
Now call Add Series API before navigating to settings page.
2026-06-28 17:19:54 +02:00

68 lines
3.4 KiB
Plaintext

*** Settings ***
Documentation Anime settings page UI tests for Aniworld.
... Covers page load, regenerate NFO, and update series settings.
Resource ${CURDIR}/../resources/common.resource
Resource ${CURDIR}/../resources/ui_keywords.resource
Resource ${CURDIR}/../resources/api_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
... AND Login And Get Token
... AND Create Session auth ${BASE_URL} headers={'Authorization': 'Bearer ${TOKEN}'}
Test Teardown Close Browser
*** Test Cases ***
# ---------------------------------------------------------------------------
# Anime Settings Page Load
# ---------------------------------------------------------------------------
Anime Settings Page Loads
[Documentation] Navigate to anime settings page and verify form elements.
# Add series to the database first so the settings page can load it
${resp}= Add Series https://aniworld.to/anime/stream/attack-on-titan Attack on Titan 2013
Response Should Have Status ${resp} 202
${key}= Get JSON Value ${resp} $.key
Should Not Be Empty ${key}
Go To ${BASE_URL}/anime/settings?key=${key}
Wait For Elements State id=settings-section visible timeout=10s
Page Title Should Contain Settings
Element Should Be Visible id=settings-section
Element Should Be Visible id=regenerate-nfo-btn
Element Should Be Visible id=save-db-btn
# ---------------------------------------------------------------------------
# Regenerate NFO
# ---------------------------------------------------------------------------
Regenerate NFO
[Documentation] Click regenerate NFO and verify success notification.
# Add series to the database first so the settings page can load it
${resp}= Add Series https://aniworld.to/anime/stream/attack-on-titan Attack on Titan 2013
Response Should Have Status ${resp} 202
${key}= Get JSON Value ${resp} $.key
Should Not Be Empty ${key}
Go To ${BASE_URL}/anime/settings?key=${key}
Wait For Elements State id=settings-section visible timeout=10s
Click id=regenerate-nfo-btn
Wait For Elements State css=#toast-container .toast visible timeout=5s
# ---------------------------------------------------------------------------
# Update Series Settings
# ---------------------------------------------------------------------------
Update Series Settings
[Documentation] Change series settings and save.
# Add series to the database first so the settings page can load it
${resp}= Add Series https://aniworld.to/anime/stream/attack-on-titan Attack on Titan 2013
Response Should Have Status ${resp} 202
${key}= Get JSON Value ${resp} $.key
Should Not Be Empty ${key}
Go To ${BASE_URL}/anime/settings?key=${key}
Wait For Elements State id=settings-section visible timeout=10s
Fill Text id=field-folder Attack on Titan Custom
Click id=save-db-btn
Wait For Elements State css=#toast-container .toast visible timeout=5s