public void SpinWithRounds(int rounds) { Thread.Sleep(1000); for (int i = 0; i < rounds; i++) { S_Mouse.Click(BetContainer.btnSpin); Thread.Sleep(1000); F_General.WaitForElementAttributeChangedToExpectedValue(BetContainer.btnSpin, "class", "", 20000); } }
public void VerifyChangingMachine() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); game.ChangeMachine("5"); Verification.VerifyMachine("5", ref Result, ref Msg); Assert.IsTrue(Result, Msg); }
public void VerifyCreditsReducedAfterSpin() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); game.BetNumber(1); S_Mouse.Click(BetContainer.btnSpin); Verification.VerifyElementText(BetContainer.txtCredits, (game.Credits - game.Bet).ToString(), ref Result, ref Msg); Assert.IsTrue(Result, Msg); }
public void VerifySpinWithoutWin() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); game.BetNumber(3); game.SpinWithoutWin(); Verification.VerifyWinBannerDisplayed(Images.WinBanner, ref Result, ref Msg); Assert.IsFalse(Result, Msg); }
public void VerifySpinWithWin() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); game.BetNumber(1); game.SpinWithWin(); Verification.VerifyElementText(BetContainer.txtCredits, game.Credits.ToString(), ref Result, ref Msg); Verification.VerifyElementText(BetContainer.txtLastWin, game.LastWin.ToString(), ref Result, ref Msg); Verification.VerifyWinningReels(ref Result, ref Msg); Verification.VerifyWinBannerDisplayed(Images.WinBanner, ref Result, ref Msg); Assert.IsTrue(Result, Msg); }
public void VerifyBetUp() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); Dictionary <String, WinChartAttributes> InitPrizeList = game.InitPrizeList; for (int i = 1; i < 10; i++) { game.BetNumber(i + 1); Verification.VerifyElementText(BetContainer.txtBet, Convert.ToString(i + 1), ref Result, ref Msg); Verification.VerifyWinChartUpdatedAfterBet(ref game, ref Result, ref Msg); Thread.Sleep(1000); } Assert.IsTrue(Result, Msg); }
public void VerifyBetDown() { ConstantsLib.Driver.Navigate().GoToUrl(ConstantsLib.SlotMachineURL); F_General.WaitForPageLoaded(TimeSpan.FromSeconds(20)); Game game = new Game(); game.BetNumber(10); for (int i = 10; i == 2; i--) { game.BetNumber(i - 1); Verification.VerifyElementText(BetContainer.txtBet, Convert.ToString(i - 1), ref Result, ref Msg); Verification.VerifyWinChartUpdatedAfterBet(ref game, ref Result, ref Msg); Thread.Sleep(1000); } Assert.IsTrue(Result, Msg); }
public void SpinWithoutWin() { IWebElement el = null; while (el == null) { Thread.Sleep(1000); S_Mouse.Click(BetContainer.btnSpin); Thread.Sleep(1000); F_General.WaitForElementAttributeChangedToExpectedValue(BetContainer.btnSpin, "class", "", 20000); try { el = ConstantsLib.Driver.FindElement(By.XPath("//div[@class='trPrize won']")); el = null; } catch (NoSuchElementException) { break; } } }
public void BetNumber(int number) { Bet = number; int startNumber = Convert.ToInt32(F_General.GetTextElement(BetContainer.txtBet)); if (startNumber < Bet) { while (Convert.ToInt32(F_General.GetTextElement(BetContainer.txtBet)) < Bet) { S_Mouse.Click(BetContainer.btnBetUp); } } if (startNumber > Bet) { while (Convert.ToInt32(F_General.GetTextElement(BetContainer.txtBet)) > Bet) { S_Mouse.Click(BetContainer.btnBetDown); } } }
public void SpinWithWin() { IWebElement el = null; while (el == null) { Thread.Sleep(1000); S_Mouse.Click(BetContainer.btnSpin); Credits = Credits - Bet; Thread.Sleep(1000); F_General.WaitForElementAttributeChangedToExpectedValue(BetContainer.btnSpin, "class", "", 20000); try { el = ConstantsLib.Driver.FindElement(By.XPath("//div[@class='trPrize won']")); } catch (NoSuchElementException) { } } LastWin = Convert.ToInt32(F_General.CaptureInterface(BetContainer.txtLastWin).Text); }
public Game() { Bet = 1; Credits = Convert.ToInt32(F_General.CaptureInterface(BetContainer.txtCredits).Text); InitPrizeList = GetPrizeList(); }
public Game(int betNumber) { Credits = Convert.ToInt32(F_General.CaptureInterface(BetContainer.txtCredits).Text); Bet = betNumber; InitPrizeList = GetPrizeList(); }