Beispiel #1
0
        public void Can_view_offline_deposit_request_with_permission()
        {
            var permissions = new[]
            {
                _securityTestHelper.GetPermission(Permissions.View, Modules.PlayerManager),
                _securityTestHelper.GetPermission(Permissions.View, Modules.OfflineDepositRequests)
            };

            var          role     = _securityTestHelper.CreateRole(new[] { _defaultLicensee.Id }, permissions);
            const string password = "******";
            var          user     = _securityTestHelper.CreateAdmin(_defaultLicensee.Id, new[] { _brand }, password: password, roleId: role.Id);

            // create a player and make an offline deposit request
            _driver.Navigate().Refresh();
            _dashboardPage.BrandFilter.SelectAll();
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();

            _playerManagerPage.SelectPlayer(_playerUsername);
            var newOfflineDepositRequest           = _playerManagerPage.OpenOfflineDepositRequestForm();
            var submittedOfflineDepositRequestForm = newOfflineDepositRequest.Submit(amount: 850);
            var referenceCode = submittedOfflineDepositRequestForm.ReferenceCode;

            // log in as the user with permissions and view offline deposit request details
            _dashboardPage = _driver.LoginToAdminWebsiteAs(user.Username, password);
            var depositRequestsPage           = _dashboardPage.Menu.ClickOfflineDepositConfirmMenuItem();
            var viewOfflineDepositRequestForm = depositRequestsPage.OpenViewOfflineDepositConfirmForm(_playerUsername, referenceCode);

            Assert.AreEqual(submittedOfflineDepositRequestForm.Username, viewOfflineDepositRequestForm.Username);
        }
        public void Cannot_deposit_amount_outside_payment_settings_boundaries_on_admin_website(decimal depositRequestAmount, string expectedMessage)
        {
            //create a deposit request
            _playerManagerPage.SelectPlayer(_playerUsername);
            var offlineDepositRequestForm = _playerManagerPage.OpenOfflineDepositRequestForm();

            offlineDepositRequestForm.TryToSubmit(depositRequestAmount);

            Assert.That(offlineDepositRequestForm.ErrorMessage, Is.StringContaining(expectedMessage));
        }
