Beispiel #1
0
        public void Can_get_bet_limit_for_player()
        {
            var betLimit = TestDataGenerator.GetRandomString();
            var vipData  = TestDataGenerator.CreateValidVipLevelData(licensee, brand, false);

            //create bet limit
            var dashboardPage   = _driver.LoginToAdminWebsiteAsSuperAdmin();
            var betLimitManager = dashboardPage.Menu.ClickBetLevelsMenuItem();
            var newBetLimitForm = betLimitManager.OpenNewBetLevelForm();

            newBetLimitForm.SelectLicensee(licensee);
            newBetLimitForm.SelectBrand(brand);
            newBetLimitForm.SelectProduct(gameProvider);
            newBetLimitForm.AddBetLevelDetails(betLimit, betLimit);
            var viewBetLimitForm = newBetLimitForm.Submit();

            // create vip level
            var vipLevelManager = viewBetLimitForm.Menu.ClickVipLevelManagerMenuItem();
            var newVipLevelForm = vipLevelManager.OpenNewVipLevelForm();

            newVipLevelForm.EnterVipLevelDetails(vipData);
            var betLevelNameCode = string.Format("{0} - {0}", betLimit);

            newVipLevelForm.AddProductLimit(gameProvider, betLevelNameCode, currency);
            newVipLevelForm.Submit();

            Thread.Sleep(5000);

            // Make new vip level default
            var brandEntity       = _brandQueries.GetBrand(brandId);
            var defaultVipLevelId = brandEntity.DefaultVipLevelId;
            var newVipLevel       = _brandQueries.GetVipLevels().Single(o => o.Code == vipData.Code);

            _brandCommands.DeactivateVipLevel(defaultVipLevelId.Value, "-", newVipLevel.Id);

            Thread.Sleep(5000);

            //create player
            var brandLoginPage = new MemberWebsiteLoginPage(_driver);

            brandLoginPage.NavigateToMemberWebsite();
            var registerPage = brandLoginPage.GoToRegisterPage();
            var playerData   = TestDataGenerator.CreateValidPlayerDataForMemberWebsite(currency);

            registerPage.Register(playerData);

            // log in as the player to the member website and choose a game
            brandLoginPage = new MemberWebsiteLoginPage(_driver);
            brandLoginPage.NavigateToMemberWebsite();
            var playerProfilePage = brandLoginPage.Login(playerData.Username, playerData.Password);
            var gameListPage      = playerProfilePage.Menu.ClickPlayGamesMenu();
            var gamePage          = gameListPage.StartGame("Roulette");

            Assert.AreEqual(betLimit, gamePage.BetLimitCode);
        }
        public void Can_create_online_deposit_during_registration_by_entering_the_amount(string longAmount, string shortAmount)
        {
            // register a player on a brand website
            _brandWebsiteLoginPage.NavigateToMemberWebsite();
            var brandWebsiteRegisterPage = _brandWebsiteLoginPage.GoToRegisterPage();
            var registerPageStep2        = brandWebsiteRegisterPage.Register(_playerData);

            //verify the player was registered
            Assert.AreEqual("NEXT STEP: DEPOSIT BELOW", registerPageStep2.GetSuccessMessage());

            //verify the user was redirected to the registration step2
            Assert.True(_driver.IfUrlContainsSubstr("RegisterStep2"));

            //enter deposit amount manually
            registerPageStep2.EnterDepositAmount(longAmount);

            //submit deposit request
            registerPageStep2.SubmitOnlineDeposit();

            var fakePaymentServerPage = new FakePaymentServerPage(_driver);

            //Verify the deposit amount is correct
            var fakePaymentServerPageAmount = fakePaymentServerPage.GetAmountValue();

            Assert.AreEqual(shortAmount, fakePaymentServerPageAmount);

            //Notify and Redirect
            fakePaymentServerPage.NotifyAndRedirect();

            var registerPageStep4 = new RegisterPageStep4(_driver);

            //verify the deposit  was submited correct
            Assert.AreEqual("CONGRATULATION ON YOUR DEPOSIT!", registerPageStep4.GetSuccessMessage());

            var step4BalanceAmount = registerPageStep4.GetBalanceAmount();

            Assert.AreEqual(longAmount, step4BalanceAmount);
        }
Beispiel #3
0
        public override void BeforeEach()
        {
            base.BeforeEach();

            _brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);
            _playerData            = TestDataGenerator.CreateValidPlayerDataForMemberWebsite("RMB");

            // register a player on a brand website
            _brandWebsiteLoginPage.NavigateToMemberWebsite();
            var brandWebsiteRegisterPage = _brandWebsiteLoginPage.GoToRegisterPage();
            var _registerPageStep2       = brandWebsiteRegisterPage.Register(_playerData);

            //verify the player was registered
            Assert.AreEqual("NEXT STEP: DEPOSIT BELOW", _registerPageStep2.GetSuccessMessage());

            _brandWebsiteLoginPage.NavigateToMemberWebsite();
            _playerProfilePage = _brandWebsiteLoginPage.Login(_playerData.Username, _playerData.Password);
            _cashierPage       = _playerProfilePage.Menu.OpenCashierPage();
        }
Beispiel #4
0
        public override void BeforeEach()
        {
            base.BeforeEach();
            _driver.Logout();
            // register a player on member website
            _playerData = TestDataGenerator.CreateValidPlayerDataForMemberWebsite("RMB");
            _username   = _playerData.Username;

            _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);
            _memberWebsiteLoginPage.NavigateToMemberWebsite();
            var registerPage = _memberWebsiteLoginPage.GoToRegisterPage();

            registerPage.Register(_playerData);

            ////make a deposit by TestHelper
            //_container.Resolve<PaymentTestHelper>().MakeDeposit(_username, Amount);

            //Thread.Sleep(15000); // wait for deposit event proceeds for all domains and fake ugs

            ////go to a Mock games
            //_playerOverviewPage = registerPage.GoToOverviewPage();
            //var playerProfilePage1 = _playerOverviewPage.HeaderMenu.OpenMyAccount();
            //_gameListPage = playerProfilePage1.Menu.ClickPlayGamesMenu();

            // make a deposit to the player's account by Admin site
            var adminWebsiteLoginPage = new AdminWebsiteLoginPage(_driver);

            adminWebsiteLoginPage.NavigateToAdminWebsite();
            _dashboardPage = adminWebsiteLoginPage.Login("SuperAdmin", "SuperAdmin");
            _driver.MakeOfflineDeposit(_playerData.Username, Amount, _playerData.FullName);

            Thread.Sleep(15000); // wait for deposit event proceeds for all domains and fake ugs

            // log in as the player to the member website and go to a Mock games
            _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);
            _memberWebsiteLoginPage.NavigateToMemberWebsite();
            var playerOverviewPage = _memberWebsiteLoginPage.Login(_playerData.Username, _playerData.Password);
            var playerProfilePage  = playerOverviewPage.HeaderMenu.OpenMyAccount();

            _gameListPage = playerProfilePage.Menu.ClickPlayGamesMenu();
        }
Beispiel #5
0
        public void Player_can_register_and_play_and_admin_can_track_player_transactions()
        {
            // generate test data
            var userData = TestDataGenerator.CreateValidAdminUserRegistrationData(
                role: "SuperAdmin", status: "Active", licensee: DefaultLicensee, brand: DefaultBrand, currency: "RMB");
            var bonusTemplateName = "reload-bonus-templ" + TestDataGenerator.GetRandomString(4);
            var bonusName         = "reload-bonus" + TestDataGenerator.GetRandomString(5);
            var bonusCode         = TestDataGenerator.GetRandomString(5);

            _playerData = TestDataGenerator.CreateValidPlayerDataForMemberWebsite("RMB");
            const decimal bonusAmount   = 200;
            const decimal depositAmount = 100;

            // register an admin user on an admin website
            _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin();
            _dashboardPage.BrandFilter.SelectAll();
            _driver.CreateUserBasedOnPredefinedRole(userData);

            //Not a fix: investigation purposes only
            Thread.Sleep(5000); //wait for new User event proceeds.

            // log in as SuperAdmin and create a First deposit bonus
            var adminLogin    = userData.UserName;
            var adminPassword = userData.Password;

            _dashboardPage = _driver.LoginToAdminWebsiteAs(adminLogin, adminPassword);

            var bonusTemplateManagerPage   = _dashboardPage.Menu.ClickBonusTemplateMenuItem();
            var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm()
                                             .SelectLicenseeAndBrand(DefaultLicensee, DefaultBrand)
                                             .SetTemplateName(bonusTemplateName)
                                             .SelectBonusType(BonusType.FirstDeposit)
                                             .SelectIssuanceMode(IssuanceMode.AutomaticWithCode)
                                             .NavigateToRules()
                                             .SelectCurrency("RMB")
                                             .EnterBonusTier(bonusAmount)
                                             .NavigateToSummary()
                                             .CloseTab();

            var bonusManagerPage   = submittedBonusTemplateForm.Menu.ClickBonusMenuItem();
            var newBonusForm       = bonusManagerPage.OpenNewBonusForm();
            var submittedBonusForm = newBonusForm.Submit(bonusName, bonusCode, bonusTemplateName, numberOfdaysToClaimBonus: 30);

            submittedBonusForm.CloseTab();
            bonusManagerPage.ActivateBonus(bonusName);
            var activeBonus = bonusManagerPage.CheckIfBonusStatusIsActive(bonusName);

            Assert.IsTrue(activeBonus);

            //Thread.Sleep(5000); //wait for new Bonus event proceeds for all domains.

            // register a player on a brand website
            _brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);
            _brandWebsiteLoginPage.NavigateToMemberWebsite();
            var brandWebsiteRegisterPage = _brandWebsiteLoginPage.GoToRegisterPage();

            brandWebsiteRegisterPage.Register(_playerData);
            //var registrationPageStep2 = brandWebsiteRegisterPage.SubmitRgisterForm(_playerData);

            //Assert.AreEqual(true, registrationSuccess);
            //Assert.AreEqual("SUCCESS! YOU ARE NOW REGISTERED.", registrationPageStep2.SuccessMessage);

            // deposit money to the player's account
            var adminWebsiteLoginPage = new AdminWebsiteLoginPage(_driver);

            adminWebsiteLoginPage.NavigateToAdminWebsite();

            _dashboardPage = adminWebsiteLoginPage.Login(adminLogin, adminPassword);
            _driver.MakeOfflineDeposit(_playerData.Username, depositAmount, _playerData.FullName, bonusName);

            Thread.Sleep(15000); // wait for deposit event proceeds for all domains and fake ugs

            // check the player's main and bonus balance on the admin website
            var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem();

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

            playerInfoPage.OpenBalanceInformationSection();

            Assert.AreEqual(depositAmount.ToString(), playerInfoPage.GetMainBalance());
            Assert.AreEqual(bonusAmount.ToString(), playerInfoPage.GetMainBonusBalance());

            // log in as the player to the member website and choose a game
            _brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver);
            _brandWebsiteLoginPage.NavigateToMemberWebsite();
            var playerProfilePage = _brandWebsiteLoginPage.Login(_playerData.Username, _playerData.Password);
            var gameListPage      = playerProfilePage.Menu.ClickPlayGamesMenu();
            var gamePage          = gameListPage.StartGame("Football");

            // check the player balance
            var initialBalance = gamePage.Balance;

            Assert.AreEqual("Balance: $300.00", initialBalance);

            // make a bet and check a transaction's type and amount
            gamePage.PlaceInitialBet(10, "initial game action");
            //Assert.AreEqual("-10.00", gamePage.BetAmount);
            var betTransactionAmount = gamePage.GetTransactionDetail(0, "amount");

            Assert.AreEqual("-10.00", betTransactionAmount);
            Assert.AreEqual("Balance: $290.00", gamePage.Balance);

            // win a bet
            gamePage.WinBet(amount: 20);
            var winTransactionAmount = gamePage.GetTransactionDetail(1, "amount");

            Assert.AreEqual("20.00", winTransactionAmount);
            Assert.AreEqual("Balance: $310.00", gamePage.Balance);

            //lose a bet
            //gamePage.LoseBet(amount: 300);
            //var loseTransactionAmount = gamePage.GetTransactionDetail(2, "amount");
            //Assert.AreEqual("-300.00", loseTransactionAmount);
            //Assert.AreEqual("Balance: $10.00", gamePage.Balance);

            Thread.Sleep(10000); // wait for game events proceed for all domains and fake ugs

            // check the player's transactions on the admin website
            var dashboard = _driver.LoginToAdminWebsiteAsSuperAdmin();

            playerManagerPage = dashboard.Menu.ClickPlayerManagerMenuItem();
            playerInfoPage    = playerManagerPage.OpenPlayerInfoPage(_playerData.Username);
            playerInfoPage.OpenTransactionsSection();

            Assert.AreEqual(-10, playerInfoPage.GetTransactionMainAmount("Bet placed"));
            Assert.AreEqual(20, playerInfoPage.GetTransactionMainAmount("Bet won"));
            playerInfoPage.OpenBalanceInformationSection();
            Assert.AreEqual("110", playerInfoPage.GetMainBalance());
            Assert.AreEqual(bonusAmount.ToString(), playerInfoPage.GetMainBonusBalance());
        }