@@ -26,19 +26,22 @@ def run_tests_dialog(project_code: str, test_suite: pd.Series | None = None, def
2626 display_column = "test_suite" ,
2727 default_value = default_test_suite_id ,
2828 required = True ,
29+ placeholder = "Select test suite to run" ,
2930 )
30- test_suite_name : str = test_suites_df .loc [test_suites_df ["id" ] == test_suite_id , "test_suite" ].iloc [0 ]
31+ if test_suite_id :
32+ test_suite_name : str = test_suites_df .loc [test_suites_df ["id" ] == test_suite_id , "test_suite" ].iloc [0 ]
3133 testgen .whitespace (1 )
3234
33- with st .container ():
34- st .markdown (f"Run tests for the test suite **{ test_suite_name } **?" )
35- st .markdown (":material/info: _Test execution will be performed in a background process._" )
35+ if test_suite_id :
36+ with st .container ():
37+ st .markdown (f"Run tests for the test suite **{ test_suite_name } **?" )
38+ st .markdown (":material/info: _Test execution will be performed in a background process._" )
3639
37- if testgen .expander_toggle (expand_label = "Show CLI command" , key = "run_tests_dialog:keys:show-cli" ):
38- st .code (
39- f"testgen run-tests --project-key { project_code } --test-suite-key { test_suite_name } " ,
40- language = "shellSession"
41- )
40+ if testgen .expander_toggle (expand_label = "Show CLI command" , key = "run_tests_dialog:keys:show-cli" ):
41+ st .code (
42+ f"testgen run-tests --project-key { project_code } --test-suite-key { test_suite_name } " ,
43+ language = "shellSession"
44+ )
4245
4346 button_container = st .empty ()
4447 status_container = st .empty ()
@@ -47,7 +50,7 @@ def run_tests_dialog(project_code: str, test_suite: pd.Series | None = None, def
4750 with button_container :
4851 _ , button_column = st .columns ([.8 , .2 ])
4952 with button_column :
50- run_test_button = st .button ("Run Tests" , use_container_width = True )
53+ run_test_button = st .button ("Run Tests" , use_container_width = True , disabled = not test_suite_id )
5154
5255 if run_test_button :
5356 button_container .empty ()
0 commit comments