@@ -1411,4 +1411,41 @@ public void NavigatesWithInteractivityByRequestRedirection(bool controlFlowByExc
14111411 Browser . Click ( By . Id ( "redirectButton" ) ) ;
14121412 Browser . Equal ( "Routing test cases" , ( ) => Browser . Exists ( By . Id ( "test-info" ) ) . Text ) ;
14131413 }
1414+
1415+ [ Theory ]
1416+ // prerendering (SSR) is tested in NoInteractivityTest
1417+ [ InlineData ( "ServerNonPrerendered" ) ]
1418+ [ InlineData ( "WebAssemblyNonPrerendered" ) ]
1419+ public void ProgrammaticNavigationToNotExistingPathReExecutesTo404 ( string renderMode )
1420+ {
1421+ Navigate ( $ "{ ServerPathBase } /reexecution/redirection-not-found?render-mode={ renderMode } &navigate-programmatically=true") ;
1422+ Assert404ReExecuted ( ) ;
1423+ }
1424+
1425+ [ Theory ]
1426+ // prerendering (SSR) is tested in NoInteractivityTest
1427+ [ InlineData ( "ServerNonPrerendered" ) ]
1428+ [ InlineData ( "WebAssemblyNonPrerendered" ) ]
1429+ public void LinkNavigationToNotExistingPathReExecutesTo404 ( string renderMode )
1430+ {
1431+ Navigate ( $ "{ ServerPathBase } /reexecution/redirection-not-found?render-mode={ renderMode } ") ;
1432+ Browser . Click ( By . Id ( "link-to-not-existing-page" ) ) ;
1433+ Assert404ReExecuted ( ) ;
1434+ }
1435+
1436+ [ Theory ]
1437+ // prerendering (SSR) is tested in NoInteractivityTest
1438+ [ InlineData ( "ServerNonPrerendered" ) ]
1439+ [ InlineData ( "WebAssemblyNonPrerendered" ) ]
1440+ public void BrowserNavigationToNotExistingPathReExecutesTo404 ( string renderMode )
1441+ {
1442+ // non-existing path has to have re-execution middleware set up
1443+ // so it has to have "reexecution" prefix. Otherwise middleware mapping
1444+ // will not be activated, see configuration in Startup
1445+ Navigate ( $ "{ ServerPathBase } /reexecution/not-existing-page?render-mode={ renderMode } ") ;
1446+ Assert404ReExecuted ( ) ;
1447+ }
1448+
1449+ private void Assert404ReExecuted ( ) =>
1450+ Browser . Equal ( "Welcome On Page Re-executed After Not Found Event" , ( ) => Browser . Exists ( By . Id ( "test-info" ) ) . Text ) ;
14141451}
0 commit comments