test(BrokenLinks) Now checking for broken links on a few pages

This commit is contained in:
2022-05-02 18:48:46 -04:00
parent 543ba97a3b
commit c16c0172bc
14 changed files with 247 additions and 82 deletions
+29
View File
@@ -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}");
}
}
}