public void PlaceBuyOrderWithReserveOrderType(string instruments, string ordertype, string ordersize, string limitprice, string displayquantity)
        {
            try
            {
                IWebElement instrumet = driver.FindElement(instrument);
                UserSetFunctions.VerifyWebElement(instrumet);
                UserSetFunctions.SelectDropdown(instrumet, instruments);

                IWebElement ordertyp = driver.FindElement(orderType);
                UserSetFunctions.VerifyWebElement(ordertyp);
                UserSetFunctions.SelectDropdown(ordertyp, ordertype);

                IWebElement ordersiz = driver.FindElement(orderSize);
                UserSetFunctions.VerifyWebElement(ordersiz);
                UserSetFunctions.EnterText(ordersiz, ordersize);

                IWebElement limitpric = driver.FindElement(limitPrice);
                UserSetFunctions.VerifyWebElement(limitpric);
                UserSetFunctions.EnterText(limitpric, limitprice);

                IWebElement displayquntity = driver.FindElement(displayQuntity);
                UserSetFunctions.VerifyWebElement(displayquntity);
                UserSetFunctions.EnterText(displayquntity, displayquantity);


                IWebElement placebuyorder = driver.FindElement(placeByOrder);
                UserSetFunctions.VerifyWebElement(placebuyorder);
                UserSetFunctions.Click(placebuyorder);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
 public void SelectTimeInForce(string timeInForce)
 {
     try
     {
         UserSetFunctions.VerifyWebElement(TimeInForce(driver));
         UserSetFunctions.SelectDropdown(TimeInForce(driver), timeInForce);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public void SelectPegPrice(string pegPriceType)
 {
     try
     {
         UserSetFunctions.VerifyWebElement(PegPriceDropDown(driver));
         UserSetFunctions.SelectDropdown(PegPriceDropDown(driver), pegPriceType);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public void Login(string userName, string password)
        {
            UserSetFunctions.SelectDropdown(driver.FindElement(selectServer), "wss://apiapexqa2.alphapoint.com/WSGateway/");
            UserSetFunctions.EnterText(driver.FindElement(loginName), userName);
            UserSetFunctions.EnterText(driver.FindElement(loginPassword), password);
            UserSetFunctions.Click(driver.FindElement(loginButton));

            output.WriteLine("Title--------------------" + driver.Title);
            Assert.Equal(driver.Title.ToLower(), "APEX Web".ToLower());

            //This returns new object of Home page such that it initializes the parameters of Home page after login
            //return new UserHomePage(driver);
        }
        public void VerifyAdvanceBuyOrder(string instrument, IWebDriver driver, string orderSize)
        {
            bool flag = false;

            Thread.Sleep(3000);
            CommonFunctionality.SelectDashBoardButton(driver);
            Thread.Sleep(2000);


            string exchangeStringValueFromSite = driver.FindElement(exchangeMenuText).Text;

            Thread.Sleep(3000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                Assert.True(true, "Verification for exchangeMenu value has been passed.");
                output.WriteLine("Verification for exchangeMenu value has been passed.");
                flag = true;
            }
            else
            {
                Assert.False(false, "Verification for exchangeMenu value has been failed.");
                output.WriteLine("Verification for exchangeMenu value has been failed.");
                flag = false;
            }

            CommonFunctionality.SelectInstrumentFromExchange(instrument, driver);
            UserSetFunctions.Click(driver.FindElement(advanceOrderButton));

            UserSetFunctions.SelectDropdown(driver.FindElement(instrumentList), instrumentValue);
            UserSetFunctions.SelectDropdown(driver.FindElement(orderTypeList), orderTypeValue);

            UserSetFunctions.EnterText(driver.FindElement(ordersizeTextField), orderSize);

            Thread.Sleep(3000);
            //Dictionary<string, string> balances = new Dictionary<string, string>();

            if (driver.FindElement(feesText).Displayed&& driver.FindElement(ordersizeTextField).Displayed)
            {
                // Storing balances in Dictionary
                //balances = CommonFunctionality.StoreMarketAmountBalances(driver);
                logger.Info("Fees and OrderTotal is displaying in the page.");
                output.WriteLine("Fees and OrderTotal is displaying in the page.");
            }
            else
            {
                logger.Error("Fees and OrderTotal is displaying in the page.");
                output.WriteLine("Fees and OrderTotal is displaying in the page.");
            }
            UserSetFunctions.Click(driver.FindElement(placeBuyOrderButton));
        }
Beispiel #6
0
 public void SelectInstrumentsAndOrderType(string instruments, string orderType)
 {
     try
     {
         UserSetFunctions.VerifyWebElement(InstrumentDropDown(driver));
         UserSetFunctions.SelectDropdown(InstrumentDropDown(driver), instruments);
         UserSetFunctions.VerifyWebElement(OrderTypeDropDown(driver));
         UserSetFunctions.SelectDropdown(OrderTypeDropDown(driver), orderType);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Beispiel #7
0
        public void PlaceMultipleLimitSellOrder(string instrument, string side, string sellAmount, string limitPrice, string timeinforce)
        {
            string successMsg;
            string placeOrderTime;
            string placeOrderTimePlusOneMin;

            Dictionary <string, string> limitSellOrderData = new Dictionary <string, string>();

            string askPrice = AskPrice(driver).Text;

            if (BuyOrderEntryButton().Displayed&& StopOrderTypeButton().Displayed)
            {
                UserSetFunctions.Click(OrderEntryButton());
                UserSetFunctions.Click(SellOrderEntryButton());
                UserSetFunctions.Click(MarketOrderTypeButton());
                Thread.Sleep(1000);
                UserSetFunctions.Click(LimitOrderTypeButton());
                UserSetFunctions.EnterText(SellAmountTextField(), sellAmount);
                UserSetFunctions.EnterText(LimitPriceTextBox(), limitPrice);
                UserSetFunctions.SelectDropdown(TimeInForce(), timeinforce);
                // Verify Market Price, Fees and Order Total
                Dictionary <string, string> balances = new Dictionary <string, string>();
                if (OrderTotalText().Enabled&& MarketPriceText().Enabled)
                {
                    // Storing balances in Dictionary
                    Thread.Sleep(1000);
                    balances = UserCommonFunctions.StoreOrderEntryAmountBalances(driver);
                    Assert.True(VerifySellLimitFees(balances[Const.Fees], sellAmount, limitPrice));
                    Assert.True(VerifyLimitOrderTotal(balances[Const.OrderTotal], sellAmount, limitPrice));
                    Assert.True(VerifySellOrderNet(balances[Const.Net], balances[Const.Fees], balances[Const.OrderTotal]));
                    logger.LogCheckPoint(string.Format(LogMessage.BalancesVerifiedSuccessfully, side, balances[Const.Fees], balances[Const.OrderTotal], balances[Const.Net]));
                }
                else
                {
                    logger.LogCheckPoint(string.Format(LogMessage.BalancesVerificationFailed, side));
                }
                UserSetFunctions.Click(PlaceSellOrderButton());
                UserCommonFunctions.ConfirmWindowOrder(askPrice, limitPrice, driver);
                successMsg               = UserCommonFunctions.GetTextOfMessage(driver, logger);
                placeOrderTime           = GenericUtils.GetCurrentTime();
                placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
                Assert.Equal(Const.OrderSuccessMsg, successMsg);
                logger.LogCheckPoint(String.Format(LogMessage.MarketOrderPlacedSuccessfully, side, sellAmount));
                Thread.Sleep(2000);
                UserCommonFunctions.ScrollingDownVertical(driver);
                logger.LogCheckPoint(String.Format(LogMessage.LimitOrderSuccessMsg, side, sellAmount, limitPrice));
            }
        }
Beispiel #8
0
        public void VerifyAdvanceSellOrder(string instrument, IWebDriver driver, string orderSize)
        {
            Thread.Sleep(2000);
            UserCommonFunctions.DashBoardMenuButton(driver);
            Thread.Sleep(2000);
            string exchangeStringValueFromSite = driver.FindElement(exchangeMenuText).Text;

            Thread.Sleep(3000);

            if (exchangeStringValueFromSite.Equals(exchangeMenuString))
            {
                Assert.True(true, "Verification for exchangeMenu value has been passed.");
            }
            else
            {
                Assert.False(false, "Verification for exchangeMenu value has been failed.");
            }

            UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
            UserSetFunctions.Click(driver.FindElement(advanceOrderButton));

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(sellButton));

            UserSetFunctions.SelectDropdown(driver.FindElement(instrumentList), instrument);
            UserSetFunctions.SelectDropdown(driver.FindElement(orderTypeList), orderTypeValue);

            UserSetFunctions.EnterText(driver.FindElement(ordersizeTextField), orderSize);

            if (driver.FindElement(orderTotalText).Enabled)
            {
                logger.Info("Fees and OrderTotal is displaying in the page.");
            }
            else
            {
                logger.Error("Fees and OrderTotal is displaying in the page.");
            }

            Thread.Sleep(2000);
            UserSetFunctions.Click(driver.FindElement(placeSellOrderButton));
        }
 public Dictionary <string, string> PlaceStopLimitSellOrder(string orderSize, string limitPrice, string stopPrice, string timeInForce)
 {
     try
     {
         Dictionary <string, string> placeSellOrderDict = new Dictionary <string, string>();
         UserSetFunctions.EnterText(OrderSizeEditBox(driver), orderSize);
         UserSetFunctions.EnterText(LimitPriceEditBox(driver), orderSize);
         UserSetFunctions.EnterText(StopPriceEditBox(driver), stopPrice);
         UserSetFunctions.SelectDropdown(TimeInForce(driver), timeInForce);
         UserSetFunctions.Click(PlaceSellOrderButton(driver));
         string placeOrderTime           = GenericUtils.GetCurrentTime();
         string placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
         placeSellOrderDict.Add("PlaceOrderTime", placeOrderTime);
         placeSellOrderDict.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
         Thread.Sleep(2000);
         return(placeSellOrderDict);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public void PlaceBuyOrderWithImmediateOrCancelType(string instruments, string ordertype, string ordersize, string limitprice)
        {
            try
            {
                IWebElement instrumet = driver.FindElement(instrument);
                UserSetFunctions.SelectDropdown(instrumet, instruments);

                IWebElement ordertyp = driver.FindElement(orderType);
                UserSetFunctions.SelectDropdown(ordertyp, ordertype);

                IWebElement ordersiz = driver.FindElement(orderSize);
                UserSetFunctions.EnterText(ordersiz, ordersize);

                IWebElement limitpric = driver.FindElement(limitPrice);
                UserSetFunctions.EnterText(limitpric, limitprice);

                IWebElement placebuyorder = driver.FindElement(placeByOrder);
                UserSetFunctions.Click(placebuyorder);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Beispiel #11
0
        //This method will verify the trade activites of Cyclic Report
        public bool VerifyCyclicReportData(string reportTypeValue, string startDate)
        {
            bool   flag = false;
            string ConfirmationCyclicReportModalValue;
            string confirmationModalStartDate;
            string cyclicReportMSg;
            string cyclicReportSummaryTextValue;
            string cyclicReportFrequencyTextValue;
            string cyclicReportCreatedDateTimeTextValue;
            string cyclicReportActionTextValue;
            string noReportMsg;
            string reportSummaryTextValue;
            string createdDateTimeTextValue;
            string downloadReportBtnTextValue;

            ConfirmationCyclicReportModalValue = TestData.GetData("TC48_CyclicReportConfirmationModal");
            UserCommonFunctions.DashBoardMenuButton(driver);
            UserCommonFunctions.NavigateToUserSetting(driver);
            Thread.Sleep(2000);
            UserSetFunctions.Click(TradeReportsLink());
            Thread.Sleep(1000);
            UserSetFunctions.Click(CyclicReportButton());
            if (VerifyCyclicReportTabIsSelectedAndSingleReportAndCyclicReportTabPresent())
            {
                if (VerifyCyclicReportFields() && VerifyCyclicReportFrequencyDropdownValues())
                {
                    Thread.Sleep(1000);
                    UserSetFunctions.Click(CyclicReportsTabSelected());
                    Thread.Sleep(1000);
                    UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue);
                    if (VerifyStartDateSelectableDatesForCyclicReport())
                    {
                        Thread.Sleep(2000);
                        if (startDate == null)
                        {
                            startDate = GenericUtils.GetCurrentDatePlusOne();
                        }
                        Thread.Sleep(1000);
                        StartDate().SendKeys(startDate);
                        flag = true;
                    }


                    UserSetFunctions.Click(CreateCyclicReportButton());
                    VerifyCyclicReportModalConfirmation();

                    confirmationModalStartDate = StartDateOnConfirmationSingleReportModal().Text;
                    var strtDate = DateTime.Parse(startDate.Trim());

                    if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate))
                    {
                        logger.LogCheckPoint(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy")));
                    }
                    else
                    {
                        logger.Error(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy")));
                    }
                    UserSetFunctions.Click(ConfirmationModalCreateReportButton());
                    cyclicReportMSg = ReportCreatedSuccessMsg().Text;
                    if (cyclicReportMSg.Equals(Const.CyclicTradeReportMsg))
                    {
                        logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationCyclicReportModalValue));
                    }
                    else
                    {
                        logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationCyclicReportModalValue));
                    }

                    cyclicReportSummaryTextValue         = CyclicReportSummaryText().Text;
                    cyclicReportFrequencyTextValue       = CyclicReportFrequencyText().Text;
                    cyclicReportCreatedDateTimeTextValue = CyclicReportCreatedDateTimeText().Text;
                    cyclicReportActionTextValue          = CyclicReportActionText().Text;

                    VerifyTopMostOfCyclicTradeReports(cyclicReportSummaryTextValue, cyclicReportFrequencyTextValue, cyclicReportCreatedDateTimeTextValue, cyclicReportActionTextValue);
                    UserSetFunctions.Click(CancelReport());

                    noReportMsg = NoReportIsAvailableText().Text;
                    if (noReportMsg.Equals(Const.noReportAvailableMsg))
                    {
                        logger.LogCheckPoint(String.Format(LogMessage.VerifyNoReportAvailablePassed, noReportMsg));
                    }
                    else
                    {
                        logger.Error(String.Format(LogMessage.VerifyNoReportAvailableFailed, noReportMsg));
                    }
                }

                //Need to work for cyclic report and wait for an hour till the report is present in Report available window section
                reportSummaryTextValue     = ReportSummaryText().Text;
                createdDateTimeTextValue   = ReportCreatedDateTimeText().Text;
                downloadReportBtnTextValue = DownloadReport().Text;
                VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue);
            }
            return(flag);
        }
Beispiel #12
0
        //This method will verify the trade activites of Single Report
        public bool VerifySingleReportData(string reportTypeValue, string startDate, string endDate)
        {
            bool   flag = false;
            string ConfirmationSingleReportModalValue = TestData.GetData("TC47_SingleReportConfirmationModal");

            UserCommonFunctions.DashBoardMenuButton(driver);
            UserCommonFunctions.NavigateToUserSetting(driver);
            Thread.Sleep(2000);
            UserSetFunctions.Click(TradeReportsLink());
            Thread.Sleep(1000);
            UserSetFunctions.Click(SingleReportButton());
            if (VerifySingleReportTabIsSelectedAndCyclicReportAndSingleReportTabPresent())
            {
                string confirmationModalStartDate;
                string confirmationModalEndDate;
                string expectedConfirmationModalEndDate;
                string singleReportMsg;
                string reportSummaryTextValue;
                string createdDateTimeTextValue;
                string downloadReportBtnTextValue;

                if (VerifySingleReportFields())
                {
                    Thread.Sleep(1000);
                    UserSetFunctions.Click(SingleReportsTabSelected());
                    Thread.Sleep(1000);
                    UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue);

                    if (VerifyStartDateSelectableDatesForSingleReport())
                    {
                        Thread.Sleep(2000);
                        if (startDate == null)
                        {
                            startDate = GenericUtils.GetCurrentDateMinusOne();
                        }
                        Thread.Sleep(1000);
                        StartDate().SendKeys(startDate);
                        Thread.Sleep(1000);
                        flag = true;
                    }

                    UserSetFunctions.Click(EndDate());
                    Thread.Sleep(1000);
                    if (endDate == null)
                    {
                        endDate = GenericUtils.GetCurrentDate();
                    }
                    Thread.Sleep(2000);
                    EndDate().SendKeys(endDate);
                    flag = true;

                    Thread.Sleep(1000);
                    UserSetFunctions.Click(CreateTradeReportButton());
                    VerifySingleReportModalConfirmation();

                    confirmationModalStartDate       = StartDateOnConfirmationSingleReportModal().Text;
                    confirmationModalEndDate         = EndDateOnConfirmationSingleReportModal().Text;
                    expectedConfirmationModalEndDate = endDate.Trim();
                    var strtDate = DateTime.Parse(startDate.Trim());
                    var endDte   = DateTime.Parse(expectedConfirmationModalEndDate);

                    if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate) && DateTime.Parse(confirmationModalEndDate).Equals(endDte))
                    {
                        logger.LogCheckPoint(String.Format(LogMessage.StartAndEndDateConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy"), endDte.ToString("MM/dd/yyyy")));
                    }
                    else
                    {
                        logger.Error(String.Format(LogMessage.StartAndEndDateConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy"), endDte.ToString("MM/dd/yyyy")));
                    }
                    UserSetFunctions.Click(ConfirmationModalCreateReportButton());

                    singleReportMsg = ReportCreatedSuccessMsg().Text;
                    if (singleReportMsg.Equals(Const.SingleTradeReportMsg))
                    {
                        logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationSingleReportModalValue));
                    }
                    else
                    {
                        logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationSingleReportModalValue));
                    }

                    ClickRefreshReportsButton();
                    reportSummaryTextValue     = ReportSummaryText().Text;
                    createdDateTimeTextValue   = ReportCreatedDateTimeText().Text;
                    downloadReportBtnTextValue = DownloadReport().Text;
                    VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue);
                }
            }
            return(flag);
        }
Beispiel #13
0
        //Limit sell Order
        public Dictionary <string, string> PlaceLimitSellOrder(string instrument, string side, string sellAmount, string limitPrice, string timeinforce)
        {
            string exchangeStringValueFromSite;
            string successMsg;
            string placeOrderTime;
            string placeOrderTimePlusOneMin;

            Dictionary <string, string> limitSellOrderData = new Dictionary <string, string>();

            UserCommonFunctions.DashBoardMenuButton(driver);
            UserCommonFunctions.SelectAnExchange(driver);
            Thread.Sleep(2000);
            exchangeStringValueFromSite = ExchangeMenuText().Text;
            Thread.Sleep(2000);
            if (exchangeStringValueFromSite.Equals(TestData.GetData("MenuTab")))
            {
                logger.LogCheckPoint(LogMessage.ExchangeMenuVerifiedSuccessfully);
                UserCommonFunctions.SelectInstrumentFromExchange(instrument, driver);
                UserCommonFunctions.CancelAllOrders(driver);
                string askPrice = AskPrice(driver).Text;
                if (BuyOrderEntryButton().Displayed&& StopOrderTypeButton().Displayed)
                {
                    Thread.Sleep(1000);
                    UserSetFunctions.Click(OrderEntryButton());
                    UserSetFunctions.Click(SellOrderEntryButton());
                    UserSetFunctions.Click(LimitOrderTypeButton());
                    UserSetFunctions.EnterText(SellAmountTextField(), sellAmount);
                    UserSetFunctions.EnterText(LimitPriceTextBox(), limitPrice);
                    UserSetFunctions.SelectDropdown(TimeInForce(), timeinforce);
                    // Verify Market Price, Fees and Order Total
                    Dictionary <string, string> balances = new Dictionary <string, string>();
                    if (OrderTotalText().Enabled&& MarketPriceText().Enabled)
                    {
                        // Storing balances in Dictionary
                        Thread.Sleep(1000);
                        balances = UserCommonFunctions.StoreOrderEntryAmountBalances(driver);
                        Assert.True(VerifySellLimitFees(balances[Const.Fees], sellAmount, limitPrice));
                        Assert.True(VerifyLimitOrderTotal(balances[Const.OrderTotal], sellAmount, limitPrice));
                        Assert.True(VerifySellOrderNet(balances[Const.Net], balances[Const.Fees], balances[Const.OrderTotal]));
                        logger.LogCheckPoint(string.Format(LogMessage.BalancesVerifiedSuccessfully, side, balances[Const.Fees], balances[Const.OrderTotal], balances[Const.Net]));
                    }
                    else
                    {
                        logger.LogCheckPoint(string.Format(LogMessage.BalancesVerificationFailed, side));
                    }
                    Thread.Sleep(1000);
                    UserSetFunctions.Click(PlaceSellOrderButton());
                    UserCommonFunctions.ConfirmWindowOrder(askPrice, limitPrice, driver);
                    successMsg               = UserCommonFunctions.GetTextOfMessage(driver, logger);
                    placeOrderTime           = GenericUtils.GetCurrentTime();
                    placeOrderTimePlusOneMin = GenericUtils.GetCurrentTimePlusOneMinute();
                    Thread.Sleep(1000);
                    Assert.Equal(Const.OrderSuccessMsg, successMsg);
                    limitSellOrderData.Add("PlaceOrderTime", placeOrderTime);
                    limitSellOrderData.Add("PlaceOrderTimePlusOneMin", placeOrderTimePlusOneMin);
                    Thread.Sleep(2000);
                    UserCommonFunctions.ScrollingDownVertical(driver);
                    logger.LogCheckPoint(String.Format(LogMessage.LimitOrderSuccessMsg, side, sellAmount, limitPrice));
                }
            }
            return(limitSellOrderData);
        }
Beispiel #14
0
        //This method will verify the trade activites of Cyclic Report
        public bool VerifyCyclicReportData(string reportTypeValue, string startDate)
        {
            bool   flag = false;
            string ConfirmationCyclicReportModalValue;
            string confirmationModalStartDate;
            string cyclicReportMSg;
            string cyclicReportSummaryTextValue;
            string cyclicReportFrequencyTextValue;
            string cyclicReportCreatedDateTimeTextValue;
            string cyclicReportActionTextValue;
            string noReportMsg;
            string reportSummaryTextValue;
            string createdDateTimeTextValue;
            string downloadReportBtnTextValue;

            ConfirmationCyclicReportModalValue = TestData.GetData("TC48_CyclicReportConfirmationModal");

            try
            {
                // Click on "Dashboard" menu button --> "UserSetting" menu button --> "Trade Reports" button
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.NavigateToUserSetting(driver);
                Thread.Sleep(2000);
                UserSetFunctions.Click(TradeReportsLink());
                Thread.Sleep(1000);

                // Click on "Cyclical Report" button
                UserSetFunctions.Click(CyclicReportButton());

                // Verify if Cyclic Report tab is selected bydefault and single, Cyclic tab is present
                if (VerifyCyclicReportTabIsSelectedAndSingleReportAndCyclicReportTabPresent())
                {
                    //Verify below fields are present:accounts, report type and start date, frequency
                    // Verify Frequency has dropdown values hourly, daily, weekly, monthly and annual
                    if (VerifyCyclicReportFields() && VerifyCyclicReportFrequencyDropdownValues())
                    {
                        Thread.Sleep(1000);
                        UserSetFunctions.Click(CyclicReportsTabSelected());
                        Thread.Sleep(1000);
                        UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue);
                        if (VerifyStartDateSelectableDatesForCyclicReport(startDate))
                        {
                            Thread.Sleep(2000);
                            if (startDate == null)
                            {
                                startDate = GenericUtils.GetCurrentDatePlusOne();
                            }
                            flag = true;
                        }

                        // Click on "Create" button
                        UserSetFunctions.Click(CreateCyclicReportButton());

                        // Verify the details in cyclic report confirmation modal window
                        VerifyCyclicReportModalConfirmation();

                        confirmationModalStartDate = StartDateOnConfirmationSingleReportModal().Text;
                        var strtDate = DateTime.Parse(startDate.Trim());

                        // This will verify the start date in the confirmation window modal of cyclic report
                        if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate))
                        {
                            logger.LogCheckPoint(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy")));
                        }
                        else
                        {
                            logger.Error(String.Format(LogMessage.StartDateOnCyclicReportConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy")));
                        }

                        // Click on "Schedule Report" button
                        UserSetFunctions.Click(ConfirmationModalCreateReportButton());
                        cyclicReportMSg = ReportCreatedSuccessMsg().Text;

                        // Verify the success message
                        if (cyclicReportMSg.Equals(Const.CyclicTradeReportMsg))
                        {
                            logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationCyclicReportModalValue));
                        }
                        else
                        {
                            logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationCyclicReportModalValue));
                        }

                        cyclicReportSummaryTextValue         = CyclicReportSummaryText().Text;
                        cyclicReportFrequencyTextValue       = CyclicReportFrequencyText().Text;
                        cyclicReportCreatedDateTimeTextValue = CyclicReportCreatedDateTimeText().Text;
                        cyclicReportActionTextValue          = CyclicReportActionText().Text;

                        // Verify Report is available under "Cyclic reports" section, Report Summary is "Report Type"
                        // Verify the frequency and created date
                        // Verify delete button is available
                        VerifyTopMostOfCyclicTradeReports(cyclicReportSummaryTextValue, cyclicReportFrequencyTextValue, cyclicReportCreatedDateTimeTextValue, cyclicReportActionTextValue);

                        // Click on "Cancel Report" button
                        UserSetFunctions.Click(CancelReport());

                        noReportMsg = NoReportIsAvailableText().Text;

                        // Verify that the report is removed from "Cyclic reports" section
                        if (noReportMsg.Equals(Const.noReportAvailableMsg))
                        {
                            logger.LogCheckPoint(String.Format(LogMessage.VerifyNoReportAvailablePassed, noReportMsg));
                        }
                        else
                        {
                            logger.Error(String.Format(LogMessage.VerifyNoReportAvailableFailed, noReportMsg));
                        }
                    }

                    //Need to work for cyclic report and wait for an hour till the report is present in Report available window section
                    reportSummaryTextValue     = ReportSummaryText().Text;
                    createdDateTimeTextValue   = ReportCreatedDateTimeText().Text;
                    downloadReportBtnTextValue = DownloadReport().Text;
                    VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue);
                    return(true);
                }
                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #15
