@@ -410,59 +410,54 @@ public void CanNavigateProgrammaticallyWithForceLoad()
410410 [ Fact ]
411411 public void CanNavigateProgrammaticallyValidateNoReplaceHistoryEntry ( )
412412 {
413- //This test checks if default navigation does not replace Browser history entries
413+ // This test checks if default navigation does not replace Browser history entries
414414 SetUrlViaPushState ( "/" ) ;
415415
416416 var app = Browser . MountTestComponent < TestRouter > ( ) ;
417417 var testSelector = Browser . WaitUntilTestSelectorReady ( ) ;
418418
419- app . FindElement ( By . LinkText ( "TestHistory" ) ) . Click ( ) ;
419+ app . FindElement ( By . LinkText ( "Programmatic navigation cases" ) ) . Click ( ) ;
420+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases" , StringComparison . Ordinal ) ) ;
421+ Browser . Contains ( "programmatic navigation" , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
420422
421- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory" , StringComparison . Ordinal ) ) ;
422- Browser . Equal ( "This is the test history page." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
423-
424-
425- //We navigate to the /Other page
426- //This will also test our new NavigatTo(string uri) overload (it should not replace the browser history)
423+ // We navigate to the /Other page
424+ // This will also test our new NavigatTo(string uri) overload (it should not replace the browser history)
427425 app . FindElement ( By . Id ( "do-other-navigation" ) ) . Click ( ) ;
428426 Browser . True ( ( ) => Browser . Url . EndsWith ( "/Other" , StringComparison . Ordinal ) ) ;
429427 AssertHighlightedLinks ( "Other" , "Other with base-relative URL (matches all)" ) ;
430428
429+ // After we press back, we should end up at the "/ProgrammaticNavigationCases" page so we know browser history has not been replaced
430+ // If history had been replaced we would have ended up at the "/" page
431431 Browser . Navigate ( ) . Back ( ) ;
432- //After we press back, we should end up at the "/TestHistory" page so we know browser history has not been replaced
433- //If history would have been replaced we would have ended up at the "/" page
434- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory" , StringComparison . Ordinal ) ) ;
435- AssertHighlightedLinks ( "TestHistory" ) ;
432+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases" , StringComparison . Ordinal ) ) ;
433+ AssertHighlightedLinks ( "Programmatic navigation cases" ) ;
436434
437- //For completeness, we will test if the normal NavigateTo(string uri, bool forceLoad) overload will also NOT change the browsers history
438- //So we basically repeat what we have done above
435+ // For completeness, we will test if the normal NavigateTo(string uri, bool forceLoad) overload will also
436+ // NOT change the browser's history. So we basically repeat what we have done above.
439437 app . FindElement ( By . Id ( "do-other-navigation2" ) ) . Click ( ) ;
440438 Browser . True ( ( ) => Browser . Url . EndsWith ( "/Other" , StringComparison . Ordinal ) ) ;
441439 AssertHighlightedLinks ( "Other" , "Other with base-relative URL (matches all)" ) ;
442440
443441 Browser . Navigate ( ) . Back ( ) ;
444- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory " , StringComparison . Ordinal ) ) ;
445- AssertHighlightedLinks ( "TestHistory " ) ;
442+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases " , StringComparison . Ordinal ) ) ;
443+ AssertHighlightedLinks ( "Programmatic navigation cases " ) ;
446444
447445 // Because this was client-side navigation, we didn't lose the state in the test selector
448446 Assert . Equal ( typeof ( TestRouter ) . FullName , testSelector . SelectedOption . GetAttribute ( "value" ) ) ;
449447
450448 app . FindElement ( By . Id ( "do-other-navigation-forced" ) ) . Click ( ) ;
451449 Browser . True ( ( ) => Browser . Url . EndsWith ( "/Other" , StringComparison . Ordinal ) ) ;
452450
453- //We check if we had a force load
451+ // We check if we had a force load
454452 Assert . Throws < StaleElementReferenceException > ( ( ) =>
455- {
456- testSelector . SelectedOption . GetAttribute ( "value" ) ;
457- } ) ;
453+ testSelector . SelectedOption . GetAttribute ( "value" ) ) ;
458454
459- //// But still we should be able to navigate back, and end up at the "/TestHistory " page
455+ // But still we should be able to navigate back, and end up at the "/ProgrammaticNavigationCases " page
460456 Browser . Navigate ( ) . Back ( ) ;
461- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory " , StringComparison . Ordinal ) ) ;
457+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases " , StringComparison . Ordinal ) ) ;
462458 Browser . WaitUntilTestSelectorReady ( ) ;
463459 }
464460
465-
466461 [ Fact ]
467462 public void CanNavigateProgrammaticallyWithReplaceHistoryEntry ( )
468463 {
@@ -471,20 +466,18 @@ public void CanNavigateProgrammaticallyWithReplaceHistoryEntry()
471466 var app = Browser . MountTestComponent < TestRouter > ( ) ;
472467 var testSelector = Browser . WaitUntilTestSelectorReady ( ) ;
473468
474- app . FindElement ( By . LinkText ( "TestHistory" ) ) . Click ( ) ;
475-
476- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory" , StringComparison . Ordinal ) ) ;
477- Browser . Equal ( "This is the test history page." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
469+ app . FindElement ( By . LinkText ( "Programmatic navigation cases" ) ) . Click ( ) ;
470+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases" , StringComparison . Ordinal ) ) ;
471+ Browser . Contains ( "programmatic navigation" , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
478472
479-
480- //We navigate to the /Other page, with replacehistroyentry enabled
473+ // We navigate to the /Other page, with "replace" enabled
481474 app . FindElement ( By . Id ( "do-other-navigation-replacehistoryentry" ) ) . Click ( ) ;
482475 Browser . True ( ( ) => Browser . Url . EndsWith ( "/Other" , StringComparison . Ordinal ) ) ;
483476 AssertHighlightedLinks ( "Other" , "Other with base-relative URL (matches all)" ) ;
484477
478+ // After we press back, we should end up at the "/" page so we know browser history has been replaced
479+ // If history would not have been replaced we would have ended up at the "/ProgrammaticNavigationCases" page
485480 Browser . Navigate ( ) . Back ( ) ;
486- //After we press back, we should end up at the "/" page so we know browser history has been replaced
487- //If history would not have been replaced we would have ended up at the "/TestHistory" page
488481 Browser . True ( ( ) => Browser . Url . EndsWith ( "/" , StringComparison . Ordinal ) ) ;
489482 AssertHighlightedLinks ( "Default (matches all)" , "Default with base-relative URL (matches all)" ) ;
490483
@@ -500,29 +493,24 @@ public void CanNavigateProgrammaticallyWithForceLoadAndReplaceHistoryEntry()
500493 var app = Browser . MountTestComponent < TestRouter > ( ) ;
501494 var testSelector = Browser . WaitUntilTestSelectorReady ( ) ;
502495
503- app . FindElement ( By . LinkText ( "TestHistory" ) ) . Click ( ) ;
504-
505- Browser . True ( ( ) => Browser . Url . EndsWith ( "/TestHistory" , StringComparison . Ordinal ) ) ;
506- Browser . Equal ( "This is the test history page." , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
496+ app . FindElement ( By . LinkText ( "Programmatic navigation cases" ) ) . Click ( ) ;
497+ Browser . True ( ( ) => Browser . Url . EndsWith ( "/ProgrammaticNavigationCases" , StringComparison . Ordinal ) ) ;
498+ Browser . Contains ( "programmatic navigation" , ( ) => app . FindElement ( By . Id ( "test-info" ) ) . Text ) ;
507499
508- //We navigate to the /Other page, with replacehistroyentry and forceload enabled
500+ // We navigate to the /Other page, with replacehistroyentry and forceload enabled
509501 app . FindElement ( By . Id ( "do-other-navigation-forced-replacehistoryentry" ) ) . Click ( ) ;
510502 Browser . True ( ( ) => Browser . Url . EndsWith ( "/Other" , StringComparison . Ordinal ) ) ;
511503
512- //We check if we had a force load
504+ // We check if we had a force load
513505 Assert . Throws < StaleElementReferenceException > ( ( ) =>
514- {
515- testSelector . SelectedOption . GetAttribute ( "value" ) ;
516- } ) ;
506+ testSelector . SelectedOption . GetAttribute ( "value" ) ) ;
517507
508+ // After we press back, we should end up at the "/" page so we know browser history has been replaced
518509 Browser . Navigate ( ) . Back ( ) ;
519- //After we press back, we should end up at the "/" page so we know browser history has been replaced
520510 Browser . True ( ( ) => Browser . Url . EndsWith ( "/" , StringComparison . Ordinal ) ) ;
521511 Browser . WaitUntilTestSelectorReady ( ) ;
522512 }
523513
524-
525-
526514 [ Fact ]
527515 public void ClickingAnchorWithNoHrefShouldNotNavigate ( )
528516 {
0 commit comments