コード例 #1
0
        protected string GetAttribute(By locator, string mensagem)
        {
            string text = WaitForElement(locator).GetAttribute(mensagem);

            ExtentReportHelpers.AddTestInfo(3, "");
            return(text);
        }
コード例 #2
0
 protected void SendKeys(IWebElement element, string text)
 {
     WaitForElement(element);
     Clear(element);
     element.SendKeys(text);
     ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + text);
 }
コード例 #3
0
 protected void SendKeys(By locator, string text)
 {
     Clear(locator);
     Console.WriteLine(text);
     WaitForElement(locator).SendKeys(text);
     ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + text);
 }
コード例 #4
0
        protected void EnterKeyBoardInput(By locator)
        {
            Actions action = new Actions(driver);

            action.SendKeys(Keys.Enter).Build().Perform();
            ExtentReportHelpers.AddTestInfo(3, "");
        }
コード例 #5
0
        public static void DeleteAllProject()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/DeleteAllProjects.sql", Encoding.UTF8);

            DBHelpers.ExecuteQuery(query);
            ExtentReportHelpers.AddTestInfo(2, "PARAMETERS: Executa query - " + query);
        }
コード例 #6
0
        protected void ScrollDownToText(string text)
        {
            AguardarLoading();

            Size screenSize = DriverFactory.INSTANCE.Manage().Window.Size;

            int xMiddleScreen = screenSize.Width / 2;
            int yInitial      = (int)(screenSize.Height * 70) / 100;
            int yFinal        = (int)(screenSize.Height * 20) / 100;

            Stopwatch timeOut = new Stopwatch();

            timeOut.Start();
            while (!ReturnIfTextExistsOnScreen(text) && ((int)timeOut.Elapsed.TotalSeconds) <= GlobalParameters.CONFIG_DEFAULT_TIMEOUT_IN_SECONDS)
            {
                try
                {
                    ScrollUsingTouchActions(xMiddleScreen, yInitial, xMiddleScreen, yFinal);
                    ExtentReportHelpers.AddTestInfo(3, "");
                }
                catch (StaleElementReferenceException e)
                {
                    continue;
                }
            }
            timeOut.Stop();
        }
コード例 #7
0
ファイル: TestBase.cs プロジェクト: diegotegs/Projeto_Mantis2
        public void OneTimeTearDown()
        {
            ExtentReportHelpers.GenerateReport();

            //deleta cargas no final da execução de teste
            DeleteChargesDBSteps.OneTimeTearDB();
        }
コード例 #8
0
        public IRestResponse <dynamic> ExecuteRequest()
        {
            IRestResponse <dynamic> response;

            if (apiSpotfy)
            {
                response = RestSharpHelpers.ExecuteRequest(urlSpotify, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                ExtentReportHelpers.AddTestInfo(urlSpotify, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }
            else if (apiGerarTokenSpotfy)
            {
                response = RestSharpHelpers.ExecuteRequest(urlGerarTokenSpotify, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                //ExtentReportHelpers.AddTestInfo(urlGerarTokenSpotify, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }
            else
            {
                response = RestSharpHelpers.ExecuteRequest(urlMantis, requestService, method, headers, parametrosBody, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

                ExtentReportHelpers.AddTestInfo(urlMantis, requestService, method.ToString(), headers, parametrosBody, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);
            }

            return(response);
        }
コード例 #9
0
        public static void deletaMassaTestesDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/deletaMassaTestes.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Deleta registros para inciar testes");
            DBHelpers.ExecuteQuery(query);
        }
コード例 #10
0
        public static void InsereTodosRegistrosDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/inserirTodosRegistrosTabela.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Insere todos registros para inciar testes ");
            DBHelpers.ExecuteQuery(query);
        }
コード例 #11
0
        public static List <string> RetornaInfoTarefaCriadaDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/obterTarefaCriada.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Retorna dados de uma tarefa criada");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #12
0
        public static void DeletaSubprojetosDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/deletarSubProjetos.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Deleta SubProjetos vinculados a um projeto");
            DBHelpers.ExecuteQuery(query);
        }
コード例 #13
0
        public static List <string> RetornaInfoMeuUsuarioDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/obterInfoMeuUsuario.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Retorna Informações meu usuario adm");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #14
0
        public void OneTimeTearDown()
        {
            ExtentReportHelpers.GenerateReport();

            //Limpa tabelas da DB no final do test
            MassaStartDBSteps.ClearMassaDeTestsDB();
        }
コード例 #15
0
        public static List <string> RetornaIdNomeAleatorioProjetoDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/obterProjeto.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "consulta informações usuário");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #16
0
        public static List <string> RetornaIdSubProjetoDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/idSubProjeto.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Retorna Id Sub Projeto");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #17
0
        public static int ReturnMaxProjectsBD()
        {
            string executQuerie = ProjectsQueries.CountProjectBD;

            ExtentReportHelpers.AddTestInfo(2, "Total search of project in table");
            return(Convert.ToInt32(DataBaseHelpers.RetornaDadosQuery(executQuerie)[0]));
        }
コード例 #18
0
        protected string GetValue(By locator)
        {
            string text = WaitForElement(locator).GetAttribute("value");

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + text);
            return(text);
        }
コード例 #19
0
        protected string GetText(By locator)
        {
            string text = WaitForElement(locator).Text;

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + text);
            return(text);
        }
コード例 #20
0
        protected void MouseOver(By locator)
        {
            Actions action = new Actions(driver);

            action.MoveToElement(WaitForElement(locator)).Build().Perform();
            ExtentReportHelpers.AddTestInfo(3, "");
        }
コード例 #21
0
        public static List <string> RetornaIdProblemaDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/idUmaTarefa.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Retorna id de um problema");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #22
0
        public static List <string> RetornaCriacaoUsuarioDB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/criacaoUsuario.sql", Encoding.UTF8);

            ExtentReportHelpers.AddTestInfo(2, "Retorna dados de criacao de usuario");
            return(DBHelpers.RetornaDadosQuery(query));
        }
コード例 #23
0
        protected void SendKeysWithoutWaitVisible(By locator, string text)
        {
            wait.Until(ExpectedConditions.ElementExists(locator));
            IWebElement element = driver.FindElement(locator);

            element.SendKeys(text);
            ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + text);
        }
コード例 #24
0
        protected void ScrollToElementJavaScript(By locator)
        {
            wait.Until(ExpectedConditions.ElementExists(locator));
            IWebElement element = driver.FindElement(locator);

            javaScript.ExecuteScript("arguments[0].scrollIntoView(true);", element);
            ExtentReportHelpers.AddTestInfo(3, "");
        }
コード例 #25
0
        public string GetTitle()
        {
            string title = driver.Title;

            ExtentReportHelpers.AddTestInfo(2, "RETURN: " + title);

            return(title);
        }
コード例 #26
0
        public string GetURL()
        {
            string url = driver.Url;

            ExtentReportHelpers.AddTestInfo(2, "RETURN: " + url);

            return(url);
        }
コード例 #27
0
        protected bool ReturnIfElementIsSelected(By locator)
        {
            wait.Until(ExpectedConditions.ElementExists(locator));
            bool result = driver.FindElement(locator).Selected;

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + result);
            return(result);
        }
コード例 #28
0
        public IRestResponse <dynamic> ExecuteRequest()
        {
            var response = RestSharpHelpers.ExecuteSoapRequest(url, headers, cookies, xmlBody, httpBasicAuthenticator, ntlmAuthenticator);

            ExtentReportHelpers.AddTestInfoXml(url, requestService, headers, cookies, xmlBody, httpBasicAuthenticator, ntlmAuthenticator, response);

            return(response);
        }
コード例 #29
0
        public IRestResponse <dynamic> ExecuteRequest()
        {
            IRestResponse <dynamic> response = RestSharpHelpers.ExecuteRequest(url, requestService, method, headers, cookies, parameters, parameterTypeIsUrlSegment, jsonBody, httpBasicAuthenticator, ntlmAuthenticator);

            ExtentReportHelpers.AddTestInfo(url, requestService, method.ToString(), headers, cookies, parameters, jsonBody, httpBasicAuthenticator, ntlmAuthenticator, response);

            return(response);
        }
コード例 #30
0
        protected void SendKeysJavaScript(By locator, string value)
        {
            wait.Until(ExpectedConditions.ElementExists(locator));
            IWebElement element = driver.FindElement(locator);

            javaScript.ExecuteScript("arguments[0].value='" + value + "';", element);
            ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + value);
        }