@@ -66,8 +66,9 @@ <h5 class="modal-title" id="triggerTestRunModalLabel">Trigger Test Run</h5>
6666 </ div >
6767
6868 < div class ="mb-3 ">
69- < label for ="testSuiteName " class ="form-label "> Test suite</ label >
70- < input type ="text " name ="name " class ="form-control " id ="testSuiteName ">
69+ < label for ="testSuiteSelect " class ="form-label "> Test suite</ label >
70+ < select name ="testSuite " class ="form-select " id ="testSuiteSelect ">
71+ </ select >
7172 </ div >
7273
7374 < div class ="mb-3 ">
@@ -226,8 +227,37 @@ <h6>Test Results</h6>
226227 console . error ( "Failed to fetch configs:" , err ) ;
227228 configSelect . innerHTML = '<option disabled>Error loading configs</option>' ;
228229 }
230+
231+ updateTestSuiteList ( ) ;
229232 }
230233
234+ async function updateTestSuiteList ( ) {
235+ const testSuiteSelect = document . getElementById ( "testSuiteSelect" ) ;
236+ testSuiteSelect . innerHTML = '<option disabled>Loading...</option>' ;
237+ const configSelect = document . getElementById ( 'configSelect' ) ;
238+ const config = configSelect . value ;
239+
240+ try {
241+ // Fetch configs from the local controller
242+ const resp = await fetch ( `/api/v1/configs/${ config } /test-suites` ) ;
243+ if ( ! resp . ok ) throw new Error ( `HTTP ${ resp . status } ` ) ;
244+ const suites = await resp . json ( ) ;
245+
246+ testSuiteSelect . innerHTML = '<option value="">(all)</option>' ;
247+ suites . forEach ( s => {
248+ const opt = document . createElement ( 'option' ) ;
249+ opt . value = s ;
250+ opt . textContent = s ;
251+ testSuiteSelect . appendChild ( opt ) ;
252+ } ) ;
253+ } catch ( err ) {
254+ console . error ( "Failed to fetch test suites:" , err ) ;
255+ configSelect . innerHTML = '<option disabled>Error loading test suites</option>' ;
256+ }
257+ }
258+
259+ document . getElementById ( "configSelect" ) . addEventListener ( "input" , updateTestSuiteList ) ;
260+
231261 const modal = document . getElementById ( 'triggerTestRunModal' ) ;
232262 modal . addEventListener ( 'show.bs.modal' , updateConfigList ) ;
233263
@@ -241,7 +271,7 @@ <h6>Test Results</h6>
241271 document . getElementById ( 'triggerRunForm' ) . addEventListener ( 'submit' , async ( e ) => {
242272 e . preventDefault ( ) ;
243273 const config = document . getElementById ( 'configSelect' ) . value ;
244- const testSuite = document . getElementById ( 'testSuiteName ' ) . value ;
274+ const testSuite = document . getElementById ( 'testSuiteSelect ' ) . value ;
245275 const overrides = document . getElementById ( 'overrides' ) . value ;
246276
247277 try {
0 commit comments