Exemple #1
0
        public void Setup()
        {
            statuScenario = new LogStatus();

            if (contadorExtentResports == 0)
            {
                ExtentReport.CreateFileLog();
                contadorExtentResports += 1;
            }
            else
            {
                contadorExtentResports += 1;
            }

            ExecuteCMD("taskkill /im chromedriver.exe /f /t");
            ExecuteCMD("taskkill /im chrome.exe /f /t");
            webDriver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory);

            driver = new EventFiringWebDriver(webDriver);
            driver.ElementClicking      += DriverElementClicking;
            driver.ElementClicked       += DriverElementClicked;
            driver.ElementValueChanging += DriverElementValueChanging;
            driver.ElementValueChanged  += DriverElementValueChanged;

            action = new Actions(driver);

            driver.Navigate().GoToUrl(Url);

            driver.Manage().Window.Maximize();

            action = new Actions(driver);
        }
Exemple #2
0
        private void LogSucessoEAddPrint(bool aux, LogStatus logStatus)
        {
            ExtentReport.EndTest(ExtentReport.test);

            if (aux == true)
            {
                if (logStatus.Equals(LogStatus.Pass))
                {
                    if (ExtentReport.image != null)
                    {
                        ExtentReport.test.Log(LogStatus.Pass, "Teste executado com sucesso!" + ExtentReport.image);
                    }
                    else
                    {
                        ExtentReport.test.Log(LogStatus.Pass, "Teste executado com sucesso!");
                    }
                }
                else
                {
                    if (ExtentReport.image != null)
                    {
                        ExtentReport.test.Log(LogStatus.Fail, "Falha na execução do cenário!" + ExtentReport.image);
                    }
                    else
                    {
                        ExtentReport.test.Log(LogStatus.Fail, "Falha na execução do cenário!");
                    }
                }
            }
            else
            {
                if (ExtentReport.image != null)
                {
                    ExtentReport.test.Log(LogStatus.Fail, "Teste com falha, favor verificar a evidência do teste." + ExtentReport.image);
                }
                else
                {
                    ExtentReport.test.Log(LogStatus.Fail, "Teste com falha, favor verificar a evidência do teste.");
                }
            }
        }
Exemple #3
0
 private static void DriverElementClicked(object sender, WebElementEventArgs e)
 {
     ExtentReport.GenerateScreenshot();
     ExtentReport.test.Log(LogStatus.Pass, "Após a ação: " + GetDescription(e) + ExtentReport.image);
 }
Exemple #4
0
 private static void DriverElementValueChanging(object sender, WebElementEventArgs e)
 {
     ExtentReport.GenerateScreenshot();
     ExtentReport.test.Log(LogStatus.Pass, "Após a inserção do valor: " + GetDescription(e) + ExtentReport.image);
 }