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
+44 -29
View File
@@ -1,71 +1,86 @@
using TestAutomation.Utils;
using TestAutomation.Shared;
using TestAutomation.Utils;
namespace TestAutomation.Pages;
public class HarassCalculatorPage : BasePage {
public HarassCalculatorPage(Website website) : base(website) { }
private IWebElement NumberOfWorkersLostToHarass => website.Find("numberOfWorkersLostToHarass");
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 int DelayedMiningCost => website.FindInt("delayedMiningCost");
private int AverageTravelTime => website.FindInt("getAverageTravelTime");
public class HarassCalculatorPage : BaseElement
{
public HarassCalculatorPage(Website website) : base(website)
{
}
private int ExampleTotalAlloyLoss => website.FindInt("exampleTotalAlloyLoss");
private int ExampleWorkerCost => website.FindInt("exampleWorkerCost");
private int ExampleMiningTimeCost => website.FindInt("exampleMiningTimeCost");
private int ExampleTotalAlloyLossDifference => website.FindInt("exampleTotalAlloyLossDifference");
private int ExampleTotalAlloyLossAccurate => website.FindInt("exampleTotalAlloyLossAccurate");
private int ExampleTotalAlloyLossAccurateDifference => website.FindInt("exampleTotalAlloyLossAccurateDifference");
private IWebElement NumberOfWorkersLostToHarass => Website.Find("numberOfWorkersLostToHarass");
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 int DelayedMiningCost => Website.FindInt("delayedMiningCost");
private int AverageTravelTime => Website.FindInt("getAverageTravelTime");
public HarassCalculatorPage SetWorkersLostToHarass(int number) {
website.EnterInput(NumberOfWorkersLostToHarass, number);
private int ExampleTotalAlloyLoss => Website.FindInt("exampleTotalAlloyLoss");
private int ExampleWorkerCost => Website.FindInt("exampleWorkerCost");
private int ExampleMiningTimeCost => Website.FindInt("exampleMiningTimeCost");
private int ExampleTotalAlloyLossDifference => Website.FindInt("exampleTotalAlloyLossDifference");
private int ExampleTotalAlloyLossAccurate => Website.FindInt("exampleTotalAlloyLossAccurate");
private int ExampleTotalAlloyLossAccurateDifference => Website.FindInt("exampleTotalAlloyLossAccurateDifference");
public HarassCalculatorPage SetWorkersLostToHarass(int number)
{
Website.EnterInput(NumberOfWorkersLostToHarass, number);
return this;
}
public HarassCalculatorPage SetNumberOfTownHallsExisting(int number) {
website.EnterInput(NumberOfTownHallsExisting, number);
public HarassCalculatorPage SetNumberOfTownHallsExisting(int number)
{
Website.EnterInput(NumberOfTownHallsExisting, number);
return this;
}
public HarassCalculatorPage SetTownHallTravelTime(int forTownHall, int number) {
website.EnterInput(OnTownHallTravelTimes[forTownHall], number);
public HarassCalculatorPage SetTownHallTravelTime(int forTownHall, int number)
{
Website.EnterInput(OnTownHallTravelTimes[forTownHall], number);
return this;
}
public HarassCalculatorPage GetTotalAlloyHarassment(out int result) {
public HarassCalculatorPage GetTotalAlloyHarassment(out int result)
{
result = TotalAlloyHarassment;
return this;
}
public HarassCalculatorPage GetExampleTotalAlloyLoss(out int result) {
public HarassCalculatorPage GetExampleTotalAlloyLoss(out int result)
{
result = ExampleTotalAlloyLoss;
return this;
}
public HarassCalculatorPage GetExampleWorkerCost(out int result) {
public HarassCalculatorPage GetExampleWorkerCost(out int result)
{
result = ExampleWorkerCost;
return this;
}
public HarassCalculatorPage GetExampleMiningTimeCost(out int result) {
public HarassCalculatorPage GetExampleMiningTimeCost(out int result)
{
result = ExampleMiningTimeCost;
return this;
}
public HarassCalculatorPage GetExampleTotalAlloyLossAccurate(out int result) {
public HarassCalculatorPage GetExampleTotalAlloyLossAccurate(out int result)
{
result = ExampleTotalAlloyLossAccurate;
return this;
}
public HarassCalculatorPage GetExampleTotalAlloyLossDifference(out int result) {
public HarassCalculatorPage GetExampleTotalAlloyLossDifference(out int result)
{
result = ExampleTotalAlloyLossDifference;
return this;
}
public HarassCalculatorPage GetExampleTotalAlloyLossAccurateDifference(out int result) {
public HarassCalculatorPage GetExampleTotalAlloyLossAccurateDifference(out int result)
{
result = ExampleTotalAlloyLossAccurateDifference;
return this;
}