- Remove completed Task 25 from docs - Add Suite Setup/Teardown with Start Aniworld Server and browser init - Update element IDs to match current UI (password, strength-text, name, directory, etc.) - Update form validation and complete setup flow tests with new selectors - Add redirect testing after setup complete
122 lines
5.4 KiB
Plaintext
122 lines
5.4 KiB
Plaintext
*** Settings ***
|
|
Documentation Setup flow UI tests for Aniworld.
|
|
... Covers setup page load, password strength, form validation, and complete setup submission.
|
|
|
|
Library Process
|
|
Library Browser
|
|
|
|
Suite Setup Run Keywords
|
|
... Start Aniworld Server
|
|
... AND Create Anonymous Session
|
|
... AND Wait For Server
|
|
... AND Initialize Browser
|
|
|
|
Suite Teardown Run Keywords
|
|
... Close Browser
|
|
... AND Stop Aniworld Server
|
|
|
|
Resource ${CURDIR}/../resources/common.resource
|
|
Resource ${CURDIR}/../resources/ui_keywords.resource
|
|
|
|
Test Setup Run Keywords
|
|
... Open Browser To Page /setup
|
|
... AND Wait For Elements State id=setup-form visible timeout=5s
|
|
|
|
Test Teardown Close Browser
|
|
|
|
*** Test Cases ***
|
|
# ---------------------------------------------------------------------------
|
|
# Setup Page Load
|
|
# ---------------------------------------------------------------------------
|
|
Setup Page Loads
|
|
[Documentation] Verify the setup page loads with all expected sections.
|
|
Page Title Should Contain Setup
|
|
Element Should Be Visible id=setup-form
|
|
Element Should Be Visible xpath=//*[contains(@class, 'config-section')][1]
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Password Strength Indicator
|
|
# ---------------------------------------------------------------------------
|
|
Password Strength Weak
|
|
[Documentation] Type a weak password and verify the strength indicator shows weak.
|
|
Fill Text id=password weak
|
|
${strength}= Get Text id=strength-text
|
|
Should Contain Any ${strength} weak Very Weak
|
|
|
|
Password Strength Medium
|
|
[Documentation] Type a medium-strength password and verify the indicator updates.
|
|
Fill Text id=password Password1
|
|
${strength}= Get Text id=strength-text
|
|
Should Contain Any ${strength} Fair Good medium
|
|
|
|
Password Strength Strong
|
|
[Documentation] Type a strong password and verify the indicator shows strong.
|
|
Fill Text id=password ${SETUP_PASSWORD}
|
|
${strength}= Get Text id=strength-text
|
|
Should Contain Any ${strength} Strong Very Strong
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Form Validation
|
|
# ---------------------------------------------------------------------------
|
|
Setup Form Validation Empty Password
|
|
[Documentation] Submit the form with an empty password and verify error message.
|
|
Fill Text id=name TestApp
|
|
Fill Text id=directory /tmp/test
|
|
Click id=setup-button
|
|
# Page should stay on setup (not redirect) due to validation error
|
|
Wait For Elements State id=setup-form visible timeout=3s
|
|
${url}= Get Url
|
|
Should Contain ${url} /setup
|
|
|
|
Setup Form Validation Mismatched Passwords
|
|
[Documentation] Submit with mismatched password and confirmation.
|
|
Fill Text id=password ${SETUP_PASSWORD}
|
|
Fill Text id=confirm-password DifferentPass123!
|
|
Click id=setup-button
|
|
# Wait for validation - page should stay on setup
|
|
Wait For Elements State id=setup-form visible timeout=3s
|
|
${url}= Get Url
|
|
Should Contain ${url} /setup
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Complete Setup Flow
|
|
# ---------------------------------------------------------------------------
|
|
Complete Setup Flow
|
|
[Documentation] Fill all setup sections and submit, verifying redirect to main page.
|
|
Fill Text id=name AniworldTest
|
|
Fill Text id=data_dir data
|
|
Fill Text id=directory /tmp/aniworld_test_anime
|
|
Fill Text id=password ${SETUP_PASSWORD}
|
|
Fill Text id=confirm-password ${SETUP_PASSWORD}
|
|
# Disable scheduler for tests
|
|
Uncheck Checkbox id=scheduler_enabled
|
|
# Submit
|
|
Click id=setup-button
|
|
# After successful setup, app redirects to /loading?phase=initial
|
|
# Wait for either /loading page or final destination
|
|
Sleep 3s reason=Wait for redirect chain to complete
|
|
${url}= Get Url
|
|
Log Current URL after setup: ${url}
|
|
# Should eventually end up at / or /setup/unresolved or similar
|
|
Should Not Contain ${url} /setup message=Should redirect away from setup
|
|
|
|
Setup Redirects When Already Configured
|
|
[Documentation] After setup is complete, visiting /setup should redirect to /.
|
|
[Setup] NONE # Skip Test Setup - app is configured, /setup redirects
|
|
# NOTE: This test runs after Complete Setup Flow, app is configured.
|
|
# When navigating to /setup, server should redirect to /.
|
|
# First, open browser to check app state after Complete Setup Flow
|
|
New Browser ${BROWSER} headless=${HEADLESS}
|
|
New Context
|
|
New Page ${BASE_URL}/
|
|
Sleep 2s
|
|
${configured_url}= Get Url
|
|
Log URL after Complete Setup Flow: ${configured_url}
|
|
# Now test redirect - app is configured so /setup should redirect to /
|
|
New Page ${BASE_URL}/setup
|
|
Sleep 3s reason=Wait for redirect to complete
|
|
${url}= Get Url
|
|
Log Current URL after visiting /setup when configured: ${url}
|
|
# Should redirect away from /setup since already configured
|
|
Should Not Contain ${url} /setup message=Expected redirect away from /setup
|