Пример #1
0
        protected void EnterKeyBoardInput(By locator)
        {
            Actions action = new Actions(driver);

            action.SendKeys(Keys.Enter).Build().Perform();
            ExtentReportHelpers.AddTestInfo(3, "");
        }
Пример #2
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);
        }
Пример #3
0
 protected void SendKeys(IWebElement element, string text)
 {
     WaitForElement(element);
     Clear(element);
     element.SendKeys(text);
     ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + text);
 }
        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();
        }
Пример #5
0
        protected string GetValue(By locator)
        {
            string text = WaitForElement(locator).GetAttribute("value");

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + text);
            return(text);
        }
Пример #6
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));
        }
Пример #7
0
        protected string GetAttribute(By locator, string mensagem)
        {
            string text = WaitForElement(locator).GetAttribute(mensagem);

            ExtentReportHelpers.AddTestInfo(3, "");
            return(text);
        }
Пример #8
0
 protected void SendKeys(By locator, string text)
 {
     Clear(locator);
     Console.WriteLine(text);
     WaitForElement(locator).SendKeys(text);
     ExtentReportHelpers.AddTestInfo(3, "PARAMETER: " + text);
 }
Пример #9
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));
        }
Пример #10
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);
        }
Пример #11
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);
        }
Пример #12
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));
        }
Пример #13
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);
        }
Пример #14
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));
        }
        public static int ReturnMaxProjectsBD()
        {
            string executQuerie = ProjectsQueries.CountProjectBD;

            ExtentReportHelpers.AddTestInfo(2, "Total search of project in table");
            return(Convert.ToInt32(DataBaseHelpers.RetornaDadosQuery(executQuerie)[0]));
        }
Пример #16
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));
        }
Пример #17
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));
        }
Пример #18
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);
        }
Пример #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
        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);
        }
Пример #22
0
        public string GetURL()
        {
            string url = driver.Url;

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

            return(url);
        }
Пример #23
0
        public string GetTitle()
        {
            string title = driver.Title;

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

            return(title);
        }
Пример #24
0
        protected bool ReturnIfElementIsSelected(IWebElement element)
        {
            WaitForElement(element);
            bool result = element.Selected;

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + result);
            return(result);
        }
Пример #25
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);
        }
Пример #26
0
        public static void InserirAssinarBugParaUser01DB()
        {
            string query = File.ReadAllText(GeneralHelpers.ReturnProjectPath() + "Queries/InsertBugAssignToUser.sql", Encoding.UTF8);

            DBHelpers.ExecuteQuery(query);

            ExtentReportHelpers.AddTestInfo(2, "PARAMETERS: Executa query - " + query);
        }
Пример #27
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, "");
        }
Пример #28
0
        protected string GetValue(IWebElement element)
        {
            WaitForElement(element);
            string text = element.GetAttribute("value");

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + text);
            return(text);
        }
Пример #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 bool ReturnIfElementIsSelected(By locator)
        {
            wait.Until(ExpectedConditions.ElementExists(locator));
            bool result = driver.FindElement(locator).Selected;

            ExtentReportHelpers.AddTestInfo(3, "RETURN: " + result);
            return(result);
        }