public void Can_make_offline_deposit_and_view_updated_balance_on_game_page() { // register a player on member website _playerData = _container.Resolve <PlayerTestHelper>().CreatePlayerForMemberWebsite("CAD"); _username = _playerData.Username; _password = _playerData.Password; //check empty balance of the player _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); _playerProfilePage = _memberWebsiteLoginPage.Login(_username, _password); _gameListPage = _playerProfilePage.Menu.ClickPlayGamesMenu(); _gamePage = _gameListPage.StartGame("Football"); var initialBalance = _gamePage.Balance; Assert.AreEqual("Balance: $0.00", initialBalance); var playerName = _gamePage.PlayerName; var expectedPlayerLoginName = String.Format("Name: {0}", _playerData.Username); Assert.AreEqual(expectedPlayerLoginName, playerName); // login to admin website and make an offline deposit request _driver.Manage().Cookies.DeleteAllCookies(); var dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); _driver.MakeOfflineDeposit(_username, Amount, _playerData.FullName); var playerManagerPage = dashboardPage.Menu.ClickPlayerManagerMenuItem(); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(_username); playerInfoPage.OpenTransactionsSection(); Assert.AreEqual(Amount, playerInfoPage.GetTransactionMainAmount("Deposit")); // check the balance on the member website _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); _playerProfilePage = _memberWebsiteLoginPage.Login(_username, _password); var gameListPage = _playerProfilePage.Menu.ClickPlayGamesMenu(); _gamePage = gameListPage.StartGame("Football"); var currentBalance = _gamePage.Balance; Assert.AreEqual("Balance: $100.25", currentBalance); }
public void Can_run_FakeUGS_mockgame_website_and_make_bets() { _gamePage = _gameListPage.StartGame("Football"); // check the player balance var initialBalance = _gamePage.Balance; Assert.AreEqual("Balance: $10,000.25", initialBalance); var expectedPlayerName = string.Format("Name: {0}", _playerData.Username); var playerName = _gamePage.PlayerName; Assert.AreEqual(expectedPlayerName, playerName); var expectedTag = "Tag: 138"; Assert.AreEqual(expectedTag, _gamePage.Tag); // make a bet _gamePage.PlaceInitialBet(100, "description test"); Assert.AreEqual("-100.00", _gamePage.RoundBetAmount); // check a transaction's type and amount var txAmount = _gamePage.GetTransactionDetail(0, "amount"); Assert.AreEqual("-100.00", txAmount); var txType = _gamePage.GetTransactionDetail(0, "type"); Assert.AreEqual("Placed", txType); Assert.AreEqual("Balance: $9,900.25", _gamePage.Balance); // place another bet _gamePage.PlaceSubBet(150, "description test"); Assert.AreEqual("-250.00", _gamePage.RoundBetAmount); // check a transaction's type and amount txAmount = _gamePage.GetTransactionDetail(1, "amount"); Assert.AreEqual("-150.00", txAmount); txType = _gamePage.GetTransactionDetail(1, "type"); Assert.AreEqual("Placed", txType); Assert.AreEqual("Balance: $9,750.25", _gamePage.Balance); // win a bet _gamePage.WinBet(amount: 300); Assert.AreEqual("50.00", _gamePage.RoundBetAmount); Assert.AreEqual("Balance: $10,050.25", _gamePage.Balance); // adjust //TODO: Not implemented in wallet //_gamePage.AdjustTransaction(txNumber:2, amount:400); //Assert.AreEqual("550.00", _gamePage.BetAmount); //Assert.AreEqual("Balance: $10,550.25", _gamePage.Balance); // cancel _gamePage.CancelTransaction(txNumber: 2, amount: 300); Assert.AreEqual("-250.00", _gamePage.RoundBetAmount); Assert.AreEqual("Balance: $9,750.25", _gamePage.Balance); // verify transactions on the player info tab var dashboard = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playersList = dashboard.Menu.ClickPlayerManagerMenuItem(); var playerInfoPage = playersList.OpenPlayerInfoPage(_username); playerInfoPage.OpenTransactionsSection(); var betPlacedAmounts = playerInfoPage.GetTransactionsMainAmount("Bet placed"); Assert.Contains(-100m, betPlacedAmounts); Assert.Contains(-150m, betPlacedAmounts); Assert.AreEqual(300, playerInfoPage.GetTransactionMainAmount("Bet won")); //TODO: Not implemented in wallet //Assert.AreEqual(400, playerInfoPage.GetTransactionTotalAmount("Bet adjusted")); Assert.AreEqual(-300, playerInfoPage.GetTransactionMainAmount("Bet canceled")); }