public void ShouldReturnASuccessCreateMessage()
    {
        wait = new WebDriverWait(driver, new TimeSpan(0, 10, 0));
        wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(InvalidOperationException));

        driver.Navigate().GoToUrl("http://eapresfeature.tce.govrn/");

        LoginTCE login = new LoginTCE("054.762.524-36", "dev@123");

        login.join();

        wait.Until(e => e.FindElement(By.LinkText("Cadastros"))).Click();
        wait.Until(e => e.FindElement(By.Id("responsavelApuracao"))).Click();

        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));

        wait.Until(e => e.FindElement(By.Id("botaoCadastrar")));

        wait.Until(e => e.FindElement(By.XPath("/html/body/app-root/app-dashboard/div/div/main/app-responsavelapuracao-list/section/h1/a"))).Click();

        var group          = "Procuradoria Geral de Justiça";
        var responsibility = "Siai DP";
        var sector         = "DDP - DIRETORIA DE DESPESA COM PESSOAL";

        ResponsavelPelaApuracaoPO responsavelPO = new ResponsavelPelaApuracaoPO(group, responsibility, sector);

        responsavelPO.register();

        wait.Until(e => e.FindElement(By.XPath("/html/body/div[2]/div/div[2]/div[1]")));
        var actualResult   = driver.FindElement(By.XPath("/html/body/div[2]/div/div[2]/div[1]")).Text;
        var expectedResult = "Cadastro realizado com sucesso!";

        StringAssert.AreEqualIgnoringCase(expectedResult, actualResult);
    }
Пример #2
0
    public void ShouldGeneratePendencias()
    {
        wait = new WebDriverWait(driver, new TimeSpan(0, 5, 0));
        wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(InvalidOperationException));

        driver.Navigate().GoToUrl("http://eapresfeature.tce.govrn/");

        LoginTCE login = new LoginTCE("054.762.524-36", "dev@123");

        login.join();

        driver.FindElement(By.LinkText("Monitoramento")).Click();
        driver.FindElement(By.Id("pendencia")).Click(); {
            var     element = driver.FindElement(By.Id("pendencia"));
            Actions builder = new Actions(driver);
            builder.MoveToElement(element).Perform();
        }

        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));
        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));

        var month = DescribedMonths[CurrentMonth - 2];
        var year  = CurrentYear;

        driver.FindElement(By.Id("idPeriodoBusca")).Click();
        driver.FindElement(By.XPath($"//*[text()='{month}']")).Click();

        driver.FindElement(By.Id("idAnoBusca")).Click();
        driver.FindElement(By.XPath($"//*[text()='{year}']")).Click();

        driver.FindElement(By.Id("idOrgaoBusca")).Click();
        driver.FindElement(By.XPath($"//*[text()='{Responsible}']")).Click();

        driver.FindElement(By.Id("botaoGerarPendencia")).Click();

        wait.Until(e => e.FindElement(By.CssSelector(".swal2-title")).Text != "Gerando Pendências...");

        var actualResult   = wait.Until(e => e.FindElement(By.CssSelector(".swal2-title"))).Text;
        var expectedResult = "Pendências Geradas com Sucesso";

        StringAssert.AreEqualIgnoringCase(expectedResult, actualResult);
    }
Пример #3
0
    public void ShouldReturnASuccessProcessProtocolMessage()
    {
        wait = new WebDriverWait(driver, new TimeSpan(0, 5, 0));
        wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(InvalidOperationException));

        driver.Navigate().GoToUrl("http://eapresfeature.tce.govrn/");

        LoginTCE login = new LoginTCE("054.762.524-36", "dev@123");

        login.join();

        driver.FindElement(By.LinkText("Monitoramento")).Click();
        driver.FindElement(By.Id("pendencia")).Click();
        {
            var     element = driver.FindElement(By.Id("pendencia"));
            Actions builder = new Actions(driver);
            builder.MoveToElement(element).Perform();
        }

        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));
        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));

        wait.Until(e => e.FindElement(By.XPath("/html/body/app-root/app-dashboard/div/div/main/app-pendencia-list/section/div[2]/div/div[3]/form/div[1]/table/tbody/tr[1]/td[2]")));

        wait.Until(e => e.FindElement(By.Id("selectStatusAutuacao"))).Click();
        wait.Until(e => e.FindElement(By.XPath("/html/body/app-root/app-dashboard/div/div/main/app-pendencia-list/section/div[2]/div/div[2]/div/fieldset[2]/form/div/div[5]/ng-select/ng-dropdown-panel/div/div[2]/div[1]/span"))).Click();

        driver.FindElement(By.Id("botaoConsultarPendencia")).Click();
        wait.Until(e => e.FindElement(By.CssSelector(".odd:nth-child(1) .fa-file-text-o")));
        wait.Until(e => e.FindElement(By.CssSelector(".odd:nth-child(1) .fa-file-text-o"))).Click();

        wait.Until(e => e.FindElement(By.CssSelector(".swal2-confirm"))).Click();

        wait.Until(e => e.FindElement(By.CssSelector(".swal2-html-container")).Text != "Deseja realmente gerar número de processo para esta pendência?");

        var actualResult   = wait.Until(e => e.FindElement(By.CssSelector(".swal2-html-container"))).Text;
        var expectedResult = "Processo protocolado com sucesso";

        StringAssert.AreEqualIgnoringCase(expectedResult, actualResult);
    }
Пример #4
0
    public void ShouldCreateAPdfDocument()
    {
        wait = new WebDriverWait(driver, new TimeSpan(0, 5, 0));
        wait.IgnoreExceptionTypes(typeof(NoSuchElementException), typeof(InvalidOperationException));

        // driver.Navigate().GoToUrl("http://eapresfeature.tce.govrn/");
        driver.Navigate().GoToUrl("http://*****:*****@123");

        login.join();

        driver.FindElement(By.LinkText("Monitoramento")).Click();
        driver.FindElement(By.Id("pendencia")).Click();
        {
            var     element = driver.FindElement(By.Id("pendencia"));
            Actions builder = new Actions(driver);
            builder.MoveToElement(element).Perform();
        }

        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));
        wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.PresenceOfAllElementsLocatedBy(By.XPath("//*[@id='loading2'][contains(@style, 'display: none')]")));

        wait.Until(e => e.FindElement(By.XPath("/html/body/app-root/app-dashboard/div/div/main/app-pendencia-list/section/div[2]/div/div[3]/form/div[1]/table/tbody/tr[1]/td[2]")));

        wait.Until(e => e.FindElement(By.Id("selectStatusAutuacao"))).Click();
        // Pronto para Instrução Inicial
        wait.Until(e => e.FindElement(By.XPath("/html/body/app-root/app-dashboard/div/div/main/app-pendencia-list/section/div[2]/div/div[2]/div/fieldset[2]/form/div/div[5]/ng-select/ng-dropdown-panel/div/div[2]/div[2]/span"))).Click();

        driver.FindElement(By.Id("botaoConsultarPendencia")).Click();
        wait.Until(e => e.FindElement(By.CssSelector(".odd:nth-child(1) .fa-file-pdf-o")));
        driver.FindElement(By.CssSelector(".odd:nth-child(1) .fa-file-pdf-o")).Click();

        driver.FindElement(By.CssSelector(".swal2-cancel")).Click();

        var actualResult = wait.Until(e => e.FindElement(By.Id("ifrm"))).GetAttribute("src");

        Assert.IsNotEmpty(actualResult);
    }