26 lines
795 B
C#
26 lines
795 B
C#
using NUnit.Framework;
|
|
using AOW4.SeleniumTests.Pages;
|
|
|
|
namespace AOW4.SeleniumTests.Tests;
|
|
|
|
[TestFixture]
|
|
public class NavigationTests : BaseTest
|
|
{
|
|
[TestCase("Home", "/")]
|
|
[TestCase("Counter", "/counter")]
|
|
[TestCase("Weather", "/weather")]
|
|
public void ClickNavLink_NavigatesToPage(string linkText, string expectedPath)
|
|
{
|
|
GoHome();
|
|
|
|
var nav = new NavMenuPage(Driver);
|
|
nav.ClickLinkByText(linkText);
|
|
|
|
// small wait for navigation
|
|
System.Threading.Thread.Sleep(700);
|
|
|
|
Assert.IsTrue(Driver.Url.Contains(expectedPath, System.StringComparison.OrdinalIgnoreCase) || Driver.PageSource.Contains(linkText),
|
|
$"Expected to be on route containing '{expectedPath}' after clicking '{linkText}', but was '{Driver.Url}'");
|
|
}
|
|
}
|