22Documentation Client and Queue Management API Tests
33Library RequestsLibrary
44Library Collections
5- Resource ../setup/setup_keywords .robot
6- Resource ../setup/teardown_keywords .robot
7- Resource ../resources/user_keywords .robot
5+ Resource ../resources/setup_resources .robot
6+ Resource ../resources/session_resources .robot
7+ Resource ../resources/user_resources .robot
88Suite Setup Suite Setup
99Suite Teardown Delete All Sessions
10- Test Setup Test Cleanup
10+
1111*** Test Cases ***
1212
1313Get Active Clients Test
1414 [Documentation] Test getting active client information
15- [Tags] infra
15+ [Tags] client active positive
1616
1717 Create API Session admin_session
1818 ${response } = GET On Session admin_session /api/clients/active
@@ -30,7 +30,7 @@ Get Active Clients Test
3030
3131Get Queue Jobs Test
3232 [Documentation] Test getting queue jobs with pagination
33- [Tags] queue
33+ [Tags] queue jobs positive
3434
3535 Create API Session admin_session
3636 &{params } = Create Dictionary limit=20 offset=0
@@ -52,7 +52,7 @@ Get Queue Jobs Test
5252
5353Get Queue Jobs With Different Limits Test
5454 [Documentation] Test queue jobs pagination with different limits
55- [Tags] queue
55+ [Tags] queue jobs pagination positive
5656 Get Anonymous Session anon_session
5757
5858 Create API Session admin_session
@@ -77,45 +77,53 @@ Get Queue Jobs With Different Limits Test
7777
7878Get Queue Statistics Test
7979 [Documentation] Test getting queue statistics
80- [Tags] queue
80+ [Tags] queue statistics positive
81+ Get Anonymous Session anon_session
82+
83+ Create API Session admin_session
8184
82- ${response } = GET On Session api /api/queue/stats
85+ ${response } = GET On Session admin_session /api/queue/stats
8386 Should Be Equal As Integers ${response.status_code } 200
8487
8588 ${stats } = Set Variable ${response.json() }
86- Dictionary Should Contain Key ${stats } queued_jobs
87- Dictionary Should Contain Key ${stats } processing_jobs
88- Dictionary Should Contain Key ${stats } completed_jobs
89- Dictionary Should Contain Key ${stats } failed_jobs
90- Dictionary Should Contain Key ${stats } total_jobs
91- Dictionary Should Contain Key ${stats } cancelled_jobs
92- Dictionary Should Contain Key ${stats } deferred_jobs
89+ Dictionary Should Contain Key ${stats } queued
90+ Dictionary Should Contain Key ${stats } processing
91+ Dictionary Should Contain Key ${stats } completed
92+ Dictionary Should Contain Key ${stats } failed
9393
94+ # All counts should be non-negative
95+ Should Be True ${stats } [queued] >= 0
96+ Should Be True ${stats } [processing] >= 0
97+ Should Be True ${stats } [completed] >= 0
98+ Should Be True ${stats } [failed] >= 0
9499
95100Get Queue Health Test
96101 [Documentation] Test getting queue health status
97- [Tags] queue health
102+ [Tags] queue health positive
103+ Get Anonymous Session anon_session
98104
99- ${response } = GET On Session api /api/queue/worker-details
105+ Create API Session admin_session
106+ ${response } = GET On Session admin_session /api/queue/health
100107 Should Be Equal As Integers ${response.status_code } 200
101108
102109 ${health } = Set Variable ${response.json() }
103- Dictionary Should Contain Key ${health } workers
104- Dictionary Should Contain Key ${health } redis_connection
110+ Dictionary Should Contain Key ${health } status
111+ Dictionary Should Contain Key ${health } worker_running
112+ Dictionary Should Contain Key ${health } message
105113
106114 # Status should be one of expected values
107- Should Be True '${health } [redis_connection ]' in ['healthy', 'stopped', 'unhealthy']
115+ Should Be True '${health } [status ]' in ['healthy', 'stopped', 'unhealthy']
108116
109117Queue Jobs User Isolation Test
110118 [Documentation] Test that regular users only see their own queue jobs
111- [Tags] queue permissions
119+ [Tags] queue security isolation
112120 Get Anonymous Session anon_session
113121
114122 Create API Session admin_session
115123
116124 # Create a test user
117- ${test_user } = Create Test User admin_session
118- Create API Session user_session email=${ test_user } [email] password=${ TEST_USER_PASSWORD }
125+ ${test_user } = Create Test User admin_session test-user- ${ RANDOM_ID } @example.com test-password-123
126+ Create API Session user_session email=test-user- ${ RANDOM_ID } @example.com password=test-password-123
119127
120128 # Get user's jobs (should be filtered to their user_id)
121129 ${response } = GET On Session user_session /api/queue/jobs
@@ -132,11 +140,11 @@ Queue Jobs User Isolation Test
132140 END
133141
134142 # Cleanup
135- Delete User admin_session ${test_user } [id ]
143+ Delete Test User ${test_user } [user_id ]
136144
137145Invalid Queue Parameters Test
138146 [Documentation] Test queue endpoints with invalid parameters
139- [Tags] queue
147+ [Tags] queue negative validation
140148 Get Anonymous Session anon_session
141149
142150 Create API Session admin_session
@@ -158,29 +166,41 @@ Invalid Queue Parameters Test
158166
159167Unauthorized Client Access Test
160168 [Documentation] Test that client endpoints require authentication
161- [Tags] infra permissions
169+ [Tags] client security negative
162170 Get Anonymous Session session
163171
164172 # Try to access active clients without token
165- ${response } = GET On Session session /api/clients/active expected_status=401
173+ ${response } = GET On Session ${ session } /api/clients/active expected_status=401
166174 Should Be Equal As Integers ${response.status_code } 401
167175
168176Unauthorized Queue Access Test
169177 [Documentation] Test that queue endpoints require authentication
170- [Tags] queue permissions
178+ [Tags] queue security negative
171179 Get Anonymous Session session
172180
173181 # Try to access queue jobs without token
174- ${response } = GET On Session session /api/queue/jobs expected_status=401
182+ ${response } = GET On Session ${ session } /api/queue/jobs expected_status=401
175183 Should Be Equal As Integers ${response.status_code } 401
176184
177185 # Try to access queue stats without token
178- ${response } = GET On Session session /api/queue/stats expected_status=401
186+ ${response } = GET On Session ${ session } /api/queue/stats expected_status=401
179187 Should Be Equal As Integers ${response.status_code } 401
180188
189+ Queue Health Public Access Test
190+ [Documentation] Test that queue health endpoint is publicly accessible
191+ [Tags] queue health public
192+ Get Anonymous Session session
193+
194+ # Queue health should be accessible without authentication
195+ ${response } = GET On Session ${session } /api/queue/health
196+ Should Be Equal As Integers ${response.status_code } 200
197+
198+ ${health } = Set Variable ${response.json() }
199+ Dictionary Should Contain Key ${health } status
200+
181201Client Manager Integration Test
182202 [Documentation] Test client manager functionality
183- [Tags] infra e2e
203+ [Tags] client manager integration
184204 Get Anonymous Session anon_session
185205
186206 Create API Session admin_session
0 commit comments