public void TC45_VerifyAffiliateProgram() { string userByID = TestData.GetData("TC45_UserByID"); string affiliateTagID = TestData.GetData("TC45_AffiliateTagID"); string verificationLevel = TestData.GetData("TC45_VerificationLevel"); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); try { TestProgressLogger.StartTest(); // Login as admin objAdminFunctions.AdminLogIn(TestProgressLogger); // Select user by entering UserID objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UserByIDText(userByID); objAdminCommonFunctions.OpenUserButton(); // Create Affiliate tag for the user objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); // Login as the user mentioned above and verify Affiliate program functionality userFunctions.LogIn(TestProgressLogger, Const.USER12); Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel), LogMessage.AffiliateProgramFailureMsg); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg)); } catch (NoSuchElementException ex) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(ex.Message + ex.StackTrace); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, ex); throw ex; } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogCheckPoint(e.Message + e.StackTrace); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e); throw e; } finally { TestProgressLogger.EndTest(); } }
public void TC45_VerifyAffiliateProgram() { string userByID = TestData.GetData("TC45_UserByID"); string affiliateTagID = TestData.GetData("TC45_AffiliateTagID"); string verificationLevel = TestData.GetData("TC45_VerificationLevel"); TestProgressLogger.StartTest(); AdminFunctions objAdminFunctions = new AdminFunctions(TestProgressLogger); UserFunctions userFunctions = new UserFunctions(TestProgressLogger); AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(TestProgressLogger); UserSettingPage userSettingsPage = new UserSettingPage(driver, TestProgressLogger); try { objAdminFunctions.AdminLogIn(TestProgressLogger); objAdminCommonFunctions.ClickOnUsersMenuLink(); objAdminCommonFunctions.UserByIDText(userByID); objAdminCommonFunctions.OpenUserButton(); objAdminCommonFunctions.AffiliateTagCreation(affiliateTagID); objAdminCommonFunctions.UserMenuBtn(); objAdminFunctions.AdminLogOut(); userFunctions.LogIn(TestProgressLogger, Const.USER12); Assert.True(userSettingsPage.VerifyAffiliateProgramFunctionality(driver, verificationLevel)); TestProgressLogger.LogCheckPoint(String.Format(LogMessage.AffiliateProgramSuccessMsg)); } catch (Exception e) { TestProgressLogger.TakeScreenshot(); TestProgressLogger.LogError(LogMessage.AffiliateProgramFailureMsg, e); throw e; } finally { TestProgressLogger.EndTest(); UserFunctions userFunctionality = new UserFunctions(TestProgressLogger); userFunctionality.LogOut(); } }
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(); } }