test(SearchTest) Added a test for opening and closing search dialog

This commit is contained in:
2022-04-30 00:50:46 -04:00
parent 06c0a976e8
commit 51e5bd8185
24 changed files with 476 additions and 154 deletions
+13
View File
@@ -0,0 +1,13 @@
using TestAutomation.Utils;
namespace TestAutomation.Shared;
public class BaseElement
{
protected readonly Website Website;
protected BaseElement(Website website)
{
Website = website;
}
}
+25
View File
@@ -0,0 +1,25 @@
using TestAutomation.Enums;
using TestAutomation.Utils;
namespace TestAutomation.Shared;
public class NavigationBar : BaseElement
{
public NavigationBar(Website website) : base(website) { }
private IWebElement HomeLink => Website.FindScreenSpecific("homeLink");
private IWebElement SearchButton => Website.FindScreenSpecific("searchButton");
public NavigationBar ClickHomeLink()
{
Website.Click(HomeLink);
return this;
}
public WebsiteSearchDialog ClickSearchButton()
{
Website.Click(SearchButton);
return Website.WebsiteSearchDialog;
}
}
@@ -0,0 +1,35 @@
using Discord.Rest;
using TestAutomation.Utils;
namespace TestAutomation.Shared;
public class WebsiteSearchDialog : BaseElement
{
public WebsiteSearchDialog(Website website) : base(website)
{
}
public IWebElement SearchBackground => Website.Find("searchBackground");
public IWebElement SearchInput => Website.Find("searchInput");
public NavigationBar CloseDialog()
{
Website.ClickTopLeft();
return Website.NavigationBar;
}
public WebsiteSearchDialog Search(string throne)
{
Website.EnterInput(SearchInput, throne);
return this;
}
public void SelectSearchEntity(string throne)
{
Website.Click(Website.FindButtonWithLabel(throne));
//TODO Add DatabaseSinglePage
//return Website.DatabaseSinglePage;
}
}