0
        //This method will verify the trade activites of Single Report
        public bool VerifySingleReportData(string reportTypeValue, string startDate, string endDate)
        {
            bool   flag = false;
            string ConfirmationSingleReportModalValue = TestData.GetData("TC47_SingleReportConfirmationModal");

            try
            {
                // Click on "Dashboard" menu button --> "UserSetting" menu button --> "Trade Reports" button
                UserCommonFunctions.DashBoardMenuButton(driver);
                UserCommonFunctions.NavigateToUserSetting(driver);
                Thread.Sleep(2000);
                UserSetFunctions.Click(TradeReportsLink());
                Thread.Sleep(1000);

                // Click on "Single Report" button
                UserSetFunctions.Click(SingleReportButton());

                // Verify if Single Report tab is selected bydefault and single, Cyclic tab is present
                if (VerifySingleReportTabIsSelectedAndCyclicReportAndSingleReportTabPresent())
                {
                    string confirmationModalStartDate;
                    string confirmationModalEndDate;
                    string expectedConfirmationModalEndDate;
                    string singleReportMsg;
                    string reportSummaryTextValue;
                    string createdDateTimeTextValue;
                    string downloadReportBtnTextValue;


                    //Verify below fields are present:accounts, report type and start date, end date
                    if (VerifySingleReportFields())
                    {
                        Thread.Sleep(1000);

                        UserSetFunctions.Click(SingleReportsTabSelected());
                        Thread.Sleep(1000);
                        UserSetFunctions.SelectDropdown(ReportType(), reportTypeValue);

                        // Verify Current Date - 1 and all previous dates are selectable
                        if (VerifyStartDateSelectableDatesForSingleReport())
                        {
                            Thread.Sleep(2000);
                            if (startDate == null)
                            {
                                startDate = GenericUtils.GetCurrentDateMinusOne();
                            }
                            Thread.Sleep(1000);

                            // Enter "Start date"
                            StartDate().SendKeys(startDate);
                            Thread.Sleep(1000);
                            flag = true;
                        }

                        // Click on "End date"
                        UserSetFunctions.Click(EndDate());
                        Thread.Sleep(1000);
                        if (endDate == null)
                        {
                            endDate = GenericUtils.GetCurrentDate();
                        }
                        Thread.Sleep(2000);
                        // Enter "End date"
                        EndDate().SendKeys(endDate);
                        flag = true;

                        Thread.Sleep(1000);

                        // Click on "Create Report" button
                        UserSetFunctions.Click(CreateTradeReportButton());

                        // Verify confirmation modal is displayed
                        VerifySingleReportModalConfirmation();

                        confirmationModalStartDate       = StartDateOnConfirmationSingleReportModal().Text;
                        confirmationModalEndDate         = EndDateOnConfirmationSingleReportModal().Text;
                        expectedConfirmationModalEndDate = endDate.Trim();
                        var strtDate = DateTime.Parse(startDate.Trim());
                        var endDte   = DateTime.Parse(expectedConfirmationModalEndDate);

                        // This will verify the start and end date in the confirmation window modal of single report
                        if (DateTime.Parse(confirmationModalStartDate).Equals(strtDate) && DateTime.Parse(confirmationModalEndDate).Equals(endDte))
                        {
                            logger.LogCheckPoint(String.Format(LogMessage.StartAndEndDateConfirmationModalPassed, strtDate.ToString("MM/dd/yyyy"), endDte.ToString("MM/dd/yyyy")));
                        }
                        else
                        {
                            logger.Error(String.Format(LogMessage.StartAndEndDateConfirmationModalFailed, strtDate.ToString("MM/dd/yyyy"), endDte.ToString("MM/dd/yyyy")));
                        }
                        UserSetFunctions.Click(ConfirmationModalCreateReportButton());
                        singleReportMsg = ReportCreatedSuccessMsg().Text;

                        // This will verify the success message after creating the a single rpeort
                        if (singleReportMsg.Equals(Const.SingleTradeReportMsg))
                        {
                            logger.LogCheckPoint(String.Format(LogMessage.SuccessMsgPassed, ConfirmationSingleReportModalValue));
                        }
                        else
                        {
                            logger.Error(String.Format(LogMessage.SuccessMsgFailed, ConfirmationSingleReportModalValue));
                        }

                        ClickRefreshReportsButton();
                        reportSummaryTextValue     = ReportSummaryText().Text;
                        createdDateTimeTextValue   = ReportCreatedDateTimeText().Text;
                        downloadReportBtnTextValue = DownloadReport().Text;

                        // Verify the "created time", Report summary is "report type" , on demand and from and to date.
                        // Verify the report is downloadable
                        VerifyDownloadableTradeReports(reportSummaryTextValue, createdDateTimeTextValue, downloadReportBtnTextValue);
                    }
                }
                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
        }