File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ Make ``upload_vumark_template `` return the ID of the target it uploaded.
2+ It now waits for VWS to finish processing the target, which takes longer
3+ than waiting for the target to appear in the targets table.
Original file line number Diff line number Diff line change @@ -610,8 +610,14 @@ def upload_vumark_template(
610610 svg_file_path : Path ,
611611 template_name : str ,
612612 width : float ,
613- ) -> None :
614- """Upload a VuMark SVG template to a VuMark database."""
613+ ) -> str :
614+ """Upload a VuMark SVG template to a VuMark database.
615+
616+ Returns:
617+ The ID of the uploaded target. Waiting for the ID means waiting
618+ for VWS to finish processing the target, which takes longer than
619+ waiting for the target to appear in the targets table.
620+ """
615621 navigate_to_database (driver = driver , database_name = database_name )
616622
617623 thirty_second_wait = WebDriverWait (
@@ -687,6 +693,17 @@ def upload_vumark_template(
687693 ),
688694 )
689695
696+ wait_for_vumark_target_link (
697+ driver = driver ,
698+ database_name = database_name ,
699+ target_name = template_name ,
700+ )
701+ return get_vumark_target_id (
702+ driver = driver ,
703+ database_name = database_name ,
704+ target_name = template_name ,
705+ )
706+
690707
691708@beartype
692709def _xpath_literal (
Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ def test_upload_vumark_template(
376376 assert test_file_path is not None
377377 svg_path = test_file_path .parent / "fixtures" / "vumark_template.svg"
378378 template_name = f"template-{ random_str } "
379- vws_web_tools .upload_vumark_template (
379+ target_id = vws_web_tools .upload_vumark_template (
380380 driver = chrome_driver ,
381381 database_name = database_name ,
382382 svg_file_path = svg_path ,
@@ -385,6 +385,9 @@ def test_upload_vumark_template(
385385 )
386386
387387 assert template_name in chrome_driver .page_source
388+ expected_target_id_length = 32
389+ assert len (target_id ) == expected_target_id_length
390+ assert target_id .isalnum ()
388391
389392
390393def test_upload_vumark_template_cli (
You can’t perform that action at this time.
0 commit comments