File tree Expand file tree Collapse file tree
src/Core/Compatibility/Handlers/Shell/iOS
tests/TestCases.Shared.Tests/Tests/Issues Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,6 +143,12 @@ internal bool SendPop()
143143 return false ;
144144 }
145145
146+ // Allow the page to intercept back navigation via OnBackButtonPressed
147+ if ( tracker . Value . Page ? . SendBackButtonPressed ( ) == true )
148+ {
149+ return false ;
150+ }
151+
146152 break ;
147153 }
148154 }
Original file line number Diff line number Diff line change 1- #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_IOS // Issue: https://github.com/dotnet/maui/issues/34190
2-
31using NUnit . Framework ;
42using UITest . Appium ;
53using UITest . Core ;
@@ -26,19 +24,20 @@ public void OnBackButtonPressedShouldFireForShellNavigationBarButton()
2624 // Verify initial state
2725 var statusLabel = App . WaitForElement ( "StatusLabel" ) ;
2826 Assert . That ( statusLabel . GetText ( ) , Is . EqualTo ( "OnBackButtonPressed not called" ) ) ;
29-
27+ #if IOS || MACCATALYST
28+ App . TapBackArrow ( "Main Page" ) ;
29+ #else
3030 // Tap the navigation bar back button
3131 // Note: This uses the Shell's navigation bar back button, not the system back button
3232 App . TapBackArrow ( ) ;
33-
33+ #endif
3434 // Wait a moment for the event to fire
3535 App . WaitForElement ( "StatusLabel" ) ;
3636
3737 // Verify OnBackButtonPressed was called
3838 statusLabel = App . FindElement ( "StatusLabel" ) ;
39- Assert . That ( statusLabel . GetText ( ) , Is . EqualTo ( "OnBackButtonPressed was called" ) ,
39+ Assert . That ( statusLabel . GetText ( ) , Is . EqualTo ( "OnBackButtonPressed was called" ) ,
4040 "OnBackButtonPressed should be called when tapping the Shell Navigation Bar back button" ) ;
4141 }
4242 }
4343}
44- #endif
You can’t perform that action at this time.
0 commit comments