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>
This commit is contained in:
@@ -1,53 +1,3 @@
|
|||||||
|
|
||||||
## Task 1: Fix `Robot.Ui.Anime Settings.Anime Settings Page Loads`
|
|
||||||
|
|
||||||
**Test File:** `tests/robot/ui/anime_settings.robot`
|
|
||||||
|
|
||||||
**Error:**
|
|
||||||
```
|
|
||||||
No keyword with name 'Execute JavaScript' found.
|
|
||||||
```
|
|
||||||
|
|
||||||
**Context:**
|
|
||||||
The test uses `Execute JavaScript` to initialize the AnimeSettingsManager:
|
|
||||||
```robot
|
|
||||||
Execute JavaScript window.AniWorld && AniWorld.AnimeSettingsManager && AniWorld.AnimeSettingsManager.init();
|
|
||||||
```
|
|
||||||
|
|
||||||
**Root Cause:**
|
|
||||||
The `Execute JavaScript` keyword is not available in the Browser library by default. In Robot Framework's Browser library (Playwright), JavaScript execution is done via different keywords.
|
|
||||||
|
|
||||||
**Fix Instructions:**
|
|
||||||
Replace `Execute JavaScript` with Browser library's `Evaluate JavaScript` or `Run Script` keyword. The Browser library uses:
|
|
||||||
- `Evaluate JavaScript` or `Evaluate` for executing JS and returning a value
|
|
||||||
- Or use Playwright's `page.evaluate()` equivalent via Browser library
|
|
||||||
|
|
||||||
Example fix:
|
|
||||||
```robot
|
|
||||||
# Instead of:
|
|
||||||
Execute JavaScript window.AniWorld && AniWorld.AnimeSettingsManager && AniWorld.AnimeSettingsManager.init();
|
|
||||||
|
|
||||||
# Use:
|
|
||||||
Evaluate JavaScript window.AniWorld && window.AniWorld.AnimeSettingsManager && window.AniWorld.AnimeSettingsManager.init()
|
|
||||||
```
|
|
||||||
|
|
||||||
Note: The Browser library's `Evaluate JavaScript` returns the result of the expression, so you may need to adjust the test accordingly.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 2: Fix `Robot.Ui.Anime Settings.Regenerate NFO`
|
|
||||||
|
|
||||||
**Test File:** `tests/robot/ui/anime_settings.robot`
|
|
||||||
|
|
||||||
**Error:**
|
|
||||||
```
|
|
||||||
No keyword with name 'Execute JavaScript' found.
|
|
||||||
```
|
|
||||||
|
|
||||||
**Same fix as Task 1.** Apply the same replacement for `Execute JavaScript` → `Evaluate JavaScript`.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Task 3: Fix `Robot.Ui.Anime Settings.Update Series Settings`
|
## Task 3: Fix `Robot.Ui.Anime Settings.Update Series Settings`
|
||||||
|
|
||||||
**Test File:** `tests/robot/ui/anime_settings.robot`
|
**Test File:** `tests/robot/ui/anime_settings.robot`
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ Edit Backup Settings
|
|||||||
[Documentation] Toggle backup enabled and change path/retention.
|
[Documentation] Toggle backup enabled and change path/retention.
|
||||||
Open Settings Modal
|
Open Settings Modal
|
||||||
# Backup section is below other sections - scroll to make it visible
|
# Backup section is below other sections - scroll to make it visible
|
||||||
Execute JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
||||||
Wait For Elements State id=backup-enabled visible timeout=5s
|
Wait For Elements State id=backup-enabled visible timeout=5s
|
||||||
Check Checkbox id=backup-enabled
|
Check Checkbox id=backup-enabled
|
||||||
Fill Text id=backup-path /tmp/aniworld_backups
|
Fill Text id=backup-path /tmp/aniworld_backups
|
||||||
@@ -107,7 +107,7 @@ Edit NFO Settings
|
|||||||
[Documentation] Enter TMDB key and toggle auto-create/media downloads.
|
[Documentation] Enter TMDB key and toggle auto-create/media downloads.
|
||||||
Open Settings Modal
|
Open Settings Modal
|
||||||
# NFO section is below other sections - scroll to make it visible
|
# NFO section is below other sections - scroll to make it visible
|
||||||
Execute JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
||||||
Wait For Elements State id=nfo-auto-create visible timeout=5s
|
Wait For Elements State id=nfo-auto-create visible timeout=5s
|
||||||
Fill Text id=tmdb-api-key test_tmdb_key_123
|
Fill Text id=tmdb-api-key test_tmdb_key_123
|
||||||
Check Checkbox id=nfo-auto-create
|
Check Checkbox id=nfo-auto-create
|
||||||
@@ -125,7 +125,7 @@ Create Config Backup
|
|||||||
[Documentation] Click create backup and verify success notification.
|
[Documentation] Click create backup and verify success notification.
|
||||||
Open Settings Modal
|
Open Settings Modal
|
||||||
# Scroll to bottom to make the create-config-backup button visible
|
# Scroll to bottom to make the create-config-backup button visible
|
||||||
Execute JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
Evaluate JavaScript document.querySelector('#config-modal .modal-body').scrollTop = 10000
|
||||||
Wait For Elements State id=create-config-backup visible timeout=5s
|
Wait For Elements State id=create-config-backup visible timeout=5s
|
||||||
Click id=create-config-backup
|
Click id=create-config-backup
|
||||||
# Backup creation shows toast (stub implementation - no actual file created)
|
# Backup creation shows toast (stub implementation - no actual file created)
|
||||||
|
|||||||
Reference in New Issue
Block a user