Ejemplo n.º 1
0
        public string SaveReport(string formatReport)
        {
            new WebElement().ByXPath("//div[contains(@class,'report-download-button')]/button").Click();
            new WebElement().ByXPath("//input[@value='" + formatReport + "')]").Click();
            new WebElement().ByXPath("//div[contains(@class,'submit-or-cancel')]/button").Click();
            new WebElement().ByXPath("//a[@href='/c/operations/operationsHistory.xhtml']").Click();
            RequestHistoryPage rhp = new RequestHistoryPage();
            int i = 0;

            while (rhp.ChangeOfStatus("Обработан") != "success")
            {
                i = i + 1;
                new WebElement().ByXPath("//a[contains(@onclick,'update')]").Click();
                Thread.Sleep(5000);
                if (i > 2)
                {
                    return("Ожедание статуса 'Выполнен' более 100 секунд");
                }
            }
            new WebElement().ByXPath("//table/tbody//tr[@data-ri = 0]//div[contains(@class,'file-link')]/a").Click();
            string path = new WebElement().ByXPath("//table/tbody//tr[@data-ri = 0]//a[contains(@href,'/c/operations/operationDetail')]").Text + ".zip";

            Thread.Sleep(5000);
            SendKeys.SendWait("{ENTER}");
            Thread.Sleep(10000);
            return(path);
        }
Ejemplo n.º 2
0
        public void ListRequests()
        {
            var model = new List <RequestGridViewModel> {
                new RequestGridViewModel()
                {
                    Connector = "conn1"
                }
            };
            var repo = new Mock <IRequestHistoryRepo>();

            repo.Setup(c => c.ListRequest(50)).Returns(model);

            var page = new RequestHistoryPage(repo.Object, Mock.Of <ILayoutPage>());

            page.ListRequests();

            Assert.AreEqual(model, page.ViewBag["requests"]);
        }
Ejemplo n.º 3
0
        public string GetOrderedDetails()
        {
            OrderedDetalizationWE = new WebElement().ByXPath("//a[contains(@onclick,'orderedDetalisation')]");
            if (!OrderedDetalizationWE.Displayed)
            {
                return("Не отображены элементы интерфейса: ссылка на ранее заказанные отчеты");
            }
            OrderedDetalizationWE.Click();
            requestHistoryPage = new RequestHistoryPage();
            string filtr = requestHistoryPage.CheckFiltr();

            if (filtr != "Заказ детализации")
            {
                new WebElement().ByXPath("//a[contains(@onclick,'finance')]").Click();
                return(filtr);
            }
            new WebElement().ByXPath("//a[contains(@onclick,'finance')]").Click();
            return("success");
        }