public void TC41_WalletsDepositFiatcurrency() { try { string ticketStatus; string AcceptedticketStatus; string amount; string availableBalanceAfterDeposit; string availableBalanceAfterAccept; string totalBalance; string pendingBalance; string withdrawSuccessMsg; string pendingBalanceAfterDeposit; string expectedPendingBalanceAfterDeposit; string expectedPendingBalanceAfterAccept; string ticketID; string expectedAvailableBalanceAfterAccept; currencyName = TestData.GetData("USDCurrency"); comment = TestData.GetData("TC41_Comment"); amount = TestData.GetData("USDAmount"); fullName = TestData.GetData("FullName"); language = TestData.GetData("TC40_Language"); bankAddress = TestData.GetData("TC40_BankAddress"); bankAccountNumber = TestData.GetData("TC40_BankAccountNumber"); bankName = TestData.GetData("TC40_BankName"); swiftCode = TestData.GetData("TC40_SwiftCode"); withdrawStatus = TestData.GetData("WithdrawStatus"); ticketStatus = TestData.GetData("TicketStatus"); AcceptedticketStatus = TestData.GetData("AcceptedTicketStatus"); TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); userFunctions.LogIn(TestProgressLogger, Const.USER15); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER15)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); WalletPage walletpage = new WalletPage(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.StoreCurrentBalance, Const.USER15)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); pendingBalance = walletpage.PendingDepositDetailsPage; totalBalance = walletpage.TotalBalanceDetailsPage; walletpage.ClickDepositButtonOnDetails(driver); walletpage.SendUSDDeposit(driver, fullName, amount, comment); walletpage.VerifyUSDDepositOnConfirmationModal(driver, fullName, amount, comment); walletpage.ClickOnConfirmUSDModalButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.ConfirmationModalVerified); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(LogMessage.USDDepositSuccessMsg, withdrawSuccessMsg); ticketID = walletpage.GetDepositUSDTicketID(driver); GenericUtils.RefreshPage(driver); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); pendingBalanceAfterDeposit = walletpage.PendingDepositDetailsPage; availableBalanceAfterDeposit = walletpage.AvailableBalanceDetailsPage; expectedPendingBalanceAfterDeposit = GenericUtils.GetSumFromStringAfterAddition(pendingBalance, amount); Assert.Equal(expectedPendingBalanceAfterDeposit, GenericUtils.RemoveCommaFromString(pendingBalanceAfterDeposit)); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER15)); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); admincommonfunctions.SelectTicketsMenu(); admincommonfunctions.NavigateToDepositTicketsTab(); admincommonfunctions.VerifyStatus(driver, ticketID, ticketStatus); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTicketStatusAsNew); admincommonfunctions.DoubleClickOnCreatedDepositTicket(driver, ticketID); admincommonfunctions.ClickOnAcceptButtonFromDepositsTicketModal(); admincommonfunctions.VerifyStatus(driver, ticketID, AcceptedticketStatus); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTicketStatusAsAccepted); admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminUserLogoutSuccessfully, Const.ADMIN1)); userFunctions.LogIn(TestProgressLogger, Const.USER15); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER15)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); pendingBalance = walletpage.PendingDepositDetailsPage; availableBalanceAfterAccept = walletpage.AvailableBalanceDetailsPage; expectedPendingBalanceAfterAccept = GenericUtils.GetDifferenceFromStringAfterSubstraction(pendingBalanceAfterDeposit, amount); Assert.Equal(expectedPendingBalanceAfterAccept, GenericUtils.RemoveCommaFromString(pendingBalance)); TestProgressLogger.LogCheckPoint(LogMessage.PendingBalanceVerified); expectedAvailableBalanceAfterAccept = GenericUtils.GetSumFromStringAfterAddition(availableBalanceAfterDeposit, amount); Assert.Equal(expectedAvailableBalanceAfterAccept, GenericUtils.RemoveCommaFromString(availableBalanceAfterAccept)); TestProgressLogger.LogCheckPoint(LogMessage.AvailableBalanceVerified); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER15)); TestProgressLogger.EndTest(); TestProgressLogger.LogCheckPoint(LogMessage.WalletsDepositFiatcurrencyTestPassed); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.WalletsDepositFiatcurrencyTestFailed, e); throw e; } }