|
|
|
|
@ -5,14 +5,27 @@ namespace TestAutomation;
|
|
|
|
|
[TestFixture] |
|
|
|
|
public class TestSearchFeatures : BaseTest |
|
|
|
|
{ |
|
|
|
|
[Test] |
|
|
|
|
public void DesktopOpenCloseSearchDialog() |
|
|
|
|
|
|
|
|
|
[SetUp] |
|
|
|
|
public void SetUp() |
|
|
|
|
{ |
|
|
|
|
TestReport.CreateTest(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/"); |
|
|
|
|
[TearDown] |
|
|
|
|
public void TearDown() |
|
|
|
|
{ |
|
|
|
|
TestReport.ThrowErrors(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DesktopOpenCloseSearchDialog() |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Website.NavigationBar |
|
|
|
|
Website |
|
|
|
|
.Goto() |
|
|
|
|
.NavigationBar |
|
|
|
|
.ClickSearchButton() |
|
|
|
|
.CloseDialog() |
|
|
|
|
.ClickHomeLink(); |
|
|
|
|
@ -21,12 +34,10 @@ public class TestSearchFeatures : BaseTest
|
|
|
|
|
[Test] |
|
|
|
|
public void DesktopSearchForThrone() |
|
|
|
|
{ |
|
|
|
|
TestReport.CreateTest(); |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/"); |
|
|
|
|
|
|
|
|
|
Website.NavigationBar |
|
|
|
|
.ClickSearchButton() |
|
|
|
|
|
|
|
|
|
Website |
|
|
|
|
.Goto() |
|
|
|
|
.NavigationBar.ClickSearchButton() |
|
|
|
|
.Search("Throne") |
|
|
|
|
.SelectSearchEntity("Throne") |
|
|
|
|
.GetEntityName(out var name) |
|
|
|
|
@ -36,45 +47,47 @@ public class TestSearchFeatures : BaseTest
|
|
|
|
|
new TestMessage { Description = "Couldn't find Throne via search." }); |
|
|
|
|
TestReport.CheckPassed(!health.Trim().Equals(""), |
|
|
|
|
new TestMessage { Description = "Throne has no visible health!" }); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DesktopFilterForThrone() |
|
|
|
|
{ |
|
|
|
|
TestReport.CreateTest(); |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Website.DatabasePage |
|
|
|
|
.Goto() |
|
|
|
|
.FilterName("Throne") |
|
|
|
|
.GetEntityName(0, out var name); |
|
|
|
|
|
|
|
|
|
TestReport.CheckPassed(name.Equals("Throne"), |
|
|
|
|
new TestMessage { Description = "Couldn't find Throne via filter." }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void SeeThroneByDefault() |
|
|
|
|
{ |
|
|
|
|
TestReport.CreateTest(); |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Website.DatabasePage |
|
|
|
|
.Goto() |
|
|
|
|
.GetEntityName("army", "throne", out var name); |
|
|
|
|
|
|
|
|
|
TestReport.CheckPassed(name.Equals("Throne"), |
|
|
|
|
new TestMessage { Description = "Couldn't find Throne on the page by default." }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void DirectLinkNotThroneFailure() |
|
|
|
|
{ |
|
|
|
|
TestReport.CreateTest(); |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database/not throne"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Website.DatabaseSinglePage |
|
|
|
|
.Goto("not throne") |
|
|
|
|
.GetInvalidSearch(out var invalidSearch) |
|
|
|
|
.GetValidSearch(out var validSearch); |
|
|
|
|
|
|
|
|
|
@ -82,7 +95,7 @@ public class TestSearchFeatures : BaseTest
|
|
|
|
|
new TestMessage { Description = "Couldn't find invalid search text on the page." }); |
|
|
|
|
TestReport.CheckPassed(validSearch.Equals("Throne"), |
|
|
|
|
new TestMessage { Description = "Couldn't find valid search text on the page." }); |
|
|
|
|
|
|
|
|
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database/not throne"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |