31 changed files with 510 additions and 173 deletions
@ -0,0 +1,37 @@ |
|||||||
|
@inject ISearchService SearchService |
||||||
|
@inject NavigationManager NavigationManager |
||||||
|
@inject IJSRuntime JsRuntime |
||||||
|
|
||||||
|
<button id="@Id" class="searchIconButtonContainer" @onclick="ButtonClicked"> |
||||||
|
<div class="searchText"> |
||||||
|
S |
||||||
|
</div> |
||||||
|
</button> |
||||||
|
|
||||||
|
<style> |
||||||
|
.searchIconButtonContainer { |
||||||
|
background-color: var(--primary); |
||||||
|
border: 2px solid var(--primary-border); |
||||||
|
border-radius: 8px; |
||||||
|
font-weight: 800; |
||||||
|
width: 32px; |
||||||
|
padding: 5px; |
||||||
|
display: flex; |
||||||
|
flex-direction: row; |
||||||
|
justify-content: space-between; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
</style> |
||||||
|
|
||||||
|
@code { |
||||||
|
[Parameter] |
||||||
|
public RenderFragment ChildContent { get; set; } = default!; |
||||||
|
|
||||||
|
[Parameter] |
||||||
|
public string Id { get; set; } = default!; |
||||||
|
|
||||||
|
private void ButtonClicked(EventArgs eventArgs) |
||||||
|
{ |
||||||
|
SearchService.Show(); |
||||||
|
} |
||||||
|
} |
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@ |
|||||||
[{"Id":1,"Name":"Database UX Patch","Date":"2022-03-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":2,"Name":"Thrum Stats Hotfix","Date":"2022-03-12T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":3,"Name":"Memory Tester Patch","Date":"2022-03-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":4,"Name":"Hide Pyre Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":5,"Name":"Stream Patch 1","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":6,"Name":"Agile UI Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":7,"Name":"Armor Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":8,"Name":"Home Page Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":9,"Name":"Mobile Menu Hotfix 2","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":10,"Name":"Mobile Menu Hotfix","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":11,"Name":"Mobile Menu Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":12,"Name":"0.0.6.8375a Patch","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":13,"Name":"Google Tracking Hotfix","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":14,"Name":"Privacy Policy Patch","Date":"2022-02-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":15,"Name":"Home Page Quick Hotfix","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":16,"Name":"Early Agile Patch","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":17,"Name":"Form Text Rendering Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":18,"Name":"Reducing Timing Interval Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":19,"Name":"Changelog Patch","Date":"2022-02-14T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":20,"Name":"SQL Patch","Date":"2022-03-26T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":21,"Name":"Stream Patch 2","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":22,"Name":"0.0.6.8900a Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":23,"Name":"Database Links Patch","Date":"2022-04-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":24,"Name":"Open Source Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":25,"Name":"Stream Patch 3","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":26,"Name":"Notes/Docs Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":27,"Name":"Stream Patch 4","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":28,"Name":"Passive Patch","Date":"2022-04-12T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":29,"Name":"0.0.6.9121a Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":30,"Name":"Stream Patch 5","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":31,"Name":"BuildCalc Hotfix","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":32,"Name":"Search Patch","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":33,"Name":"Search Hotfix","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":34,"Name":"Stream Patch 6","Date":"2022-04-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":35,"Name":"v0.0.6.9201a Patch","Date":"2022-04-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":36,"Name":"Build Calc Free Money Hotfix","Date":"2022-04-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":37,"Name":"BuildCalc Pyre Patch","Date":"2022-04-24T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":38,"Name":"Stream Patch 7","Date":"2022-04-24T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":39,"Name":"v0.0.6.9513a Patch","Date":"2022-04-29T00:00:00","GitChangeModels":[],"Important":"True"}] |
[{"Id":1,"Name":"Database UX Patch","Date":"2022-03-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":2,"Name":"Thrum Stats Hotfix","Date":"2022-03-12T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":3,"Name":"Memory Tester Patch","Date":"2022-03-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":4,"Name":"Hide Pyre Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":5,"Name":"Stream Patch 1","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":6,"Name":"Agile UI Hotfix","Date":"2022-02-20T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":7,"Name":"Armor Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":8,"Name":"Home Page Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":9,"Name":"Mobile Menu Hotfix 2","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":10,"Name":"Mobile Menu Hotfix","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":11,"Name":"Mobile Menu Patch","Date":"2022-02-19T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":12,"Name":"0.0.6.8375a Patch","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":13,"Name":"Google Tracking Hotfix","Date":"2022-02-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":14,"Name":"Privacy Policy Patch","Date":"2022-02-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":15,"Name":"Home Page Quick Hotfix","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":16,"Name":"Early Agile Patch","Date":"2022-02-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":17,"Name":"Form Text Rendering Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":18,"Name":"Reducing Timing Interval Hotfix","Date":"2022-02-15T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":19,"Name":"Changelog Patch","Date":"2022-02-14T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":20,"Name":"SQL Patch","Date":"2022-03-26T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":21,"Name":"Stream Patch 2","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":22,"Name":"0.0.6.8900a Patch","Date":"2022-03-30T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":23,"Name":"Database Links Patch","Date":"2022-04-01T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":24,"Name":"Open Source Patch","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":25,"Name":"Stream Patch 3","Date":"2022-04-03T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":26,"Name":"Notes/Docs Patch","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":27,"Name":"Stream Patch 4","Date":"2022-04-10T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":28,"Name":"Passive Patch","Date":"2022-04-12T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":29,"Name":"0.0.6.9121a Patch","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":30,"Name":"Stream Patch 5","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":31,"Name":"BuildCalc Hotfix","Date":"2022-04-13T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":32,"Name":"Search Patch","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":33,"Name":"Search Hotfix","Date":"2022-04-16T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":34,"Name":"Stream Patch 6","Date":"2022-04-17T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":35,"Name":"v0.0.6.9201a Patch","Date":"2022-04-18T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":36,"Name":"Build Calc Free Money Hotfix","Date":"2022-04-18T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":37,"Name":"BuildCalc Pyre Patch","Date":"2022-04-24T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":38,"Name":"Stream Patch 7","Date":"2022-04-24T00:00:00","GitChangeModels":[],"Important":"False"},{"Id":39,"Name":"v0.0.6.9513a Patch","Date":"2022-04-28T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":40,"Name":"v0.0.6.9553a Patch","Date":"2022-04-29T00:00:00","GitChangeModels":[],"Important":"True"},{"Id":41,"Name":"Stream Patch 8","Date":"2022-04-29T00:00:00","GitChangeModels":[],"Important":"False"}] |
||||||
@ -1 +1 @@ |
|||||||
[{"Key":"GamePatch","Value":"v0.0.6.9513a"}] |
[{"Key":"GamePatch","Value":"v0.0.6.9553a"}] |
||||||
@ -0,0 +1,55 @@ |
|||||||
|
using TestAutomation.Utils; |
||||||
|
|
||||||
|
namespace TestAutomation; |
||||||
|
|
||||||
|
public enum DeploymentType |
||||||
|
{ |
||||||
|
Dev, |
||||||
|
Local |
||||||
|
} |
||||||
|
|
||||||
|
public class BaseTest |
||||||
|
{ |
||||||
|
protected static readonly DeploymentType DeploymentType = |
||||||
|
Environment.GetEnvironmentVariable("TEST_HOOK") != null |
||||||
|
? DeploymentType.Dev |
||||||
|
: DeploymentType.Local; |
||||||
|
|
||||||
|
protected static readonly string WebsiteUrl = |
||||||
|
DeploymentType.Equals(DeploymentType.Dev) |
||||||
|
? "https://calm-mud-04916b210.1.azurestaticapps.net/" |
||||||
|
: "https://localhost:7234"; |
||||||
|
|
||||||
|
protected static readonly TestReport TestReport = new(); |
||||||
|
|
||||||
|
|
||||||
|
protected static Website WebsiteInstance = default!; |
||||||
|
|
||||||
|
protected static Website Website |
||||||
|
{ |
||||||
|
get |
||||||
|
{ |
||||||
|
if (WebsiteInstance == null) |
||||||
|
{ |
||||||
|
var options = new FirefoxOptions(); |
||||||
|
|
||||||
|
options.AcceptInsecureCertificates = true; |
||||||
|
|
||||||
|
if (DeploymentType.Equals(DeploymentType.Dev)) |
||||||
|
{ |
||||||
|
options.AddArgument("--headless"); |
||||||
|
} |
||||||
|
options.AddArgument("--ignore-certificate-errors"); |
||||||
|
options.AddArgument("--start-maximized"); |
||||||
|
options.AddArgument("--test-type"); |
||||||
|
options.AddArgument("--allow-running-insecure-content"); |
||||||
|
|
||||||
|
IWebDriver webDriver = new FirefoxDriver(Environment.CurrentDirectory, options); |
||||||
|
|
||||||
|
WebsiteInstance = new Website(webDriver); |
||||||
|
} |
||||||
|
|
||||||
|
return WebsiteInstance; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
namespace TestAutomation.Enums; |
||||||
|
|
||||||
|
public enum ScreenType |
||||||
|
{ |
||||||
|
Desktop, |
||||||
|
Tablet, |
||||||
|
Mobile |
||||||
|
} |
||||||
@ -1,11 +0,0 @@ |
|||||||
using TestAutomation.Utils; |
|
||||||
|
|
||||||
namespace TestAutomation.Pages; |
|
||||||
|
|
||||||
public class BasePage { |
|
||||||
public Website website; |
|
||||||
|
|
||||||
public BasePage(Website website) { |
|
||||||
this.website = website; |
|
||||||
} |
|
||||||
} |
|
||||||
@ -0,0 +1,11 @@ |
|||||||
|
using TestAutomation.Shared; |
||||||
|
using TestAutomation.Utils; |
||||||
|
|
||||||
|
namespace TestAutomation.Pages; |
||||||
|
|
||||||
|
public class DatabaseSinglePage : BaseElement |
||||||
|
{ |
||||||
|
public DatabaseSinglePage(Website website) : base(website) { } |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -1,71 +1,86 @@ |
|||||||
using TestAutomation.Utils; |
using TestAutomation.Shared; |
||||||
|
using TestAutomation.Utils; |
||||||
|
|
||||||
namespace TestAutomation.Pages; |
namespace TestAutomation.Pages; |
||||||
|
|
||||||
public class HarassCalculatorPage : BasePage { |
public class HarassCalculatorPage : BaseElement |
||||||
public HarassCalculatorPage(Website website) : base(website) { } |
{ |
||||||
private IWebElement NumberOfWorkersLostToHarass => website.Find("numberOfWorkersLostToHarass"); |
public HarassCalculatorPage(Website website) : base(website) |
||||||
private IWebElement NumberOfTownHallsExisting => website.Find("numberOfTownHallsExisting"); |
{ |
||||||
private IList<IWebElement> OnTownHallTravelTimes => website.FindChildren("numberOfTownHallTravelTimes", "input"); |
} |
||||||
private int TotalAlloyHarassment => website.FindInt("totalAlloyHarassment"); |
|
||||||
private int WorkerReplacementCost => website.FindInt("workerReplacementCost"); |
private IWebElement NumberOfWorkersLostToHarass => Website.Find("numberOfWorkersLostToHarass"); |
||||||
private int DelayedMiningCost => website.FindInt("delayedMiningCost"); |
private IWebElement NumberOfTownHallsExisting => Website.Find("numberOfTownHallsExisting"); |
||||||
private int AverageTravelTime => website.FindInt("getAverageTravelTime"); |
private IList<IWebElement> OnTownHallTravelTimes => Website.FindChildren("numberOfTownHallTravelTimes", "input"); |
||||||
|
private int TotalAlloyHarassment => Website.FindInt("totalAlloyHarassment"); |
||||||
|
private int WorkerReplacementCost => Website.FindInt("workerReplacementCost"); |
||||||
|
private int DelayedMiningCost => Website.FindInt("delayedMiningCost"); |
||||||
|
private int AverageTravelTime => Website.FindInt("getAverageTravelTime"); |
||||||
|
|
||||||
private int ExampleTotalAlloyLoss => website.FindInt("exampleTotalAlloyLoss"); |
private int ExampleTotalAlloyLoss => Website.FindInt("exampleTotalAlloyLoss"); |
||||||
private int ExampleWorkerCost => website.FindInt("exampleWorkerCost"); |
private int ExampleWorkerCost => Website.FindInt("exampleWorkerCost"); |
||||||
private int ExampleMiningTimeCost => website.FindInt("exampleMiningTimeCost"); |
private int ExampleMiningTimeCost => Website.FindInt("exampleMiningTimeCost"); |
||||||
private int ExampleTotalAlloyLossDifference => website.FindInt("exampleTotalAlloyLossDifference"); |
private int ExampleTotalAlloyLossDifference => Website.FindInt("exampleTotalAlloyLossDifference"); |
||||||
private int ExampleTotalAlloyLossAccurate => website.FindInt("exampleTotalAlloyLossAccurate"); |
private int ExampleTotalAlloyLossAccurate => Website.FindInt("exampleTotalAlloyLossAccurate"); |
||||||
private int ExampleTotalAlloyLossAccurateDifference => website.FindInt("exampleTotalAlloyLossAccurateDifference"); |
private int ExampleTotalAlloyLossAccurateDifference => Website.FindInt("exampleTotalAlloyLossAccurateDifference"); |
||||||
|
|
||||||
public HarassCalculatorPage SetWorkersLostToHarass(int number) { |
public HarassCalculatorPage SetWorkersLostToHarass(int number) |
||||||
website.EnterInput(NumberOfWorkersLostToHarass, number); |
{ |
||||||
|
Website.EnterInput(NumberOfWorkersLostToHarass, number); |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage SetNumberOfTownHallsExisting(int number) { |
public HarassCalculatorPage SetNumberOfTownHallsExisting(int number) |
||||||
website.EnterInput(NumberOfTownHallsExisting, number); |
{ |
||||||
|
Website.EnterInput(NumberOfTownHallsExisting, number); |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage SetTownHallTravelTime(int forTownHall, int number) { |
public HarassCalculatorPage SetTownHallTravelTime(int forTownHall, int number) |
||||||
website.EnterInput(OnTownHallTravelTimes[forTownHall], number); |
{ |
||||||
|
Website.EnterInput(OnTownHallTravelTimes[forTownHall], number); |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetTotalAlloyHarassment(out int result) { |
public HarassCalculatorPage GetTotalAlloyHarassment(out int result) |
||||||
|
{ |
||||||
result = TotalAlloyHarassment; |
result = TotalAlloyHarassment; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
public HarassCalculatorPage GetExampleTotalAlloyLoss(out int result) { |
public HarassCalculatorPage GetExampleTotalAlloyLoss(out int result) |
||||||
|
{ |
||||||
result = ExampleTotalAlloyLoss; |
result = ExampleTotalAlloyLoss; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetExampleWorkerCost(out int result) { |
public HarassCalculatorPage GetExampleWorkerCost(out int result) |
||||||
|
{ |
||||||
result = ExampleWorkerCost; |
result = ExampleWorkerCost; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetExampleMiningTimeCost(out int result) { |
public HarassCalculatorPage GetExampleMiningTimeCost(out int result) |
||||||
|
{ |
||||||
result = ExampleMiningTimeCost; |
result = ExampleMiningTimeCost; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetExampleTotalAlloyLossAccurate(out int result) { |
public HarassCalculatorPage GetExampleTotalAlloyLossAccurate(out int result) |
||||||
|
{ |
||||||
result = ExampleTotalAlloyLossAccurate; |
result = ExampleTotalAlloyLossAccurate; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetExampleTotalAlloyLossDifference(out int result) { |
public HarassCalculatorPage GetExampleTotalAlloyLossDifference(out int result) |
||||||
|
{ |
||||||
result = ExampleTotalAlloyLossDifference; |
result = ExampleTotalAlloyLossDifference; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|
||||||
public HarassCalculatorPage GetExampleTotalAlloyLossAccurateDifference(out int result) { |
public HarassCalculatorPage GetExampleTotalAlloyLossAccurateDifference(out int result) |
||||||
|
{ |
||||||
result = ExampleTotalAlloyLossAccurateDifference; |
result = ExampleTotalAlloyLossAccurateDifference; |
||||||
return this; |
return this; |
||||||
} |
} |
||||||
|
|||||||
@ -0,0 +1,13 @@ |
|||||||
|
using TestAutomation.Utils; |
||||||
|
|
||||||
|
namespace TestAutomation.Shared; |
||||||
|
|
||||||
|
public class BaseElement |
||||||
|
{ |
||||||
|
protected readonly Website Website; |
||||||
|
|
||||||
|
protected BaseElement(Website website) |
||||||
|
{ |
||||||
|
Website = website; |
||||||
|
} |
||||||
|
} |
||||||
@ -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; |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
namespace TestAutomation; |
||||||
|
|
||||||
|
[TestFixture] |
||||||
|
public class TestSearchFeatures : BaseTest |
||||||
|
{ |
||||||
|
[Test] |
||||||
|
public void DesktopOpenCloseSearchDialog() |
||||||
|
{ |
||||||
|
TestReport.CreateTest(); |
||||||
|
|
||||||
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/"); |
||||||
|
|
||||||
|
Website.NavigationBar |
||||||
|
.ClickSearchButton() |
||||||
|
.CloseDialog() |
||||||
|
.ClickHomeLink(); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
[Ignore("Not completed")] |
||||||
|
public void DesktopSearchForThrone() |
||||||
|
{ |
||||||
|
TestReport.CreateTest(); |
||||||
|
|
||||||
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/"); |
||||||
|
|
||||||
|
Website.NavigationBar |
||||||
|
.ClickSearchButton() |
||||||
|
.Search("Throne") |
||||||
|
.SelectSearchEntity("Throne"); |
||||||
|
// .GetName(out var name); |
||||||
|
|
||||||
|
// TestReport.CheckPassed(name.Equals("Throne"), "Couldn't find Throne via search."); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
using System.Text; |
||||||
|
using Newtonsoft.Json; |
||||||
|
|
||||||
|
namespace TestAutomation; |
||||||
|
|
||||||
|
[SetUpFixture] |
||||||
|
public class Tests : BaseTest |
||||||
|
{ |
||||||
|
[OneTimeSetUp] |
||||||
|
public void Setup() |
||||||
|
{ |
||||||
|
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl); |
||||||
|
Website.WebDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15); |
||||||
|
} |
||||||
|
|
||||||
|
[OneTimeTearDown] |
||||||
|
public void TearDown() |
||||||
|
{ |
||||||
|
HttpClient HttpClient = new(); |
||||||
|
|
||||||
|
Website.WebDriver.Quit(); |
||||||
|
|
||||||
|
var message = new |
||||||
|
{ |
||||||
|
content = "Test Report " + DateTime.Now.ToString("dd/MM/yyyy"), |
||||||
|
embeds = TestReport.GetMessages() |
||||||
|
}; |
||||||
|
|
||||||
|
var content = new StringContent(JsonConvert.SerializeObject(message), Encoding.UTF8, "application/json"); |
||||||
|
|
||||||
|
if (Environment.GetEnvironmentVariable("TEST_HOOK") == null) return; |
||||||
|
|
||||||
|
HttpClient.PostAsync(Environment.GetEnvironmentVariable("TEST_HOOK"), content).Wait(); |
||||||
|
} |
||||||
|
} |
||||||
@ -1,6 +1,7 @@ |
|||||||
namespace TestAutomation.Utils; |
namespace TestAutomation.Utils; |
||||||
|
|
||||||
public class Test { |
public class Test |
||||||
|
{ |
||||||
public string Name { get; set; } = "Name..."; |
public string Name { get; set; } = "Name..."; |
||||||
public bool Result { get; set; } = true; |
public bool Result { get; set; } = true; |
||||||
public IList<TestMessage> Messages { get; set; } = new List<TestMessage>(); |
public IList<TestMessage> Messages { get; set; } = new List<TestMessage>(); |
||||||
|
|||||||
@ -1,11 +1,13 @@ |
|||||||
namespace TestAutomation.Utils; |
namespace TestAutomation.Utils; |
||||||
|
|
||||||
public class TestMessage { |
public class TestMessage |
||||||
|
{ |
||||||
public string Title { get; set; } = "Name..."; |
public string Title { get; set; } = "Name..."; |
||||||
public string Description { get; set; } = ""; |
public string Description { get; set; } = ""; |
||||||
public string Color { get; set; } = "FFFFFF"; |
public string Color { get; set; } = "FFFFFF"; |
||||||
|
|
||||||
public static TestMessage CreateFailedMessage(string description) { |
public static TestMessage CreateFailedMessage(string description) |
||||||
|
{ |
||||||
return new TestMessage { Title = "Check Failed", Description = description, Color = "FF0000" }; |
return new TestMessage { Title = "Check Failed", Description = description, Color = "FF0000" }; |
||||||
} |
} |
||||||
} |
} |
||||||
Loading…
Reference in new issue