public async Task Can_make_withdrawal_when_player_hits_Has_Winnings_amount_criteria_via_Admin_site() { //place bet and make winnings var playerId = _playerQueries.GetPlayerByUsername(_playerUsername).Id; var gameId = "FOOTBALL"; var gameProviderCode = _gamesTestHelper.GetGameProviderCodeByGameExternalId(gameId); var placeBetTxId = Guid.NewGuid().ToString(); var actualBetId = await _gamesTestHelper.PlaceBet(13, playerId, gameProviderCode, gameId, transactionId : placeBetTxId); //TODO: VladK. - remove Sleep here Thread.Sleep(5000);// wait for Bet event processing await _gamesTestHelper.WinBet(actualBetId, 201, placeBetTxId, gameProviderCode); //TODO: VladK. - remove Sleep here Thread.Sleep(5000); //wait for Bet event processing //create a withdrawal request _playerManagerPage.SelectPlayer(_playerUsername); var offlineWithdrawalRequestForm = _playerManagerPage.OpenOfflineWithdrawRequestForm(_playerUsername); offlineWithdrawalRequestForm.TryToSubmit("10", NotificationMethod.Email); Assert.AreEqual("Offline withdraw request has been successfully submitted", offlineWithdrawalRequestForm.ValidationMessage); //check the withdrawal request record in Acceptance Queue _acceptanceQueuePage = _dashboardPage.Menu.ClickAcceptanceQueueMenuItem(); _acceptanceQueuePage.FindAndSelectWithdrawalRecord(_playerUsername, "10"); //check verified status for the withdrawal in Acceptance Queue Assert.IsTrue(_acceptanceQueuePage.CheckIfWithdrawalRequestStatusIsVerified(_playerUsername, _playerFullname)); //accept withdrawal request //check accepted withdrawal request in Release Queue //check status for the withdrawal in Release Queue }
public async Task Can_set_games_for_bonus_to_contribute_players_completion_of_wagering_requirement() { const decimal amount = 1000; //create a bonus - First Deposit, Automatic, Withdrawable, for main wallet var brand = _container.Resolve <IBrandRepository>().Brands.Include(x => x.WalletTemplates).Single(b => b.Name == BrandName); var walletTemplateId = brand.WalletTemplates.First(x => x.IsMain).Id; var info = new CreateUpdateTemplateInfo { Name = TestDataGenerator.GetRandomString(), TemplateType = BonusType.FirstDeposit, BrandId = brand.Id, WalletTemplateId = walletTemplateId, IsWithdrawable = true, Mode = IssuanceMode.Automatic }; var rules = new CreateUpdateTemplateRules { RewardTiers = new List <CreateUpdateRewardTier> { new CreateUpdateRewardTier { CurrencyCode = "CAD", BonusTiers = new List <CreateUpdateTemplateTier> { new CreateUpdateTemplateTier { Reward = 13 } } } } }; var gameRepository = _container.Resolve <IGameRepository>(); var wagering = new CreateUpdateTemplateWagering { HasWagering = true, Method = WageringMethod.Bonus, Multiplier = 1, GameContributions = new List <CreateUpdateGameContribution> { new CreateUpdateGameContribution { GameId = gameRepository.Games.Single(g => g.Name == "Football").Id, Contribution = 50 }, new CreateUpdateGameContribution { GameId = gameRepository.Games.Single(g => g.Name == "Hockey").Id, Contribution = 100 } } }; var bonusTemplate = await _bonusTestHelper.CreateTemplate(info : info, rules : rules, wagering : wagering); var bonus = await _bonusTestHelper.CreateBonus(bonusTemplate); _bonusName = bonus.Name; if (bonus.IsActive) { _activeBonusesNamesList.Add(_bonusName); } //create a player var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD"); //Thread.Sleep(5000); //wait for Player created event processing //make a Deposit _paymentTestHelper.MakeDeposit(player.Username, amount); Thread.Sleep(5000); //wait for Deposit created event processing //place and win first bet - must deduct only 50% wagering contribution for now var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id; var gameId = "FOOTBALL"; var gameProviderCode = _gamesTestHelper.GetGameProviderCodeByGameExternalId(gameId); var placeBetTxId = Guid.NewGuid().ToString(); var actualBetId = await _gamesTestHelper.PlaceBet(13, playerId, gameProviderCode, gameId, transactionId : placeBetTxId); //TODO: VladK. - remove Sleep here Thread.Sleep(5000);// wait for Bet event processing await _gamesTestHelper.WinBet(actualBetId, 13, placeBetTxId, gameProviderCode); //TODO: VladK. - remove Sleep here Thread.Sleep(5000); //wait for Bet event processing //make sure that bonus haven't been unlocked yet var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password); var playerBalanceInformationPage = playerProfilePage.Menu.ClickBalanceInformationMenu(); //TODO: Until Pavel's fixes for Balance Information on Member site AFTREGO-???? - 10-Feb-2016, Igor Assert.AreEqual("987.00", playerBalanceInformationPage.GetMainBalance(walletTemplateId.ToString())); Assert.AreEqual("26.00", playerBalanceInformationPage.GetBonusBalance(walletTemplateId.ToString())); //place and win second bet - must deduct 50%+50% = 100% wagering contribution var secondPlaceBetTxId = Guid.NewGuid().ToString(); actualBetId = await _gamesTestHelper.PlaceBet(13, playerId, gameProviderCode, gameId, transactionId : secondPlaceBetTxId); //TODO: VladK. - remove Sleep here Thread.Sleep(5000);// wait for Bet event processing await _gamesTestHelper.WinBet(actualBetId, 13, secondPlaceBetTxId, gameProviderCode); //TODO: VladK. - remove Sleep here Thread.Sleep(5000); //wait for Bet event processing //make sure that we ve got bonus on Main Balance playerBalanceInformationPage = playerProfilePage.Menu.ClickBalanceInformationMenu(); Assert.AreEqual("1013.00", playerBalanceInformationPage.GetMainBalance(walletTemplateId.ToString())); Assert.AreEqual("0.00", playerBalanceInformationPage.GetBonusBalance(walletTemplateId.ToString())); //deactivate bonus DeactivateBonus(); }