14 changed files with 248 additions and 83 deletions
@ -1,13 +1,5 @@
|
||||
@page "/" |
||||
|
||||
@inject ITrackingNavigationState TrackingNavigationState |
||||
@inject IAnalytics GlobalTracking |
||||
|
||||
@layout PageLayout |
||||
|
||||
<DevOnlyComponent> |
||||
<LinkButtonComponent Href="https://github.com/JonathanMcCaffrey/IGP-Fan-Reference/blob/main/IGP/Pages/HarassCalculatorPage.razor"> |
||||
View on GitHub <i class="fa-brands fa-github" style="font-size: 24px; margin-left: 5px;"></i> |
||||
</LinkButtonComponent> |
||||
</DevOnlyComponent> |
||||
<HomePage/> |
||||
@ -0,0 +1,29 @@
|
||||
using TestAutomation.Shared; |
||||
using TestAutomation.Utils; |
||||
|
||||
namespace TestAutomation.Pages; |
||||
|
||||
public abstract class BasePage : BaseElement |
||||
{ |
||||
protected BasePage(Website website) : base(website) |
||||
{ |
||||
} |
||||
|
||||
private IEnumerable<string> Links => |
||||
Website.FindAllWithTag(Website.Find("content"), "a") |
||||
.Select(x => x.GetAttribute("href")); |
||||
|
||||
public abstract string Url { get; set; } |
||||
|
||||
public IEnumerable<string> GetLinks() |
||||
{ |
||||
try |
||||
{ |
||||
return Links; |
||||
} |
||||
catch (Exception e) |
||||
{ |
||||
throw new Exception($"Couldn't get links on page {Url}"); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,31 @@
|
||||
namespace TestAutomation; |
||||
|
||||
[TestFixture] |
||||
public class TestLinks : BaseTest |
||||
{ |
||||
|
||||
[SetUp] |
||||
public void SetUp() |
||||
{ |
||||
TestReport.CreateTest(); |
||||
} |
||||
|
||||
[TearDown] |
||||
public void TearDown() |
||||
{ |
||||
TestReport.ThrowErrors(); |
||||
} |
||||
|
||||
[Test] |
||||
public void VerifyPageLinks() |
||||
{ |
||||
Website.HarassCalculatorPage.Goto(); |
||||
TestReport.VerifyLinks(Website.HarassCalculatorPage).Wait(); |
||||
|
||||
Website.DatabasePage.Goto(); |
||||
TestReport.VerifyLinks(Website.DatabasePage).Wait(); |
||||
|
||||
Website.DatabaseSinglePage.Goto("throne"); |
||||
TestReport.VerifyLinks(Website.DatabaseSinglePage).Wait(); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue