File tree Expand file tree Collapse file tree
src/frontend/tests/core/features Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,16 +62,24 @@ test(
6262 checked : false ,
6363 } ) ;
6464 await expect ( page . getByTestId ( "rf__wrapper" ) ) . toBeVisible ( ) ;
65+
66+ // The publish-switch toggle is confirmed in the UI above, but the
67+ // un-publish has to reach the backend before the shareable URL stops
68+ // resolving — give it time to propagate.
69+ await page . waitForTimeout ( ANIMATIONS . publishTogglePropagation ) ;
70+
6571 await page . goto ( newUrl ) ;
66- try {
67- await expect ( page . getByTestId ( TID . mainpageTitle ) ) . toBeVisible ( {
68- timeout : TIMEOUTS . medium ,
69- } ) ;
70- } catch ( _error ) {
71- await page . reload ( ) ;
72- await expect ( page . getByTestId ( TID . mainpageTitle ) ) . toBeVisible ( {
73- timeout : TIMEOUTS . medium ,
74- } ) ;
75- }
72+
73+ // An un-published playground URL redirects to the projects page:
74+ // PlaygroundPage detects access_type !== "PUBLIC" and navigates to
75+ // "/". The redirect is client-side and the subsequent app bootstrap
76+ // can be slow on CI, so wait for the URL to leave /playground/
77+ // before asserting the projects page rendered.
78+ await page . waitForURL ( ( url ) => ! url . pathname . startsWith ( "/playground/" ) , {
79+ timeout : TIMEOUTS . long ,
80+ } ) ;
81+ await expect ( page . getByTestId ( TID . mainpageTitle ) ) . toBeVisible ( {
82+ timeout : TIMEOUTS . long ,
83+ } ) ;
7684 } ,
7785) ;
You can’t perform that action at this time.
0 commit comments