42 lines
2.0 KiB
Plaintext
42 lines
2.0 KiB
Plaintext
*** Settings ***
|
|
Documentation WebSocket API tests for Aniworld.
|
|
... Covers connection, room subscription, ping/pong, and notifications.
|
|
|
|
Resource ${CURDIR}/../resources/common.resource
|
|
Resource ${CURDIR}/../resources/api_keywords.resource
|
|
|
|
Test Setup Run Keywords
|
|
... Create Anonymous Session
|
|
... AND Setup Master Password
|
|
... AND Create Authenticated Session
|
|
|
|
Test Teardown Delete All Sessions
|
|
|
|
*** Test Cases ***
|
|
# ---------------------------------------------------------------------------
|
|
# WebSocket Connection
|
|
# ---------------------------------------------------------------------------
|
|
Connect To WebSocket
|
|
[Documentation] Establish a WebSocket connection with a valid JWT token.
|
|
${token}= Login And Get Token
|
|
${ws_url}= Set Variable ws://${SERVER_HOST}:${SERVER_PORT}/ws/connect?token=${token}
|
|
${result}= Evaluate __import__('asyncio').run(__import__('websockets').connect('${ws_url}'))
|
|
# Note: Full WebSocket testing requires a custom Python keyword library
|
|
# or using Browser library's Evaluate with inline JavaScript.
|
|
Pass Execution WebSocket connection test requires custom keyword library
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Placeholder for WebSocket Room Subscription
|
|
# ---------------------------------------------------------------------------
|
|
Subscribe To Rooms
|
|
[Documentation] Subscribe to WebSocket rooms (downloads, queue, scan, system).
|
|
Pass Execution WebSocket room subscription requires custom keyword library
|
|
|
|
Receive Ping Pong
|
|
[Documentation] Verify WebSocket heartbeat mechanism.
|
|
Pass Execution WebSocket ping/pong requires custom keyword library
|
|
|
|
Receive System Notification
|
|
[Documentation] Trigger an action that emits a system message and verify receipt.
|
|
Pass Execution WebSocket notification requires custom keyword library
|