Beispiel #1
0
        public async Task Can_get_ReloadDeposit_bonus_with_manual_issuance_mode()
        {
            //create a bonus template and a bonus - Bonus type:Reload, Reward Type: Fixed
            var walletTemplateId = _brand.WalletTemplates.First().Id;
            var info             = new CreateUpdateTemplateInfo
            {
                Name             = TestDataGenerator.GetRandomString(),
                TemplateType     = BonusType.ReloadDeposit,
                BrandId          = _brand.Id,
                WalletTemplateId = walletTemplateId,
                Mode             = IssuanceMode.ManualByPlayer
            };
            var rules = new CreateUpdateTemplateRules
            {
                RewardTiers = new List <CreateUpdateRewardTier>
                {
                    new CreateUpdateRewardTier
                    {
                        CurrencyCode = "CAD",
                        BonusTiers   = new List <CreateUpdateTemplateTier> {
                            new CreateUpdateTemplateTier {
                                Reward = 15
                            }
                        }
                    }
                }
            };

            var bonusTemplate = await _bonusTestHelper.CreateTemplate(info : info, rules : rules);

            var bonus = await _bonusTestHelper.CreateBonus(bonusTemplate);

            _bonusName = bonus.Name;
            if (bonus.IsActive)
            {
                _activeBonusesNamesList.Add(_bonusName);
            }

            //create a player
            var player   = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD");
            var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id;

            //make first deposit
            _paymentTestHelper.MakeDepositSelenium(playerId, 117);

            //make deposit again - to get reload bonus
            _driver.MakeOfflineDeposit(player.Username, 115, player.FullName, _bonusName);

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

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

            await WaitForBonusRedemption(playerId, player.Username, TimeSpan.FromSeconds(20));

            //TODO: Until Pavel's fixes for Claim Bonuses on Member site AFTREGO-3806
            //can see Claim button
            var claimBonusPage = playerProfilePage.Menu.OpenClaimBonusPage();

            Assert.True(claimBonusPage.ClaimButton.Displayed);

            //claim the bonus
            claimBonusPage.ClaimBonus();
            Assert.AreEqual("Redemption claimed successfully.", claimBonusPage.MessageValue);

            //go to balance page
            var balanceDetailsPage = playerProfilePage.Menu.ClickBalanceInformationMenu();

            Assert.AreEqual("15.00", balanceDetailsPage.GetBonusBalance(walletTemplateId.ToString()));

            //deactivate bonus
            DeactivateBonus();
        }