Exemplo n.º 1
0
        // This method verifies the number of orders displayed.
        public bool VerifyNumOfOrdersDisplayed(string numOfOrders, string instrument)
        {
            bool flag = false;
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                int numberOfOrders = Int32.Parse(numOfOrders);
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                Thread.Sleep(1000);
                // This select the number of orders to be displayed from the orders dropdown
                SelectOMSOrdersInstrument(numOfOrders);
                Thread.Sleep(1000);
                int countOfBuySideOrders  = driver.FindElements(buySideBookRow).Count;
                int countOfSellSideOrders = driver.FindElements(sellSideBookRow).Count;
                if ((countOfBuySideOrders <= numberOfOrders) && (countOfSellSideOrders <= numberOfOrders))
                {
                    flag = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(flag);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Methods related to OMS Oders History tab
        /// </summary>

        // This selects the instrument on the OMS Open orders page and verifies the related orders in the buy and sell side books
        public bool VerifySelectOMSOrdersHistoryInstrument(string instrument, string numberOfRecords)
        {
            bool orderFoundFlag = false;
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                objAdminCommonFunctions.ClickOnOMSOrdersMenuLink();
                ClickOMSOrdersHistoryTab();
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                Thread.Sleep(1000);
                orderFoundFlag = ScrollAndVerifyInstrument(instrument, numberOfRecords);
            }
            catch (Exception)
            {
                throw;
            }
            return(orderFoundFlag);
        }
Exemplo n.º 3
0
        // This selects the instrument on the OMS Open orders page and verifies the related orders in the buy and sell side books
        public bool VerifySelectOMSOpenOrdersInstrument(Dictionary <string, string> userDetailsDict, string instrument, string buyPrice, string sellPrice, string buyQuantity, string sellQuantity, string orderType)
        {
            bool orderFoundFlag = false;
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                objAdminCommonFunctions.ClickOnOMSOrdersMenuLink();
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                Thread.Sleep(1000);
                orderFoundFlag = VerifyOMSOrdersBuySideBook(userDetailsDict["AccountId"], userDetailsDict["UserId"], buyPrice, buyQuantity, orderType);
                orderFoundFlag = VerifyOMSOrdersSellSideBook(userDetailsDict["AccountId"], userDetailsDict["UserId"], sellPrice, sellQuantity, orderType);
            }
            catch (Exception)
            {
                throw;
            }
            return(orderFoundFlag);
        }
Exemplo n.º 4
0
        // This method navigates to OMS Orders History page and clears all filters
        public void ClearOrderHistoryFilters(string instrument, string numOfOrders)
        {
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                objAdminCommonFunctions.ClickOnOMSOrdersMenuLink();
                ClickOMSOrdersHistoryTab();
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                SelectOMSOrdersInstrument(numOfOrders);
                ClickMoreFiltersLink();
                AccountIdTextBox().Clear();
                UserIdTextBox().Clear();
                OrderIdTextBox().Clear();
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 5
0
        // This method verifies the number of orders displayed on OMS Orders History page
        public bool VerifyNumOfOrdersOnHistorypage(string numberOfRecords, string instrument)
        {
            bool flag = false;
            int  totalCount;
            int  count;
            int  totalCountOfOrders = 0;
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                int numberOfOrders = Int32.Parse(numberOfRecords);
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                Thread.Sleep(1000);
                // This select the number of orders to be displayed from the orders dropdown
                SelectOMSOrdersInstrument(numberOfRecords);
                Thread.Sleep(1000);
                Actions actions          = new Actions(driver);
                EventFiringWebDriver evw = new EventFiringWebDriver(driver);
                totalCount = Int32.Parse(numberOfRecords);
                count      = totalCount / 10;
                for (int j = 1; j <= count; j++)
                {
                    for (int i = 1; i <= 10; i++)
                    {
                        totalCountOfOrders++;
                    }
                    var queryString = "document.querySelector('div.ReactVirtualized__Grid.ReactVirtualized__Table__Grid').scrollTop=";
                    evw.ExecuteScript(queryString + (j * 440));
                    Thread.Sleep(1000);
                }
                if ((totalCountOfOrders <= numberOfOrders))
                {
                    flag = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(flag);
        }
Exemplo n.º 6
0
        // Add filter by userId and verify that only the details of the userId which was passed on filter is displayed in Buy side and Sell side order book
        public bool VerifySearchOMSOrdersByUserId(string instrument, string userId)
        {
            bool userIdFoundFlag = false;
            AdminCommonFunctions objAdminCommonFunctions = new AdminCommonFunctions(logger);

            try
            {
                objAdminCommonFunctions.ClickOnOMSOrdersMenuLink();
                objAdminCommonFunctions.SelectOMSOrdersInstrument(instrument);
                ClickMoreFiltersLink();
                AccountIdTextBox().Clear();
                UserIdTextBox().Clear();
                UserIdTextBox().SendKeys(userId);
                ClickMoreFiltersLink();
                userIdFoundFlag = VerifyUserIdInBuySideBook(userId);
                userIdFoundFlag = VerifyUserIdInSellSideBook(userId);
                return(userIdFoundFlag);
            }
            catch (Exception)
            {
                throw;
            }
        }