[Fact] //Admin_4 public void ManualWithdraw() { try { string accountId; string USDCurrency; string holdAmountField; string pendingWithdrawsField; string holdAmountBeforeWithdraw; string pendingWithdrawsAmtBeforeWithdraw; string expectedIncreasedPendingAmount; string pendingWithdrawsAmtAfterWithdraw; string amount; string fullName; string language; string comment; string bankAddress; string bankAccountNumber; string bankAccountName; string swiftCode; string toastMessage; string recentTicketID; string ticketIDValue; string dailyWithdrawAmountBeforeAccept; string dailyWithdrawAmountAfterAccept; string monthlyWithdrawAmountBeforeAccept; string monthlyWithdrawAmountAfterAccept; string dailyWithdrawsField; string monthlyWithdrawsField; string pendingWithdrawsAmtAfterAccept; accountId = TestData.GetData("TCAdmin4_UserAccountID"); USDCurrency = TestData.GetData("USDCurrency"); holdAmountField = TestData.GetData("TCAdmin4_HoldAmountField"); pendingWithdrawsField = TestData.GetData("TCAdmin4_PendingWithdrawsField"); dailyWithdrawsField = TestData.GetData("TCAdmin4_DailyWithdrawsField"); monthlyWithdrawsField = TestData.GetData("TCAdmin4_MonthlyWithdrawsField"); amount = TestData.GetData("TCAdmin4_Amount"); fullName = TestData.GetData("TCAdmin4_FullName"); language = TestData.GetData("TCAdmin4_Language"); comment = TestData.GetData("TCAdmin4_Comment"); bankAddress = TestData.GetData("TCAdmin4_BankAddress"); bankAccountNumber = TestData.GetData("TCAdmin4_BankAccountNumber"); bankAccountName = TestData.GetData("TCAdmin4_BankAccountName"); swiftCode = TestData.GetData("TCAdmin4_SwiftCode"); ticketIDValue = TestData.GetData("TCAdmin4_TicketIDValue"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); AdminTicketsPage admintickets = new AdminTicketsPage(); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Get balances before manual withdraw. Dictionary <string, string> balancesData = adminAccountPage.GetBalances(driver, USDCurrency); holdAmountBeforeWithdraw = balancesData.GetValueOrDefault(holdAmountField); pendingWithdrawsAmtBeforeWithdraw = balancesData.GetValueOrDefault(pendingWithdrawsField); // Click on manual Withdraw button and enter details in modal. adminAccountPage.ClickOnManualWithdrawButton(driver); adminAccountPage.ManualWithdrawUSD(driver, USDCurrency, amount, fullName, language, comment, bankAddress, bankAccountNumber, bankAccountName, swiftCode); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.ManualWithdrawUSD, amount)); expectedIncreasedPendingAmount = GenericUtils.AddTwoValue(pendingWithdrawsAmtBeforeWithdraw, amount); // Verify withdraw success msg. toastMessage = UserCommonFunctions.GetTextOfToastMessageInAdmin(driver, TestProgressLogger); Assert.Equal(Const.TCA4_WithdrawTicketSuccessfullyMSG, toastMessage); TestProgressLogger.LogCheckPoint(LogMessage.VerifyToastMSG); adminAccountPage.ClickOnRefreshInUserAccountSection(driver); // Get balances after manual withdraw. Dictionary <string, string> balancesDataAfter = adminAccountPage.GetBalances(driver, USDCurrency); pendingWithdrawsAmtAfterWithdraw = balancesDataAfter.GetValueOrDefault(pendingWithdrawsField); dailyWithdrawAmountBeforeAccept = balancesDataAfter.GetValueOrDefault(dailyWithdrawsField); monthlyWithdrawAmountBeforeAccept = balancesDataAfter.GetValueOrDefault(monthlyWithdrawsField); // Verify increased pending amount after manual withdraw. Assert.Equal(expectedIncreasedPendingAmount, pendingWithdrawsAmtAfterWithdraw); TestProgressLogger.LogCheckPoint(LogMessage.VerifyIncreasedPendingWithdrawAmt); recentTicketID = adminAccountPage.GetRecentTicketID(driver, USDCurrency, amount); // Navigate on Ticket-> Withdraw page and click on refresh button. admincommonfunctions.SelectTicketsMenu(); admincommonfunctions.NavigateToWithdrawTicketsTab(); admincommonfunctions.ClickOnRefreshButtonOnTicketsPage(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateTicketsPage); //Verify created ticket in tickets-> withdraw page. Dictionary <string, string> withdrawTicketsFields = admintickets.GetWithdrawTicketsFieldsByTicketID(driver, recentTicketID); Assert.Equal(recentTicketID, withdrawTicketsFields.GetValueOrDefault(ticketIDValue)); admincommonfunctions.ClickOnTicketFromWithdrawTicketList(withdrawTicketsFields.GetValueOrDefault(ticketIDValue)); admincommonfunctions.ClickOnAcceptButtonFromDepositsTicketModal(); TestProgressLogger.LogCheckPoint(LogMessage.CreatedTicketsVerified); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); adminAccountPage.ClickOnRefreshInUserAccountSection(driver); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Get balances after accept ticket. Dictionary <string, string> balancesDataAfterAccept = adminAccountPage.GetBalances(driver, USDCurrency); pendingWithdrawsAmtAfterAccept = balancesDataAfterAccept.GetValueOrDefault(pendingWithdrawsField); dailyWithdrawAmountAfterAccept = balancesDataAfterAccept.GetValueOrDefault(dailyWithdrawsField); monthlyWithdrawAmountAfterAccept = balancesDataAfterAccept.GetValueOrDefault(monthlyWithdrawsField); // Verify pending withdraws, daily withdraw and monthly withdraw amount after accept ticket. Assert.Equal(GenericUtils.SubtractTwoValue(pendingWithdrawsAmtAfterWithdraw, amount), pendingWithdrawsAmtAfterAccept); Assert.Equal(GenericUtils.AddTwoValue(dailyWithdrawAmountBeforeAccept, amount), dailyWithdrawAmountAfterAccept); Assert.Equal(GenericUtils.AddTwoValue(monthlyWithdrawAmountBeforeAccept, amount), monthlyWithdrawAmountAfterAccept); TestProgressLogger.LogCheckPoint(LogMessage.VerifiedDailyAndMonthlyWithdraw); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.ManualWithdrawTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.ManualWithdrawTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
[Fact] //Admin_20 public void VerifyAccountDetailsTabShowAllRelevantAccountInfo() { try { string accountId; string USDCurrency; string USDAmount; string commentValue; string amountField; string expectedAmount; string actualAmount; accountId = TestData.GetData("TCAdmin4_UserAccountID"); USDCurrency = TestData.GetData("USDCurrency"); USDAmount = TestData.GetData("USDAmount"); commentValue = TestData.GetData("TC41_Comment"); amountField = TestData.GetData("TCAdmin4_AmountField"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Verify labels under account details section. adminAccountPage.VerifyLabelUnderAccountDetailsSection(); TestProgressLogger.LogCheckPoint(LogMessage.VerifyLabelsUnderAccountDetailsSection); // Verify labels under balances section. adminAccountPage.VerifyLabelsUnderBalancesSection(); TestProgressLogger.LogCheckPoint(LogMessage.VerifyLabelsUnderBalancesSection); // Get balances of usd before credit amount. Dictionary <string, string> balancesData = adminAccountPage.GetBalances(driver, USDCurrency); // Credit usd amount using submit ledger entry. adminAccountPage.ClickOnSubmitLedgerEntryButton(); adminAccountPage.CreditAmountInSubmintLedgerEntryModal(USDCurrency, USDAmount, commentValue); TestProgressLogger.LogCheckPoint(LogMessage.CreditAmountBySubmitLedgerEntry); // Get balances of usd after credit amount. adminAccountPage.ClickOnRefreshInUserAccountSection(driver); Dictionary <string, string> afterSubmitLedgerBalancesData = adminAccountPage.GetBalances(driver, USDCurrency); // Verify increased usd amount after credit by submit ledger entry. expectedAmount = GenericUtils.GetSumFromStringAfterAddition(balancesData.GetValueOrDefault(amountField), USDAmount); actualAmount = GenericUtils.ConvertStringToDecimalFormat(afterSubmitLedgerBalancesData.GetValueOrDefault(amountField)); Assert.Equal(expectedAmount, GenericUtils.RemoveCommaFromString(actualAmount)); TestProgressLogger.LogCheckPoint(LogMessage.VerifyCreditedUSDAmount); // Verify all ticket ids in Decending order. Assert.True(adminAccountPage.VerifyTicketsIdInDecendingOrder()); // Verify all ticket ids in ascending order. Assert.True(adminAccountPage.VerifyTicketsIdInAscendingOrder()); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.AccountDetailsTabShowAllRelevantAccountInfoTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.AccountDetailsTabShowAllRelevantAccountInfoTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
[Fact] //Admin_29 public void VerifyLedgerEntryCredit() { try { string accountId; string toastMessage; string product; bool creditFlag; string amount; string comment; string negativeAmount; string productBalancesBeforeUpdate; string productBalancesAfterUpdate; product = TestData.GetData("TCAdmin29_Product"); amount = TestData.GetData("TCAdmin29_Amount"); negativeAmount = TestData.GetData("TCAdmin29_NegativeAmount"); comment = TestData.GetData("TCAdmin29_Comment"); accountId = TestData.GetData("TCAdmin29_AccountID"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); GenericUtils genericUtils = new GenericUtils(TestProgressLogger); // Set creditFlag to True in case of credit amount creditFlag = true; // Login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Submit Submit Ledger Entry with negative value adminAccountPage.SubmitLedgerEntryWithNegativeValue(product, creditFlag, negativeAmount, comment); // Verify submit ledger invalid request message toastMessage = adminAccountPage.SubmitLedgerInvalidToastMessage(); Assert.Equal(Const.LedgerEntryInvalidRequestMsg, toastMessage); // Fetch the USD Account balance before update productBalancesBeforeUpdate = adminAccountPage.ProductAmountBalancesBeforeUpdate(); // Submit Submit Ledger Entry adminAccountPage.SubmitLedgerEntry(product, creditFlag, amount, comment); // Verify submit ledger success msg toastMessage = adminAccountPage.SubmitLedgerToastMessage(); Assert.Equal(Const.LedgerEntrySuccessMsg, toastMessage); TestProgressLogger.LogCheckPoint(LogMessage.VerifyToastMSG); adminAccountPage.ClickOnRefreshInUserAccountSection(driver); // Fetch the USD Account balance after update productBalancesAfterUpdate = adminAccountPage.ProductAmountBalancesAfterUpdate(); // Verify that the balances are incremented by amount value Assert.True(adminAccountPage.VerifyUpdatedCreditBalance(amount, productBalancesBeforeUpdate, productBalancesAfterUpdate)); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyLedgerEntryCreditTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyLedgerEntryCreditTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
[Fact] //Admin_8 public void VerifyOpenOrderUnderOMSOpenOrders() { try { string accountId; string instrument; string buyTab; string buyOrderSize; string limitPrice; string timeInForce; string quantity; string price; instrument = TestData.GetData("Instrument"); limitPrice = TestData.GetData("TCAdmin8_LimitPrice"); timeInForce = TestData.GetData("TimeInForce"); buyTab = TestData.GetData("BuyTab"); buyOrderSize = TestData.GetData("TCAdmin8_BuyOrderSize"); accountId = TestData.GetData("TCAdmin4_UserAccountID"); quantity = TestData.GetData("TCAdmin8_QunatityField"); price = TestData.GetData("TCAdmin8_PriceField"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); // Place sell order to set up market userFunctions.LogIn(TestProgressLogger, Const.USER17); userCommonFunction.CancelAndPlaceLimitBuyOrder(driver, instrument, buyTab, buyOrderSize, limitPrice, timeInForce); TestProgressLogger.LogCheckPoint(LogMessage.PlaceBuyOrder); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Verify price and quantity under open order section. Dictionary <string, string> orderData = adminAccountPage.GetOpenOrdersInAccountsPage(driver); Assert.Equal(GenericUtils.ConvertStringToDecimalFormat(buyOrderSize), orderData.GetValueOrDefault(quantity)); Assert.Equal(limitPrice, orderData.GetValueOrDefault(price)); TestProgressLogger.LogCheckPoint(LogMessage.VerifyPriceAndQuantityInOpenOrder); // Click on showall link under open order section. adminAccountPage.ClickShowAllUnderOpenOrderSection(driver); // Verify price and quantity in account order page. Dictionary <string, string> orderDataAccountOrder = adminAccountPage.GetPriceAndQuantityInAccountOrderPage(driver); Assert.Equal(GenericUtils.ConvertStringToDecimalFormat(buyOrderSize), orderDataAccountOrder.GetValueOrDefault(quantity)); Assert.Equal(limitPrice, orderDataAccountOrder.GetValueOrDefault(price)); TestProgressLogger.LogCheckPoint(LogMessage.VerifyPriceAndQuantityInAccountOrder); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyOpenOrderUnderOMSOpenOrdersTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyOpenOrderUnderOMSOpenOrdersTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
[Fact] //Admin_9 public void VerifyReportsDownloadedExportToCSV() { try { string accountId; string instrument; string buyTab; string buyOrderSize; string limitPrice; string timeInForce; string quantity; string price; string orderID; string openOrderFileName; string accountActivityFileName; string orderHistoryFileName; bool accountActivityVal; instrument = TestData.GetData("Instrument"); limitPrice = TestData.GetData("TCAdmin8_LimitPrice"); timeInForce = TestData.GetData("TimeInForce"); buyTab = TestData.GetData("BuyTab"); buyOrderSize = TestData.GetData("TCAdmin8_BuyOrderSize"); accountId = TestData.GetData("TCAdmin4_UserAccountID"); quantity = TestData.GetData("TCAdmin8_QunatityField"); price = TestData.GetData("TCAdmin8_PriceField"); openOrderFileName = TestData.GetData("TCAdmin9_OpenOrderFileName"); accountActivityFileName = TestData.GetData("TCAdmin9_AccountActivityFileName"); orderHistoryFileName = TestData.GetData("TCAdmin9_AccountOrderHistoryFileName"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); GenericUtils genericUtils = new GenericUtils(TestProgressLogger); // Place sell order to set up market userFunctions.LogIn(TestProgressLogger, Const.USER17); userCommonFunction.CancelAndPlaceLimitBuyOrder(driver, instrument, buyTab, buyOrderSize, limitPrice, timeInForce); TestProgressLogger.LogCheckPoint(LogMessage.PlaceBuyOrder); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Click on showall link under open order section. adminAccountPage.ClickShowAllUnderOpenOrderSection(driver); orderID = adminAccountPage.GetOrderIDInAccountOrderPage(driver); // Delete All previous file and download openorder csv file and verify data. genericUtils.DeleteAllFiles(); adminAccountPage.ClickExportToCSVOpenOrder(driver); Dictionary <string, string> openOrderData = adminAccountPage.GetOpenOrderCSVData(orderID, openOrderFileName); Assert.Equal(limitPrice, openOrderData.GetValueOrDefault(price)); Assert.Equal(buyOrderSize, openOrderData.GetValueOrDefault(quantity)); TestProgressLogger.LogCheckPoint(LogMessage.VerifyDownloadCSVFileOfOpenOrder); // Click on showall link under account activity section. adminAccountPage.SelectAccountLink(driver); adminAccountPage.ClickShowAllUnderAccountActivitySection(driver); // Delete All previous file and download transactionhistory csv file and verify data. genericUtils.DeleteAllFiles(); adminAccountPage.ClickExportToCSVAccountActivity(driver); accountActivityVal = adminAccountPage.VerifyAccountActivityCSVData(accountActivityFileName, orderID); Assert.True(accountActivityVal); TestProgressLogger.LogCheckPoint(LogMessage.VerifyDownloadCSVFileOfAccountActivity); // Click on showall link under order history section. adminAccountPage.SelectAccountLink(driver); adminAccountPage.ClickOnUserAccountTab(driver); adminAccountPage.ClickShowAllUnderOrderHistorySection(driver); // Delete All previous file and download order history csv file and verify data. genericUtils.DeleteAllFiles(); adminAccountPage.ClickExportToCSVOrderHistory(driver); accountActivityVal = adminAccountPage.VerifyAccountActivityCSVData(orderHistoryFileName, orderID); Assert.True(accountActivityVal); TestProgressLogger.LogCheckPoint(LogMessage.VerifyDownloadCSVFileOfOrderHistory); // Click on showall link under order history section. adminAccountPage.SelectAccountLink(driver); adminAccountPage.ClickOnUserAccountTab(driver); adminAccountPage.ClickShowAllUnderTradeSection(driver); // Delete All previous file and download trade csv file genericUtils.DeleteAllFiles(); adminAccountPage.ClickExportToCSVTrade(driver); TestProgressLogger.LogCheckPoint(LogMessage.VerifyDownloadCSVFileOfTrade); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyReportsDownloadedExportToCSVTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.VerifyReportsDownloadedExportToCSVTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
public void DownloadFileTest() { AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); GenericUtils genericUtils = new GenericUtils(TestProgressLogger); try { List <KeyValuePair <string, string> > superUsersData; string superUsersList = ""; string date; TestProgressLogger.StartTest(); //Login as admin -> Click on "Users" menu button genericUtils.DeleteAllFiles(); objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UsersTabBtn(); objAdminCommonFunctions.ClickOnExportButton(); Thread.Sleep(2000); objAdminCommonFunctions.ExportSuperUsers(); Thread.Sleep(3000); date = GenericUtils.GetCurrentTimeWithHyphen(); var path = Directory.GetCurrentDirectory() + "\\DataTest\\Superusers (" + date + ").csv"; superUsersData = genericUtils.ReadDataFromCSV(@path); for (int i = 0; i < superUsersData.Count; i++) { if (superUsersData[i].Key == "UserId") { if (superUsersData[i].Value == "123") { for (int j = i; j < i + 12; j++) { superUsersList = superUsersList + " || " + superUsersData[j].Key + ":" + superUsersData[j].Value; } TestProgressLogger.LogCheckPoint(superUsersList); break; } } } TestProgressLogger.LogCheckPoint("Passed"); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserPassed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e); throw e; } finally { TestProgressLogger.EndTest(); } }
[Fact] //Admin_7 public void AddBadgeToAccount() { try { string accountId; string badgeNumber; string actualBadgeNumber; accountId = TestData.GetData("TCAdmin4_UserAccountID"); badgeNumber = TestData.GetData("TCAdmin7_BadgeNumber"); AdminFunctions adminfunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions admincommonfunctions = new AdminCommonFunctions(TestProgressLogger); AdminAccountsPage adminAccountPage = new AdminAccountsPage(TestProgressLogger); // login in admin adminfunctions.AdminLogIn(TestProgressLogger, Const.ADMIN1); // Navigate on Accounts page. admincommonfunctions.SelectAccountsMenu(); admincommonfunctions.SelectAccountsTab(); TestProgressLogger.LogCheckPoint(LogMessage.NavigateAccountPage); // Click on ViewAll and search by accountid and double click. adminAccountPage.ClickOnViewAll(driver); adminAccountPage.SearchByAccountID(driver, accountId); adminAccountPage.DoubleClickOnAccountName(driver, accountId); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.NavigateAccountPage, accountId)); // Add new badge. adminAccountPage.AddNewBadge(driver, badgeNumber); actualBadgeNumber = adminAccountPage.GetTextOfAccountBadges(driver); // Verify added badge. Assert.Equal(badgeNumber, actualBadgeNumber); TestProgressLogger.LogCheckPoint(string.Format(LogMessage.VerifiedBadgeAdded, accountId)); // Delete Added badge. adminAccountPage.DeleteAccountBadge(driver); adminAccountPage.ClickOnYesButton(driver); // Logout from admin. admincommonfunctions.UserMenuBtn(); adminfunctions.AdminLogOut(); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.AddBadgeToAccountTestFailed, ex); throw; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.AddBadgeToAccountTestFailed, e); throw e; } finally { TestProgressLogger.EndTest(); } }
public void TCAdmin11_VerifyTradesUnderTradesTabTest() { instrument = TestData.GetData("Instrument"); marketOrder = TestData.GetData("MarketOrder"); menuTab = TestData.GetData("MenuTab"); sellTab = TestData.GetData("SellTab"); buyTab = TestData.GetData("BuyTab"); buyOrderSize = TestData.GetData("TC9_BuyOrderSize"); sellOrderSize = TestData.GetData("TC9_SellOrderSize"); limitPrice = TestData.GetData("TC9_LimitPrice"); timeInForce = TestData.GetData("TC9_TimeInForce"); tradeIdValueTextValue = TestData.GetData("TCAdmin11_TradeIdValueTextValue"); productPairValueTextValue = TestData.GetData("TCAdmin11_ProductPairValueTextValue"); sideValueTextValue = TestData.GetData("TCAdmin11_SideValueTextValue"); qantityValueTextValue = TestData.GetData("TCAdmin11_QantityValueTextValue"); executionIdValueTextValue = TestData.GetData("TCAdmin11_ExecutionIdValueTextValue"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); UserCommonFunctions userCommonFunction = new UserCommonFunctions(TestProgressLogger); AdminTradePage objAdminTradePage = new AdminTradePage(TestProgressLogger); try { TestProgressLogger.StartTest(); // Create Buy and Sell Order to set the last price //TestProgressLogger.LogCheckPoint(String.Format(LogMessage.PlaceOrderToSetMarketBegin, limitPrice)); //userCommonFunction.PlaceOrdersToSetLastPrice(driver, instrument, buyTab, sellTab, buyOrderSize, limitPrice, timeInForce, Const.USER10, Const.USER11); //TestProgressLogger.LogCheckPoint(String.Format(LogMessage.PlaceOrderToSetMarketEnd, limitPrice)); //Login as admin -> Click on "Trades" menu button objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.SelectTradeMenu(); //Select an instrument under trade tab Assert.True(objAdminTradePage.VerifyTradeOrderUnderTradesTab()); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); // TestProgressLogger.LogError(String.Format(LogMessage.VerifyRevokeUserPermissionFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); //TestProgressLogger.LogError(String.Format(LogMessage.VerifyRevokeUserPermissionFailed), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }
public void TC49_VerifyLoyalityFeeBuyMarketOrderTest() { instrument = TestData.GetData("Instrument"); buyTab = TestData.GetData("BuyTab"); accountID = TestData.GetData("TC49_AccountID"); buyMarketOrderAmount = TestData.GetData("TC49_BuyMarketOrderAmount"); UserFunctions userFuntions = new UserFunctions(TestProgressLogger); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserCommonFunctions userCommonFunctions = new UserCommonFunctions(TestProgressLogger); LoyaltyTokenPage loyaltyTokenPage = new LoyaltyTokenPage(TestProgressLogger); OrderEntryPage orderEnteryPage = new OrderEntryPage(driver, TestProgressLogger); try { TestProgressLogger.StartTest(); // The admin will enabled the loyalty fee(LTC) to the user // Login as admin objAdminFunctions.AdminLogIn(TestProgressLogger); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminLoyaltyFeeCheckStart, accountID)); objAdminCommonFunctions.SelectAccountsMenu(); // Enter accountID in "Open Account by ID" textbox of the user for which Loyalty Fee should be applied objAdminCommonFunctions.OpenAccountByIDText(accountID); // Click on "Open" button objAdminCommonFunctions.OpenAccountBtn(); // Click on "Edit Account Information" link objAdminCommonFunctions.EditInformationButton(); // Click on "Loyalty Fees Enabled(LTC)" checkbox button. This will enable Fees to be deducted int the form of LTC objAdminCommonFunctions.LoyaltyFeeCheckedOrUnchecked(); objAdminCommonFunctions.SaveButton(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminLoyaltyFeeCheckCompleted, accountID)); objAdminCommonFunctions.UserMenuBtn(); // Admin LogOut objAdminFunctions.AdminLogOut(); // This will verify whether the Fee applied is in the form of LTC // Login as User for which Loyalty Fees Enabled(LTC) was selected // Navigate to UserSetting -> Loyalty Token -> Select Radio Button for LTC userFuntions.LogIn(TestProgressLogger, Const.USER13); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToUserSetting(driver); loyaltyTokenPage.LoyaltyTokenButton(driver); loyaltyTokenPage.TradingFeeRadioButton(driver); loyaltyTokenPage.UserSettingMenuButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.SelectLoyaltyTokenSuccess); // Navigate to Exchange -> Order Entry -> Enter Buy Amount UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); orderEnteryPage.MarketOrderTypeBtn(); orderEnteryPage.EnterBuyAmount(buyMarketOrderAmount); // Verify Fees displayed is in the form of LTC Assert.True(loyaltyTokenPage.GetFeeText()); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyAppliedFeeIsLTC, buyTab)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.LoyaltyTokenSuccessMsg, buyTab)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.LoyaltyTokenFailureMsg, buyTab), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.LoyaltyTokenFailureMsg, buyTab), e); throw e; } finally { TestProgressLogger.EndTest(); } }
public void TCAdmin5_VerifyConfigureUserPermissionTest() { addUserPermission = TestData.GetData("TCAdmin5_AddUserPermission"); string userName; string userAccountID; AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); try { TestProgressLogger.StartTest(); //Login as admin -> Click on "Users" menu button objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UsersTabBtn(); //This will get the user name and user account ID from the user list under Users Tab userName = objAdminCommonFunctions.getUserNameFromUserList(); userAccountID = objAdminCommonFunctions.getUserAccountIDFromUserList(); objAdminCommonFunctions.SelectUserFromUserList(driver, userName); //Click on "Add Permission" button -> verify all permissions with checkbox objAdminCommonFunctions.UserPermissionButton(); try { Assert.True(objAdminCommonFunctions.VerifyUserPermissionsList()); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyUserPermissionsListPassed)); } catch (Exception) { TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyUserPermissionsListFailed)); throw; } //This will configure a permission and verify the success message objAdminCommonFunctions.AddUserPermissions(addUserPermission); //Close the permission window section objAdminCommonFunctions.ClosePermissionWindow(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyConfigureUserPermissionPassed)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyConfigureUserPermissionFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyConfigureUserPermissionFailed), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }
public void TCAdmin1_VerifyAddNewUserTest() { string userLoginName; userName = TestData.GetData("TCAdmin1_UserName"); userPassword = TestData.GetData("TCAdmin1_UserPassword"); userConfirmPassword = TestData.GetData("TCAdmin1_UserConfirmPassword"); depositPermission = TestData.GetData("TCAdmin1_DepositPermission"); tradingPermission = TestData.GetData("TCAdmin1_DepositTrading"); withdrawPermission = TestData.GetData("TCAdmin1_UserWithdraw"); verificationLevel = TestData.GetData("TCAdmin1_VerificationLevel"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); try { TestProgressLogger.StartTest(); //Login as admin -> Click on "Users" menu button objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UsersTabBtn(); //Verify whether new user created Assert.True(objAdminUsersPage.CreateNewUser(userName, userPassword, userConfirmPassword, verificationLevel)); //Verify that the new user created is having deposit, trading and withdraw permissions Assert.True(objAdminUsersPage.VerifyUserCreatedWithPermission(depositPermission, tradingPermission, withdrawPermission)); objAdminCommonFunctions.UserMenuBtn(); userLoginName = objAdminCommonFunctions.UserNameTextValue(); // Admin LogOut objAdminFunctions.AdminLogOut(); //Login using the credentials of the User created above // This will change only the server URL userFunctions.LogIn(TestProgressLogger, changeServerOnly: true); Assert.True(userFunctions.LogInUsingCredsFromUI(TestProgressLogger, userLoginName, userPassword)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAddUserFailed), e); throw e; } finally { userFunctions.LogOut(); TestProgressLogger.EndTest(); } }
public void TCAdmin2_VerifyUsersAccountAssignedOrUnassignedTest() { userPassword = TestData.GetData("TCAdmin2_UserPassword"); invalidAccountID = TestData.GetData("TCAdmin2_InvalidAccountID"); userName = TestData.GetData("TCAdmin1_UserName"); newUserPassword = TestData.GetData("TCAdmin1_UserPassword"); userConfirmPassword = TestData.GetData("TCAdmin1_UserConfirmPassword"); verificationLevel = TestData.GetData("TCAdmin1_VerificationLevel"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserFunctions userfuntionality = new UserFunctions(TestProgressLogger); AdminUsersPage objAdminUsersPage = new AdminUsersPage(TestProgressLogger); try { TestProgressLogger.StartTest(); ////Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //pre-requites of creating new user to perform assign and unassign test case TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NewUserCreationInitiated)); objAdminUsersPage.CreateNewUser(userName, newUserPassword, userConfirmPassword, verificationLevel); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.NewUserCreationCompleted, userName)); //Click on "Users" Tab button objAdminCommonFunctions.UsersTabBtn(); //Verify the login after unassign account ID to user Assert.True(objAdminUsersPage.VerifyLoginUsingUnassignedAccount(userPassword)); Thread.Sleep(2000); //Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Verify the login after assign account ID to user Assert.True(objAdminUsersPage.VerifyLoginUsingAssignedAccount(userPassword)); Thread.Sleep(2000); //Login as admin -> Click on "Users" menu button -> Users Tab objAdminUsersPage.SelectAdminUserTab(); //Verify the login after assign invalid account ID to user Assert.True(objAdminUsersPage.VerifyNonexistentAccount(invalidAccountID)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAssignedOrUnassignedAccountFailed), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.VerifyAssignedOrUnassignedAccountFailed), e); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); TestProgressLogger.EndTest(); } }
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(); // The admin will create an badge to user say XYZ and provide the submitblock, getopentradereport permission to user say ABC // Login as Admin objAdminFunctions.AdminLogIn(TestProgressLogger); // Enter "userID"(ex. 185) in the "OpenUserbyID" textfield objAdminCommonFunctions.UserByIDText(userByID); // Click on "Open" button --> click on "Add permission" button --> provide SubmitBlockTrade and GetOpenTradeReports 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); // Click on "Accounts" menu button --> Enter "accountID"(194) in the "OpenAccountbyID" textfield --> Click on "Open" button objAdminCommonFunctions.SelectAccountsMenu(); objAdminCommonFunctions.OpenAccountByIDText(counterPartyAccountID); objAdminCommonFunctions.OpenAccountBtn(); // Click on "Add New Badge" button --> provide badge number and click on create button objAdminCommonFunctions.OpenAddNewBadgeButtonForUser(); objAdminCommonFunctions.SubmitCreateAccountBadgeButton(); Thread.Sleep(2000); objAdminCommonFunctions.UserBadgeIDValue(badgeIdNumber); objAdminCommonFunctions.CreateBadgeAccount(); //Logout from Admin objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); // Below will perform a submit block trade with using lockedIn(by user ABC) and verify the various functionalities userfuntionality.LogIn(TestProgressLogger, Const.USER6); Thread.Sleep(2000); // Click on "Dashboard" menu button --> select an exchange --> select an instrument BTCUSD UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); Thread.Sleep(3000); UserCommonFunctions.ScrollingDownVertical(driver); //Click on "Report Block Trade" Button objReportBlockTradePage.ReportBlockTradeButton(); // Verify window for submitting block trade appears objReportBlockTradePage.VerifyReportBlockTradeWindow(); // Verify drop down for "Instrument" is present objReportBlockTradePage.VerifyDropdownInstrument(); // Verify "Counter Party" with locked in check box is present objReportBlockTradePage.VerifyCounterParty(); objReportBlockTradePage.VerifyLockedInCheckbox(); // Verify "Product Bought" is present objReportBlockTradePage.VerifyProductBought(); // Verify "Product Sold" is present objReportBlockTradePage.VerifyProductSold(); // Verify "Fee" is present objReportBlockTradePage.VerifyFees(); // Verify balances for both products(product bought and product sold) objReportBlockTradePage.VerifyBalances(); // Verify the details presen in Report block trade window and submit a Buy Block trade transaction objReportBlockTradePage.VerifyElementsAndSubmitBlockTradeReport(counterPartyPrice, wrongCounterParty, productBoughtPrice, productSoldPrice); //verify the details in Trade Report tab var otherPartyBlockTradeData = objReportBlockTradePage.SubmitBuyTradeReport(instrument, buyTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus); //Logout from user portal objUserFunctions.LogOut(); // Login as "ABC" i.e. other party of block trade userfuntionality.LogIn(TestProgressLogger, Const.USER5); Thread.Sleep(2000); // Click on "Dashboard" menu button --> select an exchange --> select an instrument BTCUSD UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); Thread.Sleep(3000); UserCommonFunctions.ScrollingDownVertical(driver); // Verify the Block Trade Trade Report of Other Party objReportBlockTradePage.VerifyOtherPartyBlockTradeReportTab(instrument, sellTab, counterPartyPrice, productBoughtPrice, productSoldPrice, blocktradeReportStatus, otherPartyBlockTradeData); objUserFunctions.LogOut(); // The admin will verify if submitted block trade report is present in block trade tab under trade menu section // Login as Admin -> Trades -> Block Trades --> select BTCUSD instrument objAdminFunctions.AdminLogIn(TestProgressLogger); objReportBlockTradePage.VerifyBlockTradeInAdmin(buyerAccountID, counterPartyAccountID, instrument, productBoughtPrice, productBoughtPrice); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BlockTradeWithLockedInTestPassedMsg, buyTab)); TestProgressLogger.EndTest(); } catch (NoSuchElementException e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), e); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); throw e; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.BlockTradeWithLockedInTestFailedMsg, buyTab), e); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); throw e; } finally { objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); } }
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 { // Below will perform a submit block trade, verify if order is appeared in open orders, check if cancel button is present TestProgressLogger.StartTest(); // Login in user portal userfuntionality.LogIn(TestProgressLogger, Const.USER6); Thread.Sleep(2000); // Click on "Dashboard" menu button --> select an exchange --> select an instrument BTCUSD UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.SelectAnExchange(driver); // Verify Exchange Menu Assert.True(objDetailsOnLandingPage.ExchangeLinkButton()); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); // Click on "Report block Trade" button objReportBlockTradePage.ReportBlockTradeButton(); // Verify window for submitting block trade appears objReportBlockTradePage.VerifyReportBlockTradeWindow(); // Perform a submit block trade transaction and verify the details objReportBlockTradePage.SubmitBlockTradeReportForUser(counterPartyPrice, productBoughtPrice, productSoldPrice); //verify cancel block trade order Assert.True(objVerifyOrdersTab.VerifyCancelBlockTradeOrdersInOpenOrderTab()); Thread.Sleep(3000); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifiedCancelOrderButtonPassed)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifiedBlockTradeWithoutLockedInCancelPassed)); } catch (NoSuchElementException e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.VerifiedCancelOrderButtonFailed), e); TestProgressLogger.LogError(String.Format(LogMessage.VerifiedBlockTradeWithoutLockedInCancelFailed), e); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); throw e; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.VerifiedCancelOrderButtonFailed), e); TestProgressLogger.LogError(String.Format(LogMessage.VerifiedBlockTradeWithoutLockedInCancelFailed), e); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); throw e; } finally { TestProgressLogger.EndTest(); } }
public void TC50_VerifyLoyalityFeeSellMarketOrder() { instrument = TestData.GetData("Instrument"); sellTab = TestData.GetData("SellTab"); accountID = TestData.GetData("TC50_AccountID"); sellMarketOrderAmount = TestData.GetData("TC50_SellMarketOrderAmount"); UserFunctions userFuntions = new UserFunctions(TestProgressLogger); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserCommonFunctions userCommonFunctions = new UserCommonFunctions(TestProgressLogger); LoyaltyTokenPage loyaltyTokenPage = new LoyaltyTokenPage(TestProgressLogger); OrderEntryPage orderEnteryPage = new OrderEntryPage(driver, TestProgressLogger); try { TestProgressLogger.StartTest(); objAdminFunctions.AdminLogIn(TestProgressLogger); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminLoyaltyFeeCheckStart, accountID)); objAdminCommonFunctions.SelectAccountsMenu(); objAdminCommonFunctions.OpenAccountByIDText(accountID); objAdminCommonFunctions.OpenAccountBtn(); objAdminCommonFunctions.EditInformationButton(); objAdminCommonFunctions.LoyaltyFeeCheckedOrUnchecked(); objAdminCommonFunctions.SaveButton(); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AdminLoyaltyFeeCheckCompleted, accountID)); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); userFuntions.LogIn(TestProgressLogger, Const.USER13); UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToUserSetting(driver); loyaltyTokenPage.LoyaltyTokenButton(driver); loyaltyTokenPage.TradingFeeRadioButton(driver); loyaltyTokenPage.UserSettingMenuButton(driver); TestProgressLogger.LogCheckPoint(LogMessage.SelectLoyaltyTokenSuccess); UserCommonFunctions.SelectAnExchange(driver); UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.VerifyAppliedFeeIsLTC, sellTab)); orderEnteryPage.SellOrderEntryBtn(); orderEnteryPage.MarketOrderTypeBtn(); orderEnteryPage.EnterSellAmount(sellMarketOrderAmount); Assert.True(loyaltyTokenPage.GetFeeText()); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.LoyaltyTokenSuccessMsg, sellTab)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.LoyaltyTokenFailureMsg, sellTab), ex); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(String.Format(LogMessage.LoyaltyTokenFailureMsg, sellTab), e); throw e; } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
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.USER8); // Setting up market by placing Limit buy Order askPrice = userCommonFunction.CancelAndPlaceLimitBuyOrder(driver, instrument, sellTab, sellOrderSize, limitPrice, timeInForce); // Navigate to Buy&Sell page and place a sell order userfuntionality.LogIn(TestProgressLogger, Const.USER14); // Click on -> Dashboad Menu button -> Buy&Sell button UserCommonFunctions.DashBoardMenuButton(driver); UserCommonFunctions.NavigateToBuySell(driver); // Click on "Sell" Button objBuyAndSellPage.SellBtn(); // Verify "Make a Transaction" window Assert.True(objBuyAndSellPage.VerifyMakeATransaction()); // Verify "Chart details" section Assert.True(objBuyAndSellPage.VerifyChart()); // Verify "Sell" option is selected by default Assert.True(objBuyAndSellPage.VerifySellOption()); // Verify 5th button with blank values is selected Assert.True(objBuyAndSellPage.VerifyFifthRadioButtonOption()); Assert.True(objBuyAndSellPage.VerifyFifthWithBlankValues()); // Place a sell order and verify the amount details objBuyAndSellPage.PlaceSellOrder(instrument, sellTab); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.BuyAndSell_SellTestVerificationPassed, buyTab)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.BuyAndSell_SellTestVerificationFailed, buyTab), ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(String.Format(LogMessage.BuyAndSell_SellTestVerificationFailed, buyTab), e); throw e; } finally { TestProgressLogger.EndTest(); } }