@@ -456,9 +456,14 @@ def _open_with_resources(page: Page, *, click_it: bool):
456456def _select_service_version (page : Page , * , version : str ) -> None :
457457 try :
458458 # since https://github.com/ITISFoundation/osparc-simcore/pull/7060
459- page .get_by_test_id ("serviceSelectBox" ).select_option (
460- f"serviceVersionItem_{ version } "
461- )
459+ with log_context (logging .INFO , msg = f"selecting version { version } " ):
460+ page .get_by_test_id ("serviceSelectBox" ).click (timeout = 5 * SECOND )
461+ with page .expect_response (
462+ re .compile (r"/catalog/services/.+/resources" ), timeout = 1.5 * 5 * SECOND
463+ ):
464+ page .get_by_test_id (f"serviceVersionItem_{ version } " ).click (
465+ timeout = 5 * SECOND
466+ )
462467 except TimeoutError :
463468 # we try the non robust way
464469 page .get_by_label ("Version" ).select_option (version )
@@ -480,8 +485,7 @@ def create_new_project_and_delete(
480485 created_project_uuids = []
481486
482487 def _ (
483- expected_states : tuple [RunningState ] = (RunningState .NOT_STARTED ,),
484- * ,
488+ expected_states : tuple [RunningState ],
485489 press_open : bool ,
486490 template_id : str | None ,
487491 service_version : str | None ,
@@ -509,8 +513,6 @@ def _(
509513 ):
510514 open_with_resources_clicked = False
511515 # Project detail view pop-ups shows
512- if service_version is not None :
513- _select_service_version (page , version = service_version )
514516 if press_open :
515517 open_button = page .get_by_test_id ("openResource" )
516518 if template_id is not None :
@@ -559,6 +561,8 @@ def wait_for_done(response):
559561 # not expected in the sim4life context though
560562 ...
561563 else :
564+ if service_version is not None :
565+ _select_service_version (page , version = service_version )
562566 open_button .click ()
563567 if is_product_billable :
564568 _open_with_resources (page , click_it = True )
0 commit comments