Beispiel #3
0
        public void Can_confirm_offline_deposit_request_with_permission()
        {
            var permissions = new[]
            {
                _securityTestHelper.GetPermission(Permissions.Confirm, Modules.OfflineDepositConfirmation),
                _securityTestHelper.GetPermission(Permissions.View, Modules.OfflineDepositRequests),
                _securityTestHelper.GetPermission(Permissions.View, Modules.PlayerManager)
            };

            var          role     = _securityTestHelper.CreateRole(new[] { _defaultLicensee.Id }, permissions);
            const string password = "******";
            var          user     = _securityTestHelper.CreateAdmin(_defaultLicensee.Id, new[] { _brand }, password: password, roleId: role.Id);

            const decimal depositAmount = 25M;

            _driver.Navigate().Refresh();
            _dashboardPage.BrandFilter.SelectAll();

            // create a player and make an offline deposit request
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();
            _playerManagerPage.SelectPlayer(_playerUsername);
            var newOfflineDepositRequest           = _playerManagerPage.OpenOfflineDepositRequestForm();
            var submittedOfflineDepositRequestForm = newOfflineDepositRequest.Submit(depositAmount);
            var referenceCode = submittedOfflineDepositRequestForm.ReferenceCode;

            // confirm the deposit
            _dashboardPage = _driver.LoginToAdminWebsiteAs(user.Username, password);
            var offlineDepositRequestsPage = _dashboardPage.Menu.ClickOfflineDepositConfirmMenuItem();

            offlineDepositRequestsPage.SelectOfflineDepositRequest(_playerUsername, referenceCode);
            var depositConfirmPage      = offlineDepositRequestsPage.ClickConfirmButton();
            var validDepositConfirmData = TestDataGenerator.CreateValidDepositConfirmData(_playerFullName, depositAmount);
            var confirmedDepositRequest = depositConfirmPage.SubmitValidDepositConfirm(validDepositConfirmData);

            Assert.IsNotNull(confirmedDepositRequest.GetConfirmationMessage);
        }
        public void Can_change_payment_level_of_player_and_view_new_payment_level_applied()
        {
            var brandTestHelper   = _container.Resolve <BrandTestHelper>();
            var paymentTestHelper = _container.Resolve <PaymentTestHelper>();
            var playerTestHelper  = _container.Resolve <PlayerTestHelper>();
            var playerQueries     = _container.Resolve <PlayerQueries>();
            var defaultLicenseeId = brandTestHelper.GetDefaultLicensee();

            //create a brand for a default licensee
            var brand = brandTestHelper.CreateBrand(defaultLicenseeId, null, null, null, true);

            paymentTestHelper.CreatePaymentSettings(brand, PaymentType.Deposit);

            // create a player with a bound bank account for a brand
            var player = playerTestHelper.CreatePlayer(true, brand.Id);

            Thread.Sleep(5000);
            var playerUsername = player.Username;

            //login to admin website, select to display the custom brand
            _driver.Logout();
            _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
            _dashboardPage.BrandFilter.SelectAll();

            //make offline deposit and check the relevant payment settings are applied for player
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();
            _playerManagerPage.SelectPlayer(playerUsername);
            var offlineDepositRequestForm = _playerManagerPage.OpenOfflineDepositRequestForm();

            Thread.Sleep(1000);
            var defaultBankName = offlineDepositRequestForm.Bank.Text;

            Assert.AreNotEqual(defaultBankName, string.Empty);

            offlineDepositRequestForm.CloseTab("Offline Deposit Request");

            //create new payment level with new bankAccount
            var bankAccount  = paymentTestHelper.CreateBankAccount(brand.Id, player.CurrencyCode);
            var paymentLevel = paymentTestHelper.CreatePaymentLevel(brand.Id, player.CurrencyCode, bankAccountId: bankAccount.Id);

            //change the payment level of the player
            _playerManagerPage = _playerManagerPage.Menu.ClickPlayerManagerMenuItem();
            var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerUsername);

            playerInfoPage.OpenAccountInformationSection();
            var changePaymentLevelDialog = playerInfoPage.OpenChangePaymentLevelDialog();

            changePaymentLevelDialog.Submit(paymentLevel.Name, "change payment level");
            Thread.Sleep(1000);

            //assert account details
            var playerAccountInfo = playerInfoPage.GetAccountDetails();

            Assert.AreEqual(paymentLevel.Name, playerAccountInfo.PaymentLevel);
            playerInfoPage.CloseTab("Player Info");

            //open offline deposit form again to confirm the bankaccount is changed
            _playerManagerPage.SelectPlayer(playerUsername);
            offlineDepositRequestForm = _playerManagerPage.OpenOfflineDepositRequestForm();
            Thread.Sleep(1000);
            var newBankName = offlineDepositRequestForm.Bank.Text;

            Assert.AreEqual(newBankName, bankAccount.Bank.BankName + " / " + bankAccount.AccountName);
            Assert.AreNotEqual(defaultBankName, newBankName);

            var submittedOfflineDepositRequest = offlineDepositRequestForm.Submit(10);

            Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDepositRequest.Confirmation);
        }
        //TODO: VladS  AFTREGO-4540, Igor, 08-April-2016
        public void Can_change_vip_level_of_player_and_view_new_payment_settings_are_applied()
        {
            var brandTestHelper   = _container.Resolve <BrandTestHelper>();
            var paymentTestHelper = _container.Resolve <PaymentTestHelper>();
            var playerTestHelper  = _container.Resolve <PlayerTestHelper>();
            var defaultLicenseeId = brandTestHelper.GetDefaultLicensee();

            //create a brand for a default licensee
            var brand = brandTestHelper.CreateBrand(defaultLicenseeId, null, null, null, true);

            paymentTestHelper.CreatePaymentSettings(brand, PaymentType.Deposit);

            // create a player with a bound bank account for a brand
            var player = playerTestHelper.CreatePlayer(true, brand.Id);

            Thread.Sleep(5000);
            var playerUsername = player.Username;

            paymentTestHelper.CreatePlayerBankAccount(player.Id, DefaultBrandId, true);
            var defaultVipLevel = player.VipLevel;

            // create second brand's vip level and payment settings based on it
            var secondVipLevel = brandTestHelper.CreateVipLevel(brand.Id, isDefault: false);
            var settings       = new PaymentSettingsValues
            {
                MinAmountPerTransaction = 5,
                MaxAmountPerTransaction = 9
            };
            var paymentSettingsForSecondVipLevel = paymentTestHelper.CreatePaymentSettings(brand, PaymentType.Deposit, secondVipLevel.Id.ToString(), settings);

            _paymentSettingsCommands.Disable(paymentSettingsForSecondVipLevel.Id, "remark");

            //login to admin website, select to display the custom brand
            _driver.Logout();
            _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
            _dashboardPage.BrandFilter.SelectAll();

            //make offline deposit and check the relevant payment settings are applied for player
            _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();
            _playerManagerPage.SelectPlayer(playerUsername);
            var offlineDepositRequestForm = _playerManagerPage.OpenOfflineDepositRequestForm();

            const decimal depositAmount = 10;
            var           submittedOfflineDepositRequest = offlineDepositRequestForm.Submit(depositAmount);

            Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDepositRequest.Confirmation);
            submittedOfflineDepositRequest.CloseTab("View Offline Deposit Request");

            //deactivate the default vip level and make the second vip level default
            var vipLevelManagerPage      = _playerManagerPage.Menu.ClickVipLevelManagerMenuItem();
            var deactivateVipLevelDialog = vipLevelManagerPage.OpenDeactivateDialog(defaultVipLevel.Name, true);

            vipLevelManagerPage = deactivateVipLevelDialog.Deactivate();

            //change the vip level of the player
            _playerManagerPage = vipLevelManagerPage.Menu.ClickPlayerManagerMenuItem();
            var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerUsername);

            playerInfoPage.OpenAccountInformationSection();
            //_driver.Manage().Window.Maximize();
            var changeVipLevelDialog = playerInfoPage.OpenChangeVipLevelDialog();

            changeVipLevelDialog.Submit(secondVipLevel.Name);
            playerInfoPage.CloseTab("Player Info");

            //enable payment settings for second vip level
            _paymentSettingsCommands.Enable(paymentSettingsForSecondVipLevel.Id, "remark");

            //try to make deposit again
            _playerManagerPage.SelectPlayer(playerUsername);
            var secondOfflineDepositRequestForm = _playerManagerPage.OpenOfflineDepositRequestForm();

            secondOfflineDepositRequestForm.TryToSubmit(depositAmount);

            //TODO: VladS Payment settings applied but message doesn't show up.
            //Assert.That(offlineDepositRequestForm.ErrorMessage, Is.StringContaining("Deposit failed. The entered amount exceeds the allowed value. Maximum value is 9.00."));
        }