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
        }
Ejemplo n.º 2
0
        //[Test, Ignore("Configuration of bonus is not available for R1")]
        public void Can_redeem_fund_in_bonus_with_code_issuance_mode()
        {
            const decimal fundInFrom       = 100;
            const decimal amount           = 200;
            const decimal fundInPercentage = 75;
            const decimal maxTierReward    = 100;
            const string  walletName       = "Product 138";

            //Create a bonus template and a bonus
            var bonusTemplateManagerPage   = _dashboardPage.Menu.ClickBonusTemplateMenuItem();
            var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm()
                                             .SelectLicenseeAndBrand(LicenseeName, BrandName)
                                             .SetTemplateName(_bonusTemplateName)
                                             .SelectBonusType(BonusType.HighDeposit)
                                             //temporary commented out 'cos selection is index based
                                             //.SelectBonusType(BonusUIType.FundIn)
                                             .SelectIssuanceMode(IssuanceMode.AutomaticWithCode)
                                             .NavigateToRules()
                                             .SelectRewardType(BonusRewardType.TieredPercentage)
                                             .SelectCurrency("CAD")
                                             .SelectFundInWallet(walletName)
                                             .EnterBonusTier(fundInPercentage, fromAmount: fundInFrom, maxTierReward: maxTierReward)
                                             .NavigateToSummary();

            var bonusManagerPage   = submittedBonusTemplateForm.Menu.ClickBonusMenuItem();
            var newBonusForm       = bonusManagerPage.OpenNewBonusForm();
            var bonusCode          = TestDataGenerator.GetRandomString(6);
            var submittedBonusForm = newBonusForm.Submit(_bonusName, bonusCode, _bonusTemplateName, 0);

            submittedBonusForm.SwitchToBonusList();
            ActivateBonus(_bonusName);

            //create a player
            var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD");

            Thread.Sleep(5000); //wait for Player created event processing

            //Make a deposit to have funds for fund in
            _paymentTestHelper.MakeDeposit(player.Username, amount);

            Thread.Sleep(5000); //wait for Deposit created event processing
            var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id;

            //Wait for record in DB
            WaitForOfflineDeposit(playerId, amount: 200, timeout: TimeSpan.FromSeconds(20));

            //login to member site
            var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);

            memberWebsiteLoginPage.NavigateToMemberWebsite();
            var playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password);

            // make fundIn
            var fundInSection = playerProfilePage.Menu.ClickTransferFundSubMenu();

            fundInSection.FundIn(amount, bonusCode);
            Thread.Sleep(5000); //wait for Fundin transaction created event processing

            //login to admin site
            _driver.Logout();
            _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
            var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();

            playerManagerPage.SelectPlayer(player.Username);
            var playerInfoPage = playerManagerPage.OpenPlayerInfoPage();

            playerInfoPage.OpenTransactionsSection();
            var playersBonusAmount = playerInfoPage.GetTransactionBonusAmount("Bonus");

            Assert.AreEqual(maxTierReward, playersBonusAmount);

            //deactivate bonus
            DeactivateBonus();
        }