public static int GetCounterValue(CounterType CounterType) { CountersPage Counters = new CountersPage(); if (CounterType == CounterType.Attempt) { Tools.WaitForElementToLoad(CssSelectorPhoto); int Attempts = Convert.ToInt32(Counters.TotalAttempts.Text); Logging.Log($"Total Attempts counter: {Counters.TotalAttempts.ToString()}"); return(Attempts); } else if (CounterType == CounterType.Correct) { Tools.WaitForElementToLoad(CssSelectorPhoto); int Correct = Convert.ToInt32(Counters.TotalCorrectAttempts.Text); Logging.Log($"Correct Attempts counter: {Counters.TotalCorrectAttempts.ToString()}"); return(Correct); } else { Tools.WaitForElementToLoad(CssSelectorPhoto); int Streak = Convert.ToInt32(Counters.SuccessStreakCounter.Text); Logging.Log($"Correct Attempts counter: {Counters.SuccessStreakCounter.ToString()}"); return(Streak); } }
public static void PerformSuccessfulMatchSpecifiedNumberOfTimes(int NumberOfSuccessfulMatches) { CountersPage Counters = new CountersPage(); var counter = 0; while (counter < NumberOfSuccessfulMatches) { Tools.WaitForElementToLoad(CssSelectorPhoto); ClickOnImageByDesiredOutcome(MatchType.Match); counter += 1; Logging.Log($"Streak Counter after match made: {Counters.SuccessStreakCounter.Text}"); } }