@@ -48,20 +48,21 @@ def run_tests(page, competition, submission, expected_result="Finished") -> None
4848 expect (page .get_by_role ("cell" , name = finished_or_failed )).to_be_visible (timeout = 2000 )
4949 # Then we actually check if we got the expected result
5050 expect (page .get_by_role ("cell" , name = expected_result )).to_be_visible ()
51- # Add to leaderboard and see if shows
52- text = page .locator (".submission_row" ).first .inner_text ()
53- submission_Id = text .split (None , 1 )
54- try :
55- page .locator ("td:nth-child(6) > span > .icon" ).first .click (timeout = 300 )
56- except :
57- page .locator ("td:nth-child(7) > span > .icon" ).first .click (timeout = 300 )
58- page .locator ("div" ).filter (has_text = re .compile (r"^Results$" )).click ()
59- expect (
60- page .locator ("#leaderboardTable" ).get_by_role (
61- "link" , name = data ["default_user" ]["username" ]
62- )
63- ).to_be_visible ()
64- expect (page .get_by_role ("cell" , name = submission_Id [0 ], exact = True )).to_be_visible ()
51+ if expected_result == "Finished" :
52+ # Add to leaderboard and see if shows
53+ text = page .locator (".submission_row" ).first .inner_text ()
54+ submission_Id = text .split (None , 1 )
55+ try :
56+ page .locator ("td:nth-child(6) > span > .icon" ).first .click (timeout = 300 )
57+ except :
58+ page .locator ("td:nth-child(7) > span > .icon" ).first .click (timeout = 300 )
59+ page .locator ("div" ).filter (has_text = re .compile (r"^Results$" )).click ()
60+ expect (
61+ page .locator ("#leaderboardTable" ).get_by_role (
62+ "link" , name = data ["default_user" ]["username" ]
63+ )
64+ ).to_be_visible ()
65+ expect (page .get_by_role ("cell" , name = submission_Id [0 ], exact = True )).to_be_visible ()
6566
6667
6768def test_v2_code (page : Page ):
0 commit comments