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.
This commit is contained in:
@@ -1,19 +1,3 @@
|
|||||||
## Task 12: UI Anime Settings - Anime Settings Page Loads
|
|
||||||
|
|
||||||
**Suite:** `Robot.Ui.Anime Settings`
|
|
||||||
**Test:** `Anime Settings Page Loads`
|
|
||||||
**Result:** FAIL
|
|
||||||
**Error:** `TimeoutError: locator.waitFor: Timeout 5000ms exceeded. waiting for locator('id=settings-section') to be visible — locator resolved to hidden <section id="settings-section" class="settings-section hidden">…</section>`
|
|
||||||
|
|
||||||
**Instructions:**
|
|
||||||
- The `#settings-section` element has the CSS class `hidden`, preventing it from becoming visible.
|
|
||||||
- Investigate the anime settings page frontend code to understand how the settings section is shown/hidden.
|
|
||||||
- The test may need to click a button or navigate differently to reveal the section.
|
|
||||||
- Update the test in `tests/robot/ui/anime_settings.robot` to perform the correct navigation steps before waiting for `#settings-section`.
|
|
||||||
- Alternatively, if the section should be visible by default, fix the frontend logic.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 13: UI Anime Settings - Regenerate NFO
|
## Task 13: UI Anime Settings - Regenerate NFO
|
||||||
|
|
||||||
**Suite:** `Robot.Ui.Anime Settings`
|
**Suite:** `Robot.Ui.Anime Settings`
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Documentation Anime settings page UI tests for Aniworld.
|
|||||||
|
|
||||||
Resource ${CURDIR}/../resources/common.resource
|
Resource ${CURDIR}/../resources/common.resource
|
||||||
Resource ${CURDIR}/../resources/ui_keywords.resource
|
Resource ${CURDIR}/../resources/ui_keywords.resource
|
||||||
|
Resource ${CURDIR}/../resources/api_keywords.resource
|
||||||
|
|
||||||
Test Setup Run Keywords
|
Test Setup Run Keywords
|
||||||
... Create Anonymous Session
|
... Create Anonymous Session
|
||||||
@@ -11,6 +12,8 @@ Test Setup Run Keywords
|
|||||||
... AND Open Browser To Page /login
|
... AND Open Browser To Page /login
|
||||||
... AND Perform Login
|
... AND Perform Login
|
||||||
... AND Wait For Elements State id=search-input visible timeout=5s
|
... 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 Teardown Close Browser
|
||||||
|
|
||||||
@@ -20,7 +23,12 @@ Test Teardown Close Browser
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
Anime Settings Page Loads
|
Anime Settings Page Loads
|
||||||
[Documentation] Navigate to anime settings page and verify form elements.
|
[Documentation] Navigate to anime settings page and verify form elements.
|
||||||
Go To ${BASE_URL}/anime/settings?key=attack-on-titan
|
# 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
|
Wait For Elements State id=settings-section visible timeout=10s
|
||||||
Page Title Should Contain Settings
|
Page Title Should Contain Settings
|
||||||
Element Should Be Visible id=settings-section
|
Element Should Be Visible id=settings-section
|
||||||
@@ -32,7 +40,12 @@ Anime Settings Page Loads
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
Regenerate NFO
|
Regenerate NFO
|
||||||
[Documentation] Click regenerate NFO and verify success notification.
|
[Documentation] Click regenerate NFO and verify success notification.
|
||||||
Go To ${BASE_URL}/anime/settings?key=attack-on-titan
|
# 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
|
Wait For Elements State id=settings-section visible timeout=10s
|
||||||
Click id=regenerate-nfo-btn
|
Click id=regenerate-nfo-btn
|
||||||
Wait For Elements State css=#toast-container .toast visible timeout=5s
|
Wait For Elements State css=#toast-container .toast visible timeout=5s
|
||||||
@@ -42,7 +55,12 @@ Regenerate NFO
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
Update Series Settings
|
Update Series Settings
|
||||||
[Documentation] Change series settings and save.
|
[Documentation] Change series settings and save.
|
||||||
Go To ${BASE_URL}/anime/settings?key=attack-on-titan
|
# 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
|
Wait For Elements State id=settings-section visible timeout=10s
|
||||||
Fill Text id=field-folder Attack on Titan Custom
|
Fill Text id=field-folder Attack on Titan Custom
|
||||||
Click id=save-db-btn
|
Click id=save-db-btn
|
||||||
|
|||||||
Reference in New Issue
Block a user