public void TC43_VerifyBuyAndSell_SellTest() { instrument = TestData.GetData("Instrument"); sellTab = TestData.GetData("SellTab"); buyTab = TestData.GetData("BuyTab"); sellOrderSize = TestData.GetData("TC43_SellOrderSize"); limitPrice = TestData.GetData("TC43_LimitPrice"); timeInForce = TestData.GetData("TC11_TimeInForce"); UserFunctions userfuntionality = new UserFunctions(TestProgressLogger); BuyAndSellPage objBuyAndSellPage = new BuyAndSellPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); try { string askPrice; TestProgressLogger.StartTest(); userFunctions.LogIn(TestProgressLogger, Const.USER6); askPrice = userCommonFunction.CancelAndPlaceLimitBuyOrder(driver, instrument, sellTab, sellOrderSize, limitPrice, timeInForce); UserCommonFunctions.ConfirmWindowOrder(askPrice, limitPrice, driver); userFunctions.LogOut(); userfuntionality.LogIn(TestProgressLogger, Const.USER8); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToBuySell(driver); objBuyAndSellPage.SellBtn(); Assert.True(objBuyAndSellPage.VerifyMakeATransaction()); Assert.True(objBuyAndSellPage.VerifyChart()); Assert.True(objBuyAndSellPage.VerifySellOption()); Assert.True(objBuyAndSellPage.VerifyFifthRadioButtonOption()); Assert.True(objBuyAndSellPage.VerifyFifthWithBlankValues()); objBuyAndSellPage.PlaceSellOrder(instrument, sellTab); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BuyAndSell_SellTestVerificationPassed, buyTab)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); throw ex; } catch (Exception ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(String.Format(LogMessage.BuyAndSell_SellTestVerificationFailed, buyTab), ex); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
[Fact] //Admin_3 public void UpdateAccountInformation() { try { string accountId; string updatedAccountName; string actualUpdatedAccountName; string accountNameOnAccontDetails; accountId = TestData.GetData("TCAdmin4_UserAccountID"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); AdminFunctions adminFunctions = new AdminFunctions(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); // Double click on particular user and edit account name. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); adminAccountPage.EditAccountInformation(driver); updatedAccountName = adminAccountPage.EditAccountName(driver); adminAccountPage.ClickOnSaveButton(driver); // Verify updated account name on account details. accountNameOnAccontDetails = adminAccountPage.GetAccountNameOnAccountDetails(driver); Assert.Equal(updatedAccountName, accountNameOnAccontDetails); admincommonfunctions.UserMenuBtn(); adminFunctions.AdminLogOut(); // Log in user portal userFunctions.LogIn(TestProgressLogger, Const.USER17); // Verify update account name on user portal. actualUpdatedAccountName = userFunctions.GetTextOfLoggedInUser(); Assert.Equal(updatedAccountName, actualUpdatedAccountName); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error("", e); throw e; } }
public void TC35_VerifyCancelBlockTradeOrderWithoutLockedInTest() { instrument = TestData.GetData("Instrument"); counterPartyPrice = TestData.GetData("TC33_CounterPartyPrice"); productBoughtPrice = TestData.GetData("TC33_ProductBoughtPrice"); productSoldPrice = TestData.GetData("TC33_ProductSoldPrice"); UserFunctions userfuntionality = new UserFunctions(TestProgressLogger); DetailsOnLandingPage objDetailsOnLandingPage = new DetailsOnLandingPage(TestProgressLogger); ReportBlockTradePage objReportBlockTradePage = new ReportBlockTradePage(TestProgressLogger); VerifyOrdersTab objVerifyOrdersTab = new VerifyOrdersTab(driver, TestProgressLogger); try { TestProgressLogger.StartTest(); userfuntionality.LogIn(TestProgressLogger, Const.USER6); Thread.Sleep(2000); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); Assert.True(objDetailsOnLandingPage.ExchangeLinkButton()); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); objReportBlockTradePage.ReportBlockTradeButton(); objReportBlockTradePage.VerifyReportBlockTradeWindow(); objReportBlockTradePage.SubmitBlockTradeReportForUser(counterPartyPrice, productBoughtPrice, productSoldPrice); Assert.True(objVerifyOrdersTab.VerifyCancelBlockTradeOrdersInOpenOrderTab()); Thread.Sleep(3000); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifiedCancelOrderButtonPassed)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifiedBlockTradeWithoutLockedInCancelPassed)); TestProgressLogger.EndTest(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } catch (Exception ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(String.Format(LogMessage.VerifiedCancelOrderButtonFailed)); TestProgressLogger.Error(String.Format(LogMessage.VerifiedBlockTradeWithoutLockedInCancelFailed)); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
public void TC1_VerifyDetailsOnLandingPageTest() { instrument = TestData.GetData("Instrument"); menuTab = TestData.GetData("MenuTab"); buyTab = TestData.GetData("BuyTab"); sellTab = TestData.GetData("SellTab"); orderBook = TestData.GetData("OrderBookValue"); openOrders = TestData.GetData("OpenOrdersValue"); filledOrders = TestData.GetData("FilledOrdersValue"); InactiveOrders = TestData.GetData("InactiveOrdersValue"); tradeReports = TestData.GetData("TradeReportsValue"); depositStatus = TestData.GetData("DepositStatusValue"); withdrawStatus = TestData.GetData("WithdrawStatusValue"); pairValue = TestData.GetData("TC1_PairValue"); sideValue = TestData.GetData("TC1_SideValue"); typeValue = TestData.GetData("TC1_TypeValue"); sizeValue = TestData.GetData("TC1_SizeValue"); priceValue = TestData.GetData("TC1_PriceValue"); dateTimeValue = TestData.GetData("TC1_DateTimeValue"); statusValue = TestData.GetData("TC1_StatusValue"); actionValue = TestData.GetData("TC1_ActionValue"); actionsValue = TestData.GetData("TC1_ActionsValue"); idValue = TestData.GetData("TC1_IDValue"); totalValue = TestData.GetData("TC1_TotalValue"); feeValue = TestData.GetData("TC1_FeeValue"); executionValue = TestData.GetData("TC1_ExecutionIDValue"); productValue = TestData.GetData("TC1_ProductValue"); amountValue = TestData.GetData("TC1_AmountValue"); createdValue = TestData.GetData("TC1_CreatedValue"); priceChartValue = TestData.GetData("TC1_PriceChartValue"); availableBalanceValue = TestData.GetData("TC1_AvailableBalanceValue"); holdValue = TestData.GetData("TC1_HoldValue"); pendingDepositsValue = TestData.GetData("TC1_PendingDepositsValue"); totalBalanceValue = TestData.GetData("TC1_TotalBalanceValue"); recentTradesPriceValue = TestData.GetData("TC1_RecentTradesPriceValue"); recentTradesQtyValue = TestData.GetData("TC1_RecentTradesQtyValue"); recentTradesTimeValue = TestData.GetData("TC1_RecentTradesTimeValue"); orderBookPriceValue = TestData.GetData("TC1_OrderBookPriceValue"); orderBookQtyValue = TestData.GetData("TC1_OrderBookQtyValue"); orderBookMySizeValue = TestData.GetData("TC1_OrderBookMySizeValue"); OrderEntryMarketValue = TestData.GetData("TC1_OrderEntryMarketValue"); OrderEntryLimitValue = TestData.GetData("TC1_OrderEntryLimitValue"); OrderEntryStopValue = TestData.GetData("TC1_OrderEntryStopValue"); DetailsOnLandingPage objDetailsOnLandingPage = new DetailsOnLandingPage(TestProgressLogger); try { TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); userFunctions.LogIn(TestProgressLogger, Const.USER14); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); Assert.True(objDetailsOnLandingPage.ExchangeLinkButton()); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); Assert.True(objDetailsOnLandingPage.VerifyOpenOrdersTab(openOrders, pairValue, sideValue, typeValue, sizeValue, priceValue, dateTimeValue, statusValue, actionValue)); Assert.True(objDetailsOnLandingPage.VerifyFilledOrdersTab(filledOrders, idValue, pairValue, sideValue, sizeValue, priceValue, totalValue, feeValue, executionValue, dateTimeValue)); Assert.True(objDetailsOnLandingPage.VerifyInactiveOrdersTab(filledOrders, pairValue, sideValue, typeValue, sizeValue, priceValue, dateTimeValue, statusValue)); Assert.True(objDetailsOnLandingPage.VerifyTradeReportTab(tradeReports, pairValue, sideValue, sizeValue, priceValue, feeValue, dateTimeValue, statusValue)); Assert.True(objDetailsOnLandingPage.VerifyDepositStatusTab(depositStatus, productValue, amountValue, statusValue, createdValue, feeValue)); Assert.True(objDetailsOnLandingPage.VerifyWithdrawStatusTab(withdrawStatus, productValue, amountValue, statusValue, createdValue, feeValue, actionsValue)); Assert.True(objDetailsOnLandingPage.PriceChartTxt(priceChartValue)); Assert.True(objDetailsOnLandingPage.OrderEntryWithBuyOption()); Assert.True(objDetailsOnLandingPage.OrderEntryWithSellOption()); objDetailsOnLandingPage.balancesBtn(); Assert.True(objDetailsOnLandingPage.AvailableBalanceTxt(availableBalanceValue)); Assert.True(objDetailsOnLandingPage.HoldTxt(holdValue)); Assert.True(objDetailsOnLandingPage.PendingDepositsTxt(pendingDepositsValue)); Assert.True(objDetailsOnLandingPage.TotalBalanceTxt(totalBalanceValue)); Assert.True(objDetailsOnLandingPage.verifyOrderBookMenuTab(orderBookPriceValue, orderBookQtyValue, orderBookMySizeValue)); Assert.True(objDetailsOnLandingPage.verifyRecentTradesMenuTab(recentTradesPriceValue, recentTradesQtyValue, recentTradesTimeValue)); objDetailsOnLandingPage.OrderEntryBtn(); Thread.Sleep(2000); Assert.True(objDetailsOnLandingPage.VerifyBuyOrderEntryMenuAndSubMenuTab(buyTab, OrderEntryMarketValue, OrderEntryLimitValue, OrderEntryStopValue)); Assert.True(objDetailsOnLandingPage.VerifySellOrderEntryMenuAndSubMenuTab(sellTab, OrderEntryMarketValue, OrderEntryLimitValue, OrderEntryStopValue)); Assert.True(objDetailsOnLandingPage.CancelBtn()); Assert.True(objDetailsOnLandingPage.AdvanceOrderBtn()); Assert.True(objDetailsOnLandingPage.OrderEntryButn()); Assert.True(objDetailsOnLandingPage.balancesButn()); Assert.True(objDetailsOnLandingPage.VariouOptionInPriceChart()); Thread.Sleep(3000); } catch (NoSuchElementException ex) { TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(String.Format(LogMessage.VerifiedDetailInLandingPageFailed)); throw e; } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
public void TC6_VerifySellLimitOrder() { try { string type; string buyOrderFeeValue; string sellOrderFeeValue; instrument = TestData.GetData("Instrument"); orderType = TestData.GetData("OrderType"); menuTab = TestData.GetData("MenuTab"); buyTab = TestData.GetData("BuyTab"); sellTab = TestData.GetData("SellTab"); buyOrderSize = TestData.GetData("TC6_BuyOrderSize"); sellOrderSize = TestData.GetData("TC6_SellOrderSize"); incBuyOrderSize = TestData.GetData("TC6_IncreasedBuyOrderSize"); decBuyOrderSize = TestData.GetData("TC6_DecreasedBuyOrderSize"); limitPrice = TestData.GetData("TC6_LimitPrice"); timeInForce = TestData.GetData("TC6_TimeInForce"); feeComponent = TestData.GetData("FeeComponent"); type = Const.Limit; buyOrderFeeValue = GenericUtils.FeeAmount(buyOrderSize, feeComponent); sellOrderFeeValue = GenericUtils.SellFeeAmount(sellOrderSize, limitPrice, feeComponent); TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); OrderEntryPage orderEntryPage = new OrderEntryPage(driver, TestProgressLogger); VerifyOrdersTab objVerifyOrdersTab = new VerifyOrdersTab(driver, TestProgressLogger); // Creating Buy and Sell Order to get the last price userCommonFunction.PlaceOrdersToSetLastPrice(driver, instrument, buyTab, sellTab, buyOrderSize, limitPrice, timeInForce, Const.USER10, Const.USER11); // Scenario 1: Buy order B1 with same price is available and B1 quantity is = S1. userFunctions.LogIn(TestProgressLogger, Const.USER8); Dictionary <string, string> placeLimitSellOrder = orderEntryPage.PlaceLimitSellOrder(instrument, sellTab, sellOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyOpenOrdersTab(instrument, sellTab, type, Double.Parse(sellOrderSize), limitPrice, placeLimitSellOrder["PlaceOrderTime"], placeLimitSellOrder["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, sellTab, sellOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER9); Dictionary <string, string> placeLimitBuyOrder = orderEntryPage.PlaceLimitBuyOrder(instrument, buyTab, buyOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, buyTab, Double.Parse(buyOrderSize), buyOrderFeeValue, placeLimitBuyOrder["PlaceOrderTime"], placeLimitBuyOrder["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, buyTab, buyOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER8); orderEntryPage.NavigateToHomePage(instrument); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, sellTab, Double.Parse(sellOrderSize), sellOrderFeeValue, placeLimitSellOrder["PlaceOrderTime"], placeLimitSellOrder["PlaceOrderTimePlusOneMin"])); // Scenario 2: Buy order B1 with same price is available and B1 quantity is > S1. userFunctions.LogIn(TestProgressLogger, Const.USER8); Dictionary <string, string> placeLimitSellOrderS2 = orderEntryPage.PlaceLimitSellOrder(instrument, sellTab, sellOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyOpenOrdersTab(instrument, sellTab, type, Double.Parse(sellOrderSize), limitPrice, placeLimitSellOrderS2["PlaceOrderTime"], placeLimitSellOrderS2["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, sellTab, sellOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER9); Dictionary <string, string> placeLimitBuyOrderS2 = orderEntryPage.PlaceLimitBuyOrder(instrument, buyTab, incBuyOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, buyTab, Double.Parse(sellOrderSize), buyOrderFeeValue, placeLimitSellOrderS2["PlaceOrderTime"], placeLimitSellOrderS2["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, buyTab, incBuyOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER8); orderEntryPage.NavigateToHomePage(instrument); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, sellTab, Double.Parse(sellOrderSize), sellOrderFeeValue, placeLimitSellOrderS2["PlaceOrderTime"], placeLimitSellOrderS2["PlaceOrderTimePlusOneMin"])); // Scenario 3: Buy order B1 with same price is available and B1 quantity is < S1. UserCommonFunctions.LoginAndCancelAllOrders(TestProgressLogger, driver, instrument, Const.USER9); userFunctions.LogIn(TestProgressLogger, Const.USER8); Dictionary <string, string> placeLimitSellOrderS3 = orderEntryPage.PlaceLimitSellOrder(instrument, sellTab, sellOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyOpenOrdersTab(instrument, sellTab, type, Double.Parse(sellOrderSize), limitPrice, placeLimitSellOrderS3["PlaceOrderTime"], placeLimitSellOrderS3["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, sellTab, sellOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER9); buyOrderFeeValue = GenericUtils.FeeAmount(decBuyOrderSize, feeComponent); Dictionary <string, string> placeLimitBuyOrderS3 = orderEntryPage.PlaceLimitBuyOrder(instrument, buyTab, decBuyOrderSize, limitPrice, timeInForce); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, buyTab, Double.Parse(decBuyOrderSize), buyOrderFeeValue, placeLimitSellOrderS3["PlaceOrderTime"], placeLimitSellOrderS3["PlaceOrderTimePlusOneMin"])); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.LimitOrderSuccessMsg, buyTab, decBuyOrderSize, limitPrice)); userFunctions.LogIn(TestProgressLogger, Const.USER8); orderEntryPage.NavigateToHomePage(instrument); sellOrderFeeValue = GenericUtils.SellFeeAmount(decBuyOrderSize, limitPrice, feeComponent); string orderSizeDifference = GenericUtils.GetDifferenceFromStringAfterSubstraction(sellOrderSize, decBuyOrderSize); Assert.True(objVerifyOrdersTab.VerifyOpenOrdersTab(instrument, sellTab, type, Double.Parse(orderSizeDifference), limitPrice, placeLimitSellOrderS3["PlaceOrderTime"], placeLimitSellOrderS3["PlaceOrderTimePlusOneMin"])); Assert.True(objVerifyOrdersTab.VerifyFilledOrdersTab(instrument, sellTab, Double.Parse(decBuyOrderSize), sellOrderFeeValue, placeLimitSellOrderS3["PlaceOrderTime"], placeLimitSellOrderS3["PlaceOrderTimePlusOneMin"])); // This step cancels the remaining order and verifies the same in Open orders tab UserCommonFunctions.CancelOrderBookSellOrder(driver); Assert.False(objVerifyOrdersTab.VerifyOpenOrdersTab(instrument, sellTab, type, Double.Parse(orderSizeDifference), limitPrice, placeLimitSellOrderS3["PlaceOrderTime"], placeLimitSellOrderS3["PlaceOrderTimePlusOneMin"])); } catch (NoSuchElementException ex) { TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.MarketOrderTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
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; } }
public void TC40_WalletsWithdrawFiatcurrency() { try { string emailAddress; string gmailPassword; string amounttowithdraw; string currentUSDBalance; string fee; string remainingBalance; string amountToWithdrawAndFees; string expectedRemainingBalance; string holdBalance; string totalBalance; string availableBalance; string withdrawSuccessMsg; string holdBalanceAfterDeposit; string availableBalanceAfterDeposit; string expectedAvailableBalanceAfterDeposit; string expectedHoldBalanceAfterDeposit; string statusID; string linkUrl; string ticketStatus; string withdrawSuccess; string mailSubject; string totalBalanceAfterDeposit; string expectedTotalBalanceAfterDeposit; currencyName = TestData.GetData("USDCurrency"); comment = TestData.GetData("TC40_Comment"); amountOfUSDToWithdraw = 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"); emailAddress = TestData.GetData("User_14EmailAddress"); gmailPassword = TestData.GetData("GmailUser_Test1Password"); mailSubject = TestData.GetData("GmailMailSubject_ConfirmYourWithdraw"); ticketStatus = TestData.GetData("FullyProcessedTicketStatus"); 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(); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); holdBalance = walletpage.HoldBalanceDetailsPage; availableBalance = walletpage.AvailableBalanceDetailsPage; walletpage.ClickWithdrawButtonOnDetails(driver); walletpage.WithdrawUSD(driver, amountOfUSDToWithdraw, fullName, language, comment, bankAddress, bankAccountNumber, bankName, swiftCode); amounttowithdraw = walletpage.GetAmountToWithdraw(driver); currentUSDBalance = walletpage.GetCurrentUSDBalance(driver); fee = walletpage.GetFee(driver); remainingBalance = walletpage.GetRemainingBalance(driver); amountToWithdrawAndFees = GenericUtils.GetSumFromStringAfterAddition(amounttowithdraw, fee); expectedRemainingBalance = GenericUtils.GetDifferenceFromStringAfterSubstraction(currentUSDBalance, amountToWithdrawAndFees); Assert.Equal(expectedRemainingBalance, GenericUtils.RemoveCommaFromString(remainingBalance)); TestProgressLogger.LogCheckPoint(LogMessage.RemainingBalanceVerifiedOnBalanceSection); walletpage.ClickOnWithdrawUSDButton(driver); walletpage.VerifyWithdrawUSDOnConfirmationModal(driver, amountOfUSDToWithdraw, fullName, language, comment, bankAddress, bankAccountNumber, bankName, swiftCode, fee); walletpage.ClickOnConfirmUSDModalButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.ConfirmationModalVerified); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(LogMessage.USDWithdrawSuccessMsg, withdrawSuccessMsg); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); holdBalanceAfterDeposit = walletpage.HoldBalanceDetailsPage; availableBalanceAfterDeposit = walletpage.AvailableBalanceDetailsPage; totalBalanceAfterDeposit = walletpage.TotalBalanceDetailsPage; expectedAvailableBalanceAfterDeposit = GenericUtils.GetDifferenceFromStringAfterSubstraction(availableBalance, amountToWithdrawAndFees); Assert.Equal(expectedAvailableBalanceAfterDeposit, GenericUtils.RemoveCommaFromString(availableBalanceAfterDeposit)); TestProgressLogger.LogCheckPoint(LogMessage.RemainingBalanceVerified); expectedHoldBalanceAfterDeposit = GenericUtils.GetSumFromStringAfterAddition(holdBalance, amountToWithdrawAndFees); Assert.Equal(expectedHoldBalanceAfterDeposit, holdBalanceAfterDeposit); TestProgressLogger.LogCheckPoint(LogMessage.HoldBalanceVerified); statusID = walletpage.GetStatusID(driver); 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.VerifyStatus(driver, statusID, withdrawStatus); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.CreatedTicketStatusVerified, statusID)); admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminUserLogoutSuccessfully, Const.ADMIN1)); GmailCommonFunctions gmailobj = new GmailCommonFunctions(); linkUrl = gmailobj.Gmail(driver, emailAddress, gmailPassword, mailSubject); driver.Navigate().GoToUrl(linkUrl); withdrawSuccess = walletpage.GetWithdrawConfirmedMsg(driver); Assert.Equal(LogMessage.WithdrawSuccessfullyConfirmMsg, withdrawSuccess); walletpage.ClickOnGoToExchange(driver); TestProgressLogger.LogCheckPoint(LogMessage.WithdrawConfirmedMassage); adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); admincommonfunctions.SelectTicketsMenu(); admincommonfunctions.VerifyStatus(driver, statusID, ticketStatus); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTicketStatus); 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); holdBalance = walletpage.HoldBalanceDetailsPage; totalBalance = walletpage.TotalBalanceDetailsPage; expectedTotalBalanceAfterDeposit = GenericUtils.GetDifferenceFromStringAfterSubstraction(totalBalanceAfterDeposit, amountToWithdrawAndFees); Assert.Equal(expectedTotalBalanceAfterDeposit, GenericUtils.RemoveCommaFromString(totalBalance)); TestProgressLogger.LogCheckPoint(LogMessage.TotalBalanceVerified); expectedHoldBalanceAfterDeposit = GenericUtils.GetDifferenceFromStringAfterSubstraction(holdBalanceAfterDeposit, amountToWithdrawAndFees); Assert.Equal(expectedHoldBalanceAfterDeposit, holdBalance); TestProgressLogger.LogCheckPoint(LogMessage.HoldBalanceVerified); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER15)); TestProgressLogger.EndTest(); TestProgressLogger.LogCheckPoint(LogMessage.WalletsWithdrawFiatcurrencyTestPassed); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.WalletsWithdrawFiatcurrencyTestFailed, e); throw e; } }
public void TC36_SendExternalWallets() { try { string emailAddress; string gmailPassword; string successMsg; string currentBalanceOfUser3; string holdBalance; string availableBalance; string btcAmount; string minerFees; string btcTotalaAmount; string withdrawSuccessMsg; string increasedHoldAmount; string incresedHoldBalance; string TotalBalance; string reducedAvailableBalance; string hold; string expectedReducedAvailableBalance; string statusID; string mailSubject; string withdrawSuccess; string acceptedticketStatus; string totalBalance; string expectedReducedHoldBalance; string expectedReducedTotalBalance; string linkUrl; string ticketStatusNew; instrument = TestData.GetData("Instrument"); currencyName = TestData.GetData("CurrencyName"); comment = TestData.GetData("Comment"); amountOfBtcToSend = TestData.GetData("AmountOfBtcToSend"); withdrawStatus = TestData.GetData("WithdrawStatus"); emailAddress = TestData.GetData("User_14EmailAddress"); gmailPassword = TestData.GetData("GmailUser_Test1Password"); mailSubject = TestData.GetData("GmailMailSubject_ConfirmYourWithdraw"); acceptedticketStatus = TestData.GetData("AcceptedTicketStatus"); ticketStatusNew = TestData.GetData("TicketStatus"); TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); userFunctions.LogIn(TestProgressLogger, Const.USER12); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER12)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); WalletPage walletpage = new WalletPage(); walletpage.ClickOnInstrumentReceiveButton(driver, currencyName); walletpage.CopyAddressToReceiveBTC(driver); successMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(Const.CopyAddressSuccessMsg, successMsg); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.RecievedAddressCopied, Const.USER12)); walletpage.CloseSendOrReciveSection(driver); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER12)); userFunctions.LogIn(TestProgressLogger, Const.USER14); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER14)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); currentBalanceOfUser3 = walletpage.GetInstrumentCurrentBalance(driver, currencyName); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); holdBalance = walletpage.HoldBalanceDetailsPage; availableBalance = walletpage.AvailableBalanceDetailsPage; walletpage.ClickSendButtonOnDetailsPage(driver); walletpage.SendBitCoinExternalWallet(driver, comment, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.SendBitCoinSuccessfully, amountOfBtcToSend)); btcAmount = walletpage.GetBtcAmountOnConfirmation(driver); minerFees = walletpage.GetMinerFeesOnConfirmation(driver); btcTotalaAmount = GenericUtils.GetSumFromStringAfterAddition(btcAmount, minerFees); walletpage.ClickConfirmButton(driver); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(Const.WithdrawSuccessMsg, withdrawSuccessMsg); increasedHoldAmount = GenericUtils.GetSumFromStringAfterAddition(holdBalance, btcTotalaAmount); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); incresedHoldBalance = walletpage.HoldBalanceDetailsPage; TotalBalance = walletpage.TotalBalanceDetailsPage; reducedAvailableBalance = walletpage.AvailableBalanceDetailsPage; hold = GenericUtils.ConvertToDoubleFormat(GenericUtils.ConvertStringToDouble(increasedHoldAmount)); Assert.Equal(hold, incresedHoldBalance); TestProgressLogger.LogCheckPoint(LogMessage.HoldAmountIncreasedSuccessfully); expectedReducedAvailableBalance = GenericUtils.GetDifferenceFromStringAfterSubstraction(availableBalance, btcTotalaAmount); Assert.Equal(expectedReducedAvailableBalance, GenericUtils.RemoveCommaFromString(reducedAvailableBalance)); TestProgressLogger.LogCheckPoint(LogMessage.AvailableAmountReducedSuccessfully); statusID = walletpage.GetStatusID(driver); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER14)); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); admincommonfunctions.SelectTicketsMenu(); admincommonfunctions.VerifyStatus(driver, statusID, withdrawStatus); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.CreatedTicketStatusVerified, statusID)); admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminUserLogoutSuccessfully, Const.ADMIN1)); GmailCommonFunctions gmailobj = new GmailCommonFunctions(); linkUrl = gmailobj.Gmail(driver, emailAddress, gmailPassword, mailSubject); driver.Navigate().GoToUrl(linkUrl); withdrawSuccess = walletpage.GetWithdrawConfirmedMsg(driver); Assert.Equal(LogMessage.WithdrawSuccessfullyConfirmMsg, withdrawSuccess); walletpage.ClickOnGoToExchange(driver); TestProgressLogger.LogCheckPoint(LogMessage.WithdrawConfirmedMassage); adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); admincommonfunctions.SelectTicketsMenu(); admincommonfunctions.VerifyStatus(driver, statusID, ticketStatusNew); admincommonfunctions.DoubleClickOnCreatedDepositTicket(driver, statusID); admincommonfunctions.ClickOnAcceptButtonFromDepositsTicketModal(); admincommonfunctions.VerifyStatus(driver, statusID, acceptedticketStatus); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTicketStatus); admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminUserLogoutSuccessfully, Const.ADMIN1)); userFunctions.LogIn(TestProgressLogger, Const.USER14); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER14)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); currentBalanceOfUser3 = walletpage.GetInstrumentCurrentBalance(driver, currencyName); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); holdBalance = walletpage.HoldBalanceDetailsPage; totalBalance = walletpage.TotalBalanceDetailsPage; expectedReducedHoldBalance = GenericUtils.GetDifferenceFromStringAfterSubstraction(incresedHoldBalance, btcTotalaAmount); Assert.Equal(expectedReducedHoldBalance, GenericUtils.RemoveCommaFromString(holdBalance)); TestProgressLogger.LogCheckPoint(LogMessage.HoldBalanceVerified); expectedReducedTotalBalance = GenericUtils.GetDifferenceFromStringAfterSubstraction(TotalBalance, btcTotalaAmount); Assert.Equal(expectedReducedTotalBalance, GenericUtils.RemoveCommaFromString(totalBalance)); TestProgressLogger.LogCheckPoint(LogMessage.TotalBalanceVerified); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER14)); TestProgressLogger.EndTest(); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.SendExternalWalletsTestFailed, e); throw e; } }
public void TC39_WalletsReceiveRequestbyEmail() { try { string username; string currentBalanceOfUser7; string currentBalanceOfUser8; string availablebalance; string totalbalance; string withdrawSuccessMsg; string updatedCurrentBalance; string expectedupdateBalance; string currentBalance; string expupdateBalance; string availablebalanceAfterApprove; instrument = TestData.GetData("Instrument"); currencyName = TestData.GetData("CurrencyName"); comment = TestData.GetData("Comment"); amountOfBtcToSend = TestData.GetData("AmountOfBtcToSend"); withdrawStatus = TestData.GetData("WithdrawStatus"); user12_EmailAddress = TestData.GetData("User_12EmailAddress"); user13_EmailAddress = TestData.GetData("User_13EmailAddress"); TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); username = userFunctions.LogIn(TestProgressLogger, Const.USER12); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER12)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); WalletPage walletpage = new WalletPage(); currentBalanceOfUser7 = walletpage.GetInstrumentCurrentBalance(driver, currencyName); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.StoreCurrentBalance, Const.USER12)); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER12)); userFunctions.LogIn(TestProgressLogger, Const.USER13); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER13)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); currentBalanceOfUser8 = walletpage.GetInstrumentCurrentBalance(driver, currencyName); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.StoreCurrentBalance, Const.USER13)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); availablebalance = walletpage.AvailableBalanceDetailsPage; totalbalance = walletpage.AvailableBalanceDetailsPage; walletpage.ClickReceiveButtonOnDetailsPage(driver); walletpage.ClickOnReceiveRequestByEmail(driver); walletpage.SendBitCoinRequestByEmail(driver, comment, user12_EmailAddress, amountOfBtcToSend); walletpage.ClickOnSendBitCoin(driver); walletpage.VerifyConfirmationModal(driver, user12_EmailAddress, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedDetailsOnConfirmModal); walletpage.ClickConfirmButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.ConfirmationModalVerified); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(Const.RequestTransferSuccessMsg, withdrawSuccessMsg); walletpage.CloseSendOrReciveSection(driver); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); Assert.Equal(availablebalance, walletpage.AvailableBalanceDetailsPage); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedAvailableBalance); Assert.Equal(totalbalance, walletpage.AvailableBalanceDetailsPage); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTotalBalance); walletpage.ClickRefreshTransfers(driver); walletpage.SelectSentRequests(driver); walletpage.VerifyAmountInTransferSentRequestsSection(driver, username, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedRequestUnderSentRequest); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER13)); userFunctions.LogIn(TestProgressLogger, Const.USER12); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER12)); walletpage.ClickApproveButton(driver); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(LogMessage.TransferApproved, withdrawSuccessMsg); Assert.False(walletpage.VerifyApproveButton(driver)); Assert.False(walletpage.VerifyRejectButton(driver)); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedApproveAndRejectButton); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); updatedCurrentBalance = walletpage.GetInstrumentCurrentBalance(driver, currencyName); expectedupdateBalance = GenericUtils.GetDifferenceFromStringAfterSubstraction(currentBalanceOfUser7, amountOfBtcToSend); Assert.Equal(expectedupdateBalance, GenericUtils.RemoveCommaFromString(updatedCurrentBalance)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BalanceReducedSuccessfully, Const.USER12)); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER12)); userFunctions.LogIn(TestProgressLogger, Const.USER13); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER13)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); currentBalance = walletpage.GetInstrumentCurrentBalance(driver, currencyName); expupdateBalance = GenericUtils.GetSumFromStringAfterAddition(currentBalanceOfUser8, amountOfBtcToSend); Assert.Equal(expupdateBalance, GenericUtils.RemoveCommaFromString(currentBalance)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BalanceIncreasedSuccessfully, Const.USER13)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); availablebalanceAfterApprove = walletpage.AvailableBalanceDetailsPage; expupdateBalance = GenericUtils.GetSumFromStringAfterAddition(availablebalance, amountOfBtcToSend); Assert.Equal(expupdateBalance, GenericUtils.RemoveCommaFromString(availablebalanceAfterApprove)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AvailableBalanceIncresedAfterApporve, Const.USER13)); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER13)); TestProgressLogger.EndTest(); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.WalletsReceiveRequestByEmailTestFailed, e); throw e; } }
public void TC37_WalletsSendToEmailAddress() { try { string username; string secondUsername; string currentBalance; string withdrawSuccessMsg; string updatedCurrentBalance; string expectedupdateBalance; string availableBalance; string totalBalance; string expectedTotalBalanceAfterSent; string totalBalanceAfterSent; string availableBalanceAfterSent; string expectedAvailableBalanceAfterSent; string availableBalanceOfFirstUser; string totalBalanceOfFirstUser; currencyName = TestData.GetData("CurrencyName"); comment = TestData.GetData("Comment"); amountOfBtcToSend = TestData.GetData("AmountOfBtcToSend"); withdrawStatus = TestData.GetData("WithdrawStatus"); user12_EmailAddress = TestData.GetData("User_12EmailAddress"); user13_EmailAddress = TestData.GetData("User_13EmailAddress"); TestProgressLogger.StartTest(); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); username = userFunctions.LogIn(TestProgressLogger, Const.USER12); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER12)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); WalletPage walletpage = new WalletPage(); currentBalance = walletpage.GetInstrumentCurrentBalance(driver, currencyName); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); availableBalanceOfFirstUser = walletpage.AvailableBalanceDetailsPage; totalBalanceOfFirstUser = walletpage.TotalBalanceDetailsPage; TestProgressLogger.LogCheckPoint(String.Format(LogMessage.StoreCurrentBalance, Const.USER12)); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER12)); secondUsername = userFunctions.LogIn(TestProgressLogger, Const.USER13); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER13)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); availableBalance = walletpage.AvailableBalanceDetailsPage; totalBalance = walletpage.TotalBalanceDetailsPage; walletpage.ClickSendButtonOnDetailsPage(driver); walletpage.ClickOnEmailAddressTab(driver); walletpage.SendBitCoinToEmailAddress(driver, comment, user12_EmailAddress, amountOfBtcToSend); walletpage.VerifySendDetailsBalances(driver); TestProgressLogger.LogCheckPoint(LogMessage.RemainingBalanceVerified); walletpage.ClickOnSendBitCoin(driver); walletpage.VerifyConfirmationModal(driver, user12_EmailAddress, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedDetailsOnConfirmModal); walletpage.ClickConfirmButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.ConfirmationModalVerified); withdrawSuccessMsg = UserCommonFunctions.GetTextOfMessage(driver, TestProgressLogger); Assert.Equal(Const.TransferSuccessMsg, withdrawSuccessMsg); walletpage.CloseSendOrReciveSection(driver); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); totalBalanceAfterSent = walletpage.TotalBalanceDetailsPage; expectedTotalBalanceAfterSent = GenericUtils.GetDifferenceFromStringAfterSubstraction(totalBalance, amountOfBtcToSend); Assert.Equal(expectedTotalBalanceAfterSent, GenericUtils.RemoveCommaFromString(totalBalanceAfterSent)); TestProgressLogger.LogCheckPoint(LogMessage.TotalBalanceVerified); availableBalanceAfterSent = walletpage.AvailableBalanceDetailsPage; expectedAvailableBalanceAfterSent = GenericUtils.GetDifferenceFromStringAfterSubstraction(totalBalance, amountOfBtcToSend); Assert.Equal(expectedAvailableBalanceAfterSent, GenericUtils.RemoveCommaFromString(availableBalanceAfterSent)); TestProgressLogger.LogCheckPoint(LogMessage.RemainingBalanceVerified); walletpage.ClickRefreshTransfers(driver); walletpage.VerifyAmountInTransferSection(driver, username, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedRequestUnderSentRequest); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER13)); userFunctions.LogIn(TestProgressLogger, Const.USER12); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedInSuccessfully, Const.USER12)); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToWallets(driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NavigateWalletsPage)); updatedCurrentBalance = walletpage.GetInstrumentCurrentBalance(driver, currencyName); expectedupdateBalance = GenericUtils.GetSumFromStringAfterAddition(currentBalance, amountOfBtcToSend); Assert.Equal(expectedupdateBalance, GenericUtils.RemoveCommaFromString(updatedCurrentBalance)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BalanceUpdatedSuccessfully, Const.USER12)); walletpage.ClickInstrumentDetails(driver, currencyName); walletpage.GetHoldAvailablePendingDepositTotalBalanceOnDetailsPage(driver); totalBalanceAfterSent = walletpage.TotalBalanceDetailsPage; expectedTotalBalanceAfterSent = GenericUtils.GetSumFromStringAfterAddition(availableBalanceOfFirstUser, amountOfBtcToSend); Assert.Equal(expectedTotalBalanceAfterSent, GenericUtils.RemoveCommaFromString(totalBalanceAfterSent)); TestProgressLogger.LogCheckPoint(LogMessage.TotalBalanceVerified); availableBalanceAfterSent = walletpage.AvailableBalanceDetailsPage; expectedAvailableBalanceAfterSent = GenericUtils.GetSumFromStringAfterAddition(totalBalanceOfFirstUser, amountOfBtcToSend); Assert.Equal(expectedAvailableBalanceAfterSent, GenericUtils.RemoveCommaFromString(availableBalanceAfterSent)); TestProgressLogger.LogCheckPoint(LogMessage.RemainingBalanceVerified); walletpage.ClickReceivedTransferOnDetailsPage(driver); walletpage.ClickRefreshTransfers(driver); walletpage.VerifyAmountInTransferSection(driver, secondUsername, amountOfBtcToSend); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedTransactionUnderReceivedTransfer); userFunctions.LogOut(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.UserLoggedOutSuccessfully, Const.USER12)); TestProgressLogger.EndTest(); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(LogMessage.WalletsSendToEmailAddressTestFailed, e); throw e; } }
public void TC33_VerifyBuyBlockTradeWithLockedInTest() { instrument = TestData.GetData("Instrument"); orderType = TestData.GetData("OrderType"); menuTab = TestData.GetData("MenuTab"); buyTab = TestData.GetData("BuyTab"); sellTab = TestData.GetData("SellTab"); orderSize = TestData.GetData("OrderSize"); limitPrice = TestData.GetData("LimitPrice"); timeInForce = TestData.GetData("TimeInForce"); counterParty = TestData.GetData("TC33_CounterPartyPrice"); counterPartyPrice = TestData.GetData("TC33_CounterPartyPrice"); productBoughtPrice = TestData.GetData("TC33_ProductBoughtPrice"); productSoldPrice = TestData.GetData("TC33_ProductSoldPrice"); wrongCounterParty = TestData.GetData("TC33_IncorrectCounterParty"); blocktradeReportStatus = TestData.GetData("TC33_TradeReportStatus"); userWithBadge = TestData.GetData("TC33_UserWithBadge"); userWithPermissions = TestData.GetData("TC33_UserWithPermissions"); submitBlockTradePermission = TestData.GetData("TC33_SubmitBlockTradePermission"); getOpenTradeReportsPermission = TestData.GetData("TC33_GetOpenTradeReportsPermission"); userByID = TestData.GetData("TC33_UserByID"); counterPartyAccountID = TestData.GetData("TC33_CounterPartyAccountID"); buyerAccountID = TestData.GetData("TC33_BuyerAccountID"); badgeIdNumber = TestData.GetData("TC33_BadgeNumber"); state = TestData.GetData("TC33_State"); firstPermission = TestData.GetData("TC33_GetOpenTradeReports"); SecondPermission = TestData.GetData("TC33_SubmitBlockTrade"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserFunctions userfuntionality = new UserFunctions(TestProgressLogger); ReportBlockTradePage objReportBlockTradePage = new ReportBlockTradePage(TestProgressLogger); UserFunctions objUserFunctions = new UserFunctions(TestProgressLogger); try { TestProgressLogger.StartTest(); objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.UserByIDText(userByID); objAdminCommonFunctions.OpenUserButton(); objAdminCommonFunctions.UserPermissionButton(); objAdminCommonFunctions.AddSubmitBlockTradePermissions(submitBlockTradePermission); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.FirstPermissionGivenPassed, firstPermission)); objAdminCommonFunctions.ClearTextBox(); objAdminCommonFunctions.AddGetOpenTradeReportsPermissions(getOpenTradeReportsPermission); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.SecondPermissionGivenPassed, SecondPermission)); objAdminCommonFunctions.ClosePermissionWindow(); Thread.Sleep(2000); objAdminCommonFunctions.SelectAccountsMenu(); objAdminCommonFunctions.OpenAccountByIDText(counterPartyAccountID); objAdminCommonFunctions.OpenAccountBtn(); objAdminCommonFunctions.OpenAddNewBadgeButtonForUser(); objAdminCommonFunctions.SubmitCreateAccountBadgeButton(); Thread.Sleep(2000); objAdminCommonFunctions.UserBadgeIDValue(badgeIdNumber); objAdminCommonFunctions.CreateBadgeAccount(); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); userfuntionality.LogIn(TestProgressLogger, Const.USER6); Thread.Sleep(2000); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); Thread.Sleep(3000); UserCommonFunctions.ScrollingDownVertical(driver); objReportBlockTradePage.ReportBlockTradeButton(); objReportBlockTradePage.VerifyReportBlockTradeWindow(); objReportBlockTradePage.VerifyDropdownInstrument(); objReportBlockTradePage.VerifyCounterParty(); objReportBlockTradePage.VerifyLockedInCheckbox(); objReportBlockTradePage.VerifyProductBought(); objReportBlockTradePage.VerifyProductSold(); objReportBlockTradePage.VerifyFees(); objReportBlockTradePage.VerifyBalances(); objReportBlockTradePage.VerifyElementsAndSubmitBlockTradeReport(counterPartyPrice, wrongCounterParty, productBoughtPrice, productSoldPrice); var otherPartyBlockTradeData = objReportBlockTradePage.SubmitBuyTradeReport(instrument, buyTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus); objUserFunctions.LogOut(); userfuntionality.LogIn(TestProgressLogger, Const.USER5); Thread.Sleep(2000); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); Thread.Sleep(3000); UserCommonFunctions.ScrollingDownVertical(driver); objReportBlockTradePage.VerifyOtherPartyBlockTradeReportTab(instrument, sellTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus, otherPartyBlockTradeData); objUserFunctions.LogOut(); objAdminFunctions.AdminLogIn(TestProgressLogger); objReportBlockTradePage.VerifyBlockTradeInAdmin(buyerAccountID, counterPartyAccountID, instrument, productBoughtPrice, productBoughtPrice); TestProgressLogger.EndTest(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } catch (Exception ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.Error(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), ex); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); } }