public void Can_freeze_player() { // create a player var playerData = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(DefaultLicensee, DefaultBrand); var newPlayerForm = _playerManagerPage.OpenNewPlayerForm(); var submittedForm = newPlayerForm.Register(playerData); Assert.AreEqual("The player has been successfully created", submittedForm.ConfirmationMessage); submittedForm.CloseTab("View Player"); //activate frozen status a player in admin website var _playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerData.LoginName); _playerInfoPage.OpenAccountInformationSection(); var freezeStatus = _playerInfoPage.ChangeFreezeStatusOfPlayer(); Assert.AreEqual("Yes", freezeStatus); //check freeze statu a player in member website (can't do withdrawal) var _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); var _playerProfilePage = _memberWebsiteLoginPage.Login(playerData.LoginName, playerData.Password); var _withdrawalPage = _playerProfilePage.Menu.ClickWithdrawalDropMenu(); var _frozenDescription = _withdrawalPage.FrozenDescription(); Assert.IsTrue(_frozenDescription.Contains("Your account has been frozen and cannot proceed the withdrawal request.")); //check freeze statu a player in member website(can't do betting) }
public void Can_send_new_password_to_player() { //create a player var playerData = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(DefaultLicensee, DefaultBrand, currency: "CAD"); var newPlayerForm = _playerManagerPage.OpenNewPlayerForm(); var submittedPlayerForm = newPlayerForm.Register(playerData); Assert.AreEqual("The player has been successfully created", submittedPlayerForm.ConfirmationMessage); submittedPlayerForm.CloseTab("View Player"); // send a new password to the player var newPassword = TestDataGenerator.GetRandomString(8); var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerData.LoginName); playerInfoPage.OpenAccountInformationSection(); var sendNewPasswordDialog = playerInfoPage.OpenSendNewPasswordDialog(); sendNewPasswordDialog.SpecifyNewPassword(newPassword); sendNewPasswordDialog.Send(); Assert.AreEqual("New password has been successfully sent", sendNewPasswordDialog.ConfirmationMessage); // register a player on a brand website var brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); brandWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = brandWebsiteLoginPage.Login(playerData.LoginName, newPassword); //Assert.AreEqual(playerData.LoginName, playerProfilePage.GetUserName()); Assert.That(playerProfilePage.GetUserName(), Is.StringContaining(playerData.LoginName)); }
public void Cannot_login_to_brand_website_as_deactivated_player() { var player = _playerTestHelper.CreatePlayerForMemberWebsite(); //deactivate a player var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(player.Username); playerInfoPage.OpenAccountInformationSection(); playerInfoPage.DeactivatePlayer(); //Refresh the page as a temporary solution _driver.Navigate().Refresh(); _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); _playerManagerPage.SelectPlayer(player.Username); Assert.AreEqual("Inactive", _playerManagerPage.Status); //try to log in to the brand website var brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); brandWebsiteLoginPage.NavigateToMemberWebsite(); brandWebsiteLoginPage.TryToLogin(player.Username, player.Password); Assert.AreEqual("Non active", brandWebsiteLoginPage.GetErrorMsg()); var expectedUrl = _settingsProvider.GetMemberWebsiteUrl() + "Home/PlayerProfile"; var actualUrl = _driver.Url; Assert.AreNotEqual(expectedUrl, actualUrl); }
public void Can_deactivate_player() { // create a player var playerData = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(DefaultLicensee, DefaultBrand); var newPlayerForm = _playerManagerPage.OpenNewPlayerForm(); var submittedForm = newPlayerForm.Register(playerData); Assert.AreEqual("The player has been successfully created", submittedForm.ConfirmationMessage); submittedForm.CloseTab("View Player"); //deactivate a player var playerInfoPage = _playerManagerPage.OpenPlayerInfoPage(playerData.LoginName); playerInfoPage.OpenAccountInformationSection(); playerInfoPage.DeactivatePlayer(); playerInfoPage.CloseTab("Player Info"); //check player in admin website _driver.Navigate().Refresh(); _playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); _playerManagerPage.SelectPlayer(playerData.LoginName); Assert.AreEqual("Inactive", _playerManagerPage.Status); //check deactivate a player in member website (try to login) var _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); _memberWebsiteLoginPage.TryToLogin(playerData.LoginName, playerData.Password); Assert.AreEqual("Non active", _memberWebsiteLoginPage.GetErrorMsg()); }
public override void BeforeEach() { base.BeforeEach(); _driver.Manage().Cookies.DeleteAllCookies(); _loginPage = new MemberWebsiteLoginPage(_driver); _loginPage.NavigateToMemberWebsite(); _driver.WaitForJavaScript(); }
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(); }
public static PlayerProfilePage LoginToMemberWebsite(this IWebDriver driver, string username, string password) { var loginPage = new MemberWebsiteLoginPage(driver); loginPage.NavigateToMemberWebsite(); Logout(driver); var playerProfilePage = loginPage.Login(username, password); return(playerProfilePage); }
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); }
public void Can_change_password() { _playerProfilePage.ChangePassword(_correctPassword); _driver.WaitForJavaScript(); Assert.AreEqual(_playerProfilePage.GetPasswordChangedMsg(), "Password has been changed successfully."); _driver.Manage().Cookies.DeleteAllCookies(); _loginPage = new MemberWebsiteLoginPage(_driver); _loginPage.NavigateToMemberWebsite(); _driver.WaitForJavaScript(); var currentPage = _playerProfilePage = _loginPage.Login(_correctUsername, "new-password"); Assert.That(currentPage.GetUserName(), Is.StringContaining(_correctUsername)); }
public void Can_make_offline_deposit_and_view_updated_balance_on_game_page() { // register a player on member website _playerData = _container.Resolve <PlayerTestHelper>().CreatePlayerForMemberWebsite("CAD"); _username = _playerData.Username; _password = _playerData.Password; //check empty balance of the player _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); _playerProfilePage = _memberWebsiteLoginPage.Login(_username, _password); _gameListPage = _playerProfilePage.Menu.ClickPlayGamesMenu(); _gamePage = _gameListPage.StartGame("Football"); var initialBalance = _gamePage.Balance; Assert.AreEqual("Balance: $0.00", initialBalance); var playerName = _gamePage.PlayerName; var expectedPlayerLoginName = String.Format("Name: {0}", _playerData.Username); Assert.AreEqual(expectedPlayerLoginName, playerName); // login to admin website and make an offline deposit request _driver.Manage().Cookies.DeleteAllCookies(); var dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); _driver.MakeOfflineDeposit(_username, Amount, _playerData.FullName); var playerManagerPage = dashboardPage.Menu.ClickPlayerManagerMenuItem(); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(_username); playerInfoPage.OpenTransactionsSection(); Assert.AreEqual(Amount, playerInfoPage.GetTransactionMainAmount("Deposit")); // check the balance on the member website _memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _memberWebsiteLoginPage.NavigateToMemberWebsite(); _playerProfilePage = _memberWebsiteLoginPage.Login(_username, _password); var gameListPage = _playerProfilePage.Menu.ClickPlayGamesMenu(); _gamePage = gameListPage.StartGame("Football"); var currentBalance = _gamePage.Balance; Assert.AreEqual("Balance: $100.25", currentBalance); }
public override void BeforeAll() { base.BeforeAll(); //create a player _playerTestHelper = _container.Resolve<PlayerTestHelper>(); _paymentTestHelper = _container.Resolve<PaymentTestHelper>(); _player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD"); //deposit money to the player's main balance _paymentTestHelper.MakeDeposit(_player.Username, DepositAmount); //navigate to brand website _brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); _brandWebsiteLoginPage.NavigateToMemberWebsite(); }
public override void BeforeEach() { base.BeforeEach(); _driver.Logout(); _data = TestDataGenerator.CreateValidPlayerDataForMemberWebsite(); _correctUsername = _data.Username; _correctPassword = _data.Password; _registerPage = new RegisterPage(_driver); _registerPage.NavigateToMemberWebsite(); _registerPage.Register(_data); _loginPage = new MemberWebsiteLoginPage(_driver); _loginPage.NavigateToMemberWebsite(); _driver.WaitForJavaScript(); _playerProfilePage = _loginPage.Login(_correctUsername, _correctPassword); _driver.WaitForJavaScript(); }
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(); }
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()); }
//[Test, Ignore("Configuration of bonus is not available for R1")] public void Can_redeem_mobile_plus_email_verification_bonus() { const decimal bonusAmount = 10; const string brandName = "831"; //Brand with Email activation method //Create a bonus template and a bonus var bonusTemplateManagerPage = _dashboardPage.Menu.ClickBonusTemplateMenuItem(); var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm() .SelectLicenseeAndBrand(LicenseeName, brandName) .SetTemplateName(_bonusTemplateName) .SelectBonusType(BonusType.MobilePlusEmailVerification) .NavigateToRules() .SelectCurrency("CAD") .EnterBonusTier(bonusAmount) .NavigateToSummary(); var bonusManagerPage = submittedBonusTemplateForm.Menu.ClickBonusMenuItem(); var newBonusForm = bonusManagerPage.OpenNewBonusForm(); var submittedBonusForm = newBonusForm.Submit(_bonusName, TestDataGenerator.GetRandomString(6), _bonusTemplateName, 0); submittedBonusForm.SwitchToBonusList(); ActivateBonus(_bonusName); var playerData = _driver.LoginAsSuperAdminAndCreatePlayer(LicenseeName, brandName, "CAD", "en-US", "CA", false); Thread.Sleep(5000); //wait for Player created event processing //Verify email address var emailVerificationToken = new PlayerRepository().Players.Single(p => p.Username == playerData.LoginName) .AccountActivationEmailToken; _driver.Manage().Cookies.DeleteAllCookies(); var memberWebsiteAccountActivationPage = new AccountActivationPage(_driver, emailVerificationToken); memberWebsiteAccountActivationPage.NavigateTo(); //Verify mobile phone number var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = memberWebsiteLoginPage.Login(playerData.LoginName, playerData.Password); playerProfilePage.RequestMobileVerificationCode(); var mobileVerificationCode = new PlayerRepository().Players.Single(p => p.Username == playerData.LoginName).MobileVerificationCode; playerProfilePage.VerifyMobileNumber(mobileVerificationCode); //login to admin site _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); //check the bonus playerManagerPage.SelectPlayer(playerData.LoginName); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(); playerInfoPage.OpenTransactionsSection(); var playersBonusAmount = playerInfoPage.GetTransactionBonusAmount("Bonus"); Assert.AreEqual(bonusAmount, playersBonusAmount); //deactivate bonus DeactivateBonus(); }
//[Test, Ignore("Configuration of bonus is not available for R1")] public void Can_redeem_refer_friends_bonus() { const decimal bonusAmount = 150; const decimal wageringCondition = 2; const decimal minDepositAmount = 200; const decimal actualDepositAmount = 250; const decimal requiredWagering = actualDepositAmount * wageringCondition; //create a bonus template var bonusTemplateManagerPage = _dashboardPage.Menu.ClickBonusTemplateMenuItem(); var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm() .SelectLicenseeAndBrand(LicenseeName, BrandName) .SetTemplateName(_bonusTemplateName) .SelectBonusType(BonusType.ReferFriend) .SelectIssuanceMode(IssuanceMode.ManualByPlayer) .NavigateToRules() .SelectCurrency("CAD") .EnterReferFriendsConfiguration(minDepositAmount, wageringCondition) .EnterBonusTier(bonusAmount, 1, 1) .NavigateToSummary(); var bonusManagerPage = submittedBonusTemplateForm.Menu.ClickBonusMenuItem(); var newBonusForm = bonusManagerPage.OpenNewBonusForm(); //create a bonus var submittedBonusForm = newBonusForm.Submit(_bonusName, TestDataGenerator.GetRandomString(6), _bonusTemplateName, 0); submittedBonusForm.SwitchToBonusList(); ActivateBonus(_bonusName); //create a referrer var referrerData = _driver.LoginAsSuperAdminAndCreatePlayer(LicenseeName, BrandName, "CAD"); //refer a friend _driver.Manage().Cookies.DeleteAllCookies(); var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = memberWebsiteLoginPage.Login(referrerData.LoginName, referrerData.Password); var referFriendPage = playerProfilePage.Menu.ClickReferFriendsMenu(); referFriendPage.ReferFriend(); Assert.AreEqual("Phone numbers successfully submitted.", referFriendPage.Message); _driver.Manage().Cookies.DeleteAllCookies(); //register referred var referralId = new PlayerRepository().Players.Single(a => a.Username == referrerData.LoginName).ReferralId; var referredRegistrationData = TestDataGenerator.CreateValidPlayerDataForMemberWebsite("CAD"); var registerPage = new RegisterPage(_driver); registerPage.NavigateToMemberWebsite(referralId.ToString()); registerPage.Register(referredRegistrationData); //depositing missing funds in order to complete wagering _paymentTestHelper.MakeDeposit(referredRegistrationData.Username, requiredWagering - actualDepositAmount); //make deposit for referred _driver.MakeOfflineDeposit(referredRegistrationData.Username, actualDepositAmount, referredRegistrationData.FullName); _driver.Manage().Cookies.DeleteAllCookies(); //complete wagering requirements for referred memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); _driver.Manage().Cookies.DeleteAllCookies(); _driver.Navigate().Refresh(); playerProfilePage = memberWebsiteLoginPage.Login(referredRegistrationData.Username, referredRegistrationData.Password); var gameListPage = playerProfilePage.Menu.ClickPlayGamesMenu(); var gamePage = gameListPage.StartGame("Poker"); gamePage.PlaceInitialBet(requiredWagering, ""); gamePage.WinBet(requiredWagering); _driver.Manage().Cookies.DeleteAllCookies(); //claim refer a friend bonus reward memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); playerProfilePage = memberWebsiteLoginPage.Login(referrerData.LoginName, referrerData.Password); var claimBonusPage = playerProfilePage.Menu.ClickClaimBonusSubMenu(); claimBonusPage.ClaimBonus(); Assert.AreEqual("Redemption claimed successfully.", claimBonusPage.MessageValue); //login to admin site _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); //check the bonus playerManagerPage.SelectPlayer(referrerData.LoginName); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(); playerInfoPage.OpenTransactionsSection(); var playersBonusAmount = playerInfoPage.GetTransactionBonusAmount("Bonus"); Assert.AreEqual(bonusAmount, playersBonusAmount); //deactivate bonus DeactivateBonus(); }
//[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(); }
public async Task Can_get_FirstDeposit_bonus_with_automatic_issuance_mode_via_member_website() { //create a bonus template and a bonus - Bonus type:First, Reward Type: Fixed, Issuance:Automatic var walletTemplateId = _brand.WalletTemplates.First().Id; var info = new CreateUpdateTemplateInfo { Name = TestDataGenerator.GetRandomString(), TemplateType = BonusType.FirstDeposit, BrandId = _brand.Id, WalletTemplateId = walletTemplateId, Mode = IssuanceMode.Automatic }; var rules = new CreateUpdateTemplateRules { RewardTiers = new List <CreateUpdateRewardTier> { new CreateUpdateRewardTier { CurrencyCode = "CAD", BonusTiers = new List <CreateUpdateTemplateTier> { new CreateUpdateTemplateTier { Reward = 19 } } } } }; 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"); //login to member site var memberWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); memberWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password); CashierPage cashierPage = playerProfilePage.Menu.OpenCashierPage(); var offlineDepositRequestPage = cashierPage.OpenOfflineDepositPage(); offlineDepositRequestPage.Submit(amount: "113", playerRemark: "my deposit"); Assert.AreEqual("Congratulation on your deposit!", offlineDepositRequestPage.GetConfirmationMessage()); var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id; //Wait for record in DB WaitForOfflineDeposit(playerId, amount: 113, timeout: TimeSpan.FromSeconds(20)); var firstdeposit = GetLastDepositByPlayerId(playerId); _paymentTestHelper.ConfirmOfflineDeposit(firstdeposit); _paymentTestHelper.VerifyOfflineDeposit(firstdeposit, true); _paymentTestHelper.ApproveOfflineDeposit(firstdeposit, true); //re-login to member site memberWebsiteLoginPage.NavigateToMemberWebsite(); _driver.Logout(); //make sure that we've got a bonus playerProfilePage = memberWebsiteLoginPage.Login(player.Username, player.Password); playerProfilePage.Menu.OpenCashierPage(); Assert.AreEqual("19", cashierPage.GetBonusBalance()); //deactivate bonus DeactivateBonus(); }
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(); }
public async Task Can_get_FirstDeposit_bonus_with_code_issuance_mode_via_member_website() { //create a bonus template and a bonus - Bonus type:First, Reward Type: Fixed, Issuance:AutomaticWithCode var walletTemplateId = _brand.WalletTemplates.First().Id; var info = new CreateUpdateTemplateInfo { Name = TestDataGenerator.GetRandomString(), TemplateType = BonusType.FirstDeposit, BrandId = _brand.Id, WalletTemplateId = walletTemplateId, Mode = IssuanceMode.AutomaticWithCode }; var rules = new CreateUpdateTemplateRules { RewardTiers = new List <CreateUpdateRewardTier> { new CreateUpdateRewardTier { CurrencyCode = "CAD", BonusTiers = new List <CreateUpdateTemplateTier> { new CreateUpdateTemplateTier { Reward = 21 } } } } }; 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"); Thread.Sleep(5000); //wait for Player created event processing //log in to brand website var brandWebsiteLoginPage = new MemberWebsiteLoginPage(_driver); brandWebsiteLoginPage.NavigateToMemberWebsite(); var playerProfilePage = brandWebsiteLoginPage.Login(player.Username, player.Password); var offlineDepositRequestPage = playerProfilePage.Menu.ClickOfflineDepositSubmenu(); //create Deposit via member site offlineDepositRequestPage.Submit(amount: "112", playerRemark: "my deposit", bonusCode: bonus.Code); Assert.AreEqual("Offline deposit requested successfully.", offlineDepositRequestPage.ConfirmationMessage); Thread.Sleep(5000); //wait for Deposit created event processing var playerId = _playerQueries.GetPlayerByUsername(player.Username).Id; //Wait for record in DB WaitForOfflineDeposit(playerId, amount: 112, timeout: TimeSpan.FromSeconds(20)); var deposit = GetLastDepositByPlayerId(playerId); _paymentTestHelper.ConfirmOfflineDeposit(deposit); _paymentTestHelper.VerifyOfflineDeposit(deposit, true); _paymentTestHelper.ApproveOfflineDeposit(deposit, true); Thread.Sleep(5000); //wait for deposit Approval event processing //log in to brand website brandWebsiteLoginPage.NavigateToMemberWebsite(); _driver.Logout(); playerProfilePage = brandWebsiteLoginPage.Login(player.Username, player.Password); var balanceDetailsPage = playerProfilePage.Menu.ClickBalanceInformationMenu(); Assert.AreEqual("21.00", balanceDetailsPage.GetBonusBalance(walletTemplateId.ToString())); //deactivate bonus DeactivateBonus(); }
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(); }