public void ChangeBackground(string id) { var bgd = ConstantsLib.Driver.FindElements(By.XPath("//div[@class='changeable_background' and @data-id='" + id + "']")); while (bgd.ElementAt(0).GetAttribute("style").Contains("display: none;")) { S_Mouse.Click(CustomizePanel.btnChangeBackground); Thread.Sleep(1000); } }
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 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 ChangeMachine(string id) { string xpath = "//div[@id='slotsSelectorWrapper' and @class='reelSet1 slotMachine" + id + "']"; var MachineContainer = ConstantsLib.Driver.FindElements(By.XPath(xpath)); while (MachineContainer.Count == 0) { S_Mouse.Click(CustomizePanel.btnChangeMachine); Thread.Sleep(1000); MachineContainer = ConstantsLib.Driver.FindElements(By.XPath(xpath)); } }
public void ChangeReelIcons(string style) { var ReelContainer = ConstantsLib.Driver.FindElements(By.XPath("//div[@id='ReelContainer']//div[@class='reel']")); foreach (IWebElement reel in ReelContainer) { while (!reel.GetCssValue("background-image").Contains(style)) { S_Mouse.Click(CustomizePanel.btnChangeIcons); Thread.Sleep(1000); } } }
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); }