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(); } }
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 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 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(); } }