コード例 #1
0
        // This method will verify the order placed in Filled orders tab through Order Entry
        public bool VerifyFilledOrdersTab(string instrument, string side, double size, string fee, string placeOrderTime, string placeOrderTimePlusOneMin)
        {
            string lastPrice;
            double doubleLastPrice;
            string expectedRow_1;
            string currencyText;
            string totalAmountCalculated;
            string buyAmountValue;
            double feeValueInDouble;
            string feeValue;
            string expectedRow_2;

            try
            {
                var            flag           = false;
                OrderEntryPage orderEntryPage = new OrderEntryPage(driver, logger);
                buyAmountValue   = GenericUtils.ConvertToDoubleFormat(size);
                feeValueInDouble = Double.Parse(fee);
                feeValue         = GenericUtils.ConvertToDoubleFormat(feeValueInDouble);
                if (side.Equals(TestData.GetData("BuyTab")))
                {
                    orderEntryPage.SelectBuyLimitButton();
                    currencyText = AmountCurrencyNameText();
                }
                else
                {
                    orderEntryPage.SelectSellLimitButton();
                    currencyText = PriceCurrencyNameText();
                }

                lastPrice             = orderEntryPage.GetLastPrice();
                doubleLastPrice       = Convert.ToDouble(lastPrice);
                totalAmountCalculated = GenericUtils.FilledOrdersTotalAmount(size, doubleLastPrice);
                Thread.Sleep(2000);
                UserCommonFunctions.FilledOrderTab(driver);
                expectedRow_1 = instrument + " || " + side + " || " + buyAmountValue + " || " + lastPrice + " || " + totalAmountCalculated + " || " + feeValue + " " + currencyText;
                expectedRow_2 = instrument + " || " + side + " || " + buyAmountValue + " || " + lastPrice + " || " + totalAmountCalculated + " || " + feeValue + " " + currencyText;
                var filledOrdersList = GetListOfFilledOrders();
                if (filledOrdersList.Contains(expectedRow_1) || filledOrdersList.Contains(expectedRow_2))
                {
                    flag = true;
                }
                if (flag)
                {
                    logger.LogCheckPoint(String.Format(LogMessage.OrderVerifiedInFilledOrdersTab, side));
                }
                else
                {
                    logger.LogCheckPoint(String.Format(LogMessage.OrderNotFoundInFilledOrdersTab, side));
                }
                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
        }
コード例 #2
0
        // This method will verify the order placed in Filled orders tab through Order Entry
        public bool VerifyFilledOrdersTabForBuyAndSell(string instrument, string side, double size, string fee, string placeOrderTime, string placeOrderTimePlusOneMin)
        {
            var    flag = false;
            string currencyText;
            string buyAmountValue;
            string lastPrice;
            double doubleLastPrice;
            string totalAmountCalculated;
            string expectedRow_1;

            try
            {
                OrderEntryPage orderEntryPage = new OrderEntryPage(driver, logger);
                buyAmountValue = GenericUtils.ConvertToDoubleFormat(size);
                if (side.Equals(TestData.GetData("BuyTab")))
                {
                    orderEntryPage.SelectBuyLimitButton();
                    currencyText = AmountCurrencyNameText();
                }
                else
                {
                    orderEntryPage.SelectSellLimitButton();
                    currencyText = PriceCurrencyNameText();
                }

                lastPrice             = orderEntryPage.GetLastPrice();
                doubleLastPrice       = Convert.ToDouble(lastPrice);
                totalAmountCalculated = GenericUtils.FilledOrdersTotalAmount(size, doubleLastPrice);
                Thread.Sleep(2000);

                // Click on Filled order tab
                UserCommonFunctions.FilledOrderTab(driver);
                expectedRow_1 = instrument + " || " + side + " || " + buyAmountValue + " || " + lastPrice + " || " + totalAmountCalculated + " || " + fee + " " + currencyText;
                var filledOrdersList = GetListOfFilledOrders();
                if (filledOrdersList.Contains(expectedRow_1))
                {
                    flag = true;
                }

                // This will verify the expected details with actual in filled orders tab
                if (flag)
                {
                    logger.LogCheckPoint(String.Format(LogMessage.OrderPresentInFilledOrderTabPassed, side));
                }
                else
                {
                    logger.LogCheckPoint(String.Format(LogMessage.OrderPresentInFilledOrderTabFailed, side));
                }
                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
        }