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); }
protected async Task LogInMemberApiWithNewUser() { // create a player var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD"); LoggedInPlayerMetadata = player; PlayerId = _playerTestHelper.GetPlayerByUsername(player.Username); await LogInMemberApi(player.Username, player.Password); }
public void Can_make_offline_deposit_and_view_main_balance_on_player_info() { const decimal depositAmount = 300.25M; // create a player var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "CAD"); // make offline deposit for the player var paymentTestHelper = _container.Resolve <PaymentTestHelper>(); paymentTestHelper.MakeDeposit(player.Username, depositAmount, waitForProcessing: true); // check the player's balance var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(player.Username); playerInfoPage.OpenBalanceInformationSection(); Assert.AreEqual(depositAmount.ToString(), playerInfoPage.GetMainBalance()); }
public void Can_get_FirstDeposit_bonus_with_code_issuance_mode_via_admin_website() { const decimal bonusAmount = 10; //create a bonus template and a bonus var bonusTemplateManagerPage = _dashboardPage.Menu.ClickBonusTemplateMenuItem(); var submittedBonusTemplateForm = bonusTemplateManagerPage.OpenNewBonusTemplateForm() .SelectLicenseeAndBrand(LicenseeName, BrandName) .SetTemplateName(_bonusTemplateName) .SelectBonusType(BonusType.FirstDeposit) .SelectIssuanceMode(IssuanceMode.AutomaticWithCode) .NavigateToRules() .SelectCurrency("RMB") .EnterBonusTier(bonusAmount) .NavigateToSummary(); var bonusManagerPage = submittedBonusTemplateForm.Menu.ClickBonusMenuItem(); var newBonusForm = bonusManagerPage.OpenNewBonusForm(); var submittedBonusForm = newBonusForm.Submit(_bonusName, TestDataGenerator.GetRandomString(6), _bonusTemplateName, 0); Assert.AreEqual("Bonus has been successfully created.", submittedBonusForm.ConfirmationMessageAfterBonusSaving); submittedBonusForm.SwitchToBonusList(); ActivateBonus(_bonusName); //create a player var player = _playerTestHelper.CreatePlayerForMemberWebsite(currencyCode: "RMB"); Thread.Sleep(5000); //wait for Player created event processing _driver.MakeOfflineDeposit(player.Username, 100, player.FullName, _bonusName); Thread.Sleep(5000); //wait for Deposit created event processing //login to admin site _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); //check the bonus playerManagerPage.SelectPlayer(player.Username); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(); playerInfoPage.OpenTransactionsSection(); var playersBonusAmount = playerInfoPage.GetTransactionBonusAmount("Bonus"); Assert.AreEqual(bonusAmount, playersBonusAmount); //deactivate bonus DeactivateBonus(); }
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 void Cannot_deactivate_player_without_permission() { //create an active player var player = _playerTestHelper.CreatePlayerForMemberWebsite(); //create a user var roleData = TestDataGenerator.CreateValidRoleData(code: null, name: null, licensee: DefaultLicensee); var userData = TestDataGenerator.CreateValidAdminUserRegistrationData( roleData.RoleName, "Active", roleData.Licensee, DefaultBrand, currency: "CAD"); _driver.CreateUser(roleData, userData, new[] { NewRoleForm.PlayerManagerCreate, NewRoleForm.PlayerManagerView }); Thread.Sleep(5000); //wait for new User event proceeds. //login as the user and try to access Deactivate button on Player Info _dashboardPage = _driver.LoginToAdminWebsiteAs(userData.UserName, userData.Password); var playerManagerPage = _dashboardPage.Menu.ClickPlayerManagerMenuItem(); var playerInfoPage = playerManagerPage.OpenPlayerInfoPage(player.Username); playerInfoPage.OpenAccountInformationSection(); var deactivateButton = playerInfoPage.FindButton(PlayerInfoPage.DeactivateButton); Assert.IsFalse(deactivateButton.Displayed); }