public void Can_view_Deposit_report() { const decimal depositAmount = 150; // login to admin website, create a player and make an offline deposit var playerData = _driver.LoginAsSuperAdminAndCreatePlayer(Licensee, Brand, "RMB"); var menu = new BackendMenuBar(_driver); var playerManagerPage = menu.ClickPlayerManagerMenuItem(); playerManagerPage.SelectPlayer(playerData.LoginName); var newOfflineDepositRequest = playerManagerPage.OpenOfflineDepositRequestForm(); var submittedOfflineDepositRequestForm = newOfflineDepositRequest.Submit(amount: depositAmount); var referenceCode = submittedOfflineDepositRequestForm.ReferenceCode; // open report page _driver.Logout(); _dashboardPage = _driver.LoginToAdminWebsiteAsSuperAdmin(); var paymentReportsPage = _dashboardPage.Menu.ClickPaymentReportsMenuItem(); var reportTab = paymentReportsPage.OpenDepositReport(); // generate empty report in order to ensure, that grid contains no records before actual filter is applied GenerateEmptyReport(reportTab, "Transaction ID"); // generate report with existed (just created) data, check that report contains one record _driver.TypeFilterCriterion(column: "Transaction ID", condition: "is", value: referenceCode); _driver.GenerateReport(); var reportDataDisplayed = reportTab.CheckIfAnyReportDataDisplayed(); Assert.IsTrue(reportDataDisplayed); }
public static DashboardPage MakeOfflineDeposit(this IWebDriver driver, string username, decimal depositAmount, string fullName, string bonusName = null) { driver.LoginToAdminWebsiteAsSuperAdmin(); var menu = new BackendMenuBar(driver); var playerManagerPage = menu.ClickPlayerManagerMenuItem(); //create a deposit request, apply a bonus playerManagerPage.SelectPlayer(username); var offlineDepositRequestForm = playerManagerPage.OpenOfflineDepositRequestForm(); SubmittedOfflineDepositRequestForm submittedOfflineDeposit; if (bonusName == null) { submittedOfflineDeposit = offlineDepositRequestForm.Submit(depositAmount); Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDeposit.Confirmation); } else { submittedOfflineDeposit = offlineDepositRequestForm.SubmitWithBonus(bonusName, depositAmount); Assert.AreEqual("Offline deposit request has been created successfully", submittedOfflineDeposit.Confirmation); } var referenceCode = submittedOfflineDeposit.ReferenceCode; //confirm a deposit request var offlineDepositRequestsPage = menu.ClickOfflineDepositConfirmMenuItem(); offlineDepositRequestsPage.SelectOfflineDepositRequest(username, referenceCode); var depositConfirmPage = offlineDepositRequestsPage.ClickConfirmButton(); var validDepositConfirmData = TestDataGenerator.CreateValidDepositConfirmData(fullName, depositAmount); var submittedConfirmDeposit = depositConfirmPage.SubmitValidDepositConfirm(validDepositConfirmData); Assert.AreEqual("Offline deposit request has been confirmed successfully", submittedConfirmDeposit.GetConfirmationMessage); //verify a deposit request var playerDepositVerifyPage = menu.ClickPlayerDepositVerifyItem(); playerDepositVerifyPage.FilterGrid(username); playerDepositVerifyPage.SelectConfirmedDeposit(referenceCode); var verifyForm = playerDepositVerifyPage.OpenVerifyForm(); var submittedVerifyDeposit = verifyForm.Submit(); Assert.AreEqual("Offline deposit request has been verified successfully", submittedVerifyDeposit.ConfirmationMessage); //approve a deposit request var playerDepositApprovePage = menu.ClickPlayerDepositApproveItem(); playerDepositApprovePage.FilterGrid(username); playerDepositApprovePage.SelectVerifiedDeposit(referenceCode); var approveForm = playerDepositApprovePage.OpenApproveForm(); var submittedApproveDeposit = approveForm.Submit(depositAmount, "0"); Assert.AreEqual("Offline deposit request has been approved successfully", submittedApproveDeposit.ConfirmationMessage); driver.Navigate().Refresh(); var dashboardPage = new DashboardPage(driver); return(dashboardPage); }
public static PlayerRegistrationDataForAdminWebsite CreatePlayerAsAdmin(this IWebDriver driver, string licensee, string brand, string currency = null, string culture = null, string country = null, bool isActive = true) { var menu = new BackendMenuBar(driver); var playerManagerPage = menu.ClickPlayerManagerMenuItem(); var newPlayerForm = playerManagerPage.OpenNewPlayerForm(); var playerDataForAdminWebsite = TestDataGenerator.CreateValidPlayerDataForAdminWebsite(licensee, brand, currency, culture, country); playerDataForAdminWebsite.IsInactive = !isActive; var submittedPlayerForm = newPlayerForm.Register(playerDataForAdminWebsite); submittedPlayerForm.CloseTab("View Player"); driver.Navigate().Refresh(); return(playerDataForAdminWebsite); }