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