File tree Expand file tree Collapse file tree 1 file changed +18
-28
lines changed
src/lightning_app/testing Expand file tree Collapse file tree 1 file changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -386,34 +386,24 @@ def run_app_in_cloud(
386
386
process = Process (target = _print_logs , kwargs = {"app_id" : app_id })
387
387
process .start ()
388
388
389
- if not app .spec .is_headless :
390
- while True :
391
- try :
392
- with admin_page .context .expect_page () as page_catcher :
393
- admin_page .locator ('[data-cy="open"]' ).click ()
394
- view_page = page_catcher .value
395
- view_page .wait_for_load_state (timeout = 0 )
396
- break
397
- except (playwright ._impl ._api_types .Error , playwright ._impl ._api_types .TimeoutError ):
398
- pass
399
- else :
400
- view_page = None
401
-
402
- # Wait until the app is running
403
- while True :
404
- sleep (1 )
405
-
406
- lit_apps = [
407
- app
408
- for app in client .lightningapp_instance_service_list_lightningapp_instances (
409
- project_id = project .project_id
410
- ).lightningapps
411
- if app .name == name
412
- ]
413
- app = lit_apps [0 ]
414
-
415
- if app .status .phase == V1LightningappInstanceState .RUNNING :
416
- break
389
+ # Wait until the app is running
390
+ while True :
391
+ sleep (1 )
392
+
393
+ lit_apps = [
394
+ app
395
+ for app in client .lightningapp_instance_service_list_lightningapp_instances (
396
+ project_id = project .project_id
397
+ ).lightningapps
398
+ if app .name == name
399
+ ]
400
+ app = lit_apps [0 ]
401
+
402
+ if app .status .phase == V1LightningappInstanceState .RUNNING :
403
+ break
404
+
405
+ view_page = context .new_page ()
406
+ view_page .goto (f"{ app .status .url } /view" )
417
407
418
408
# TODO: is re-creating this redundant?
419
409
lit_apps = [
You can’t perform that action at this time.
0 commit comments