public void AA1_LoginSGI(IList <ParametroPrueba> parametroPrueba) { string usuario = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Usuario")).Valor; string password = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Password")).Valor; try { #region "VALIDACION LOGIN" Utilitarios.ValidacionLogin(); #endregion #region "EJECUCION DE LA PRUEBA" ElementosWebLogin elementosLogin = new ElementosWebLogin(); elementosLogin.txtUsuario.SendKeys(usuario); elementosLogin.txtPassword.SendKeys(password); Utilitarios.GenerarCaptura("AA1_LoginSGI_Captura1_Ingreso de Campos"); System.Threading.Thread.Sleep(1000); elementosLogin.btnLogin.Click(); System.Threading.Thread.Sleep(1000); Utilitarios.GenerarCaptura("AA1_LoginSGI_Captura2_Click botón Login"); /*Validacion de pagina inicial*/ if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio + "/Gestion") { Utilitarios.GenerarCaptura("AA1_LoginSGI_Captura3_Error validación"); throw new ExcepcionSistema("VALIDACION: Error usuario no pudo iniciar sesión en la aplicación."); } #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } } }
public void CA1_InsertarRegistro(IList <ParametroPrueba> parametroPrueba) { string cliente = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Cliente")).Valor; string proyecto = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Proyecto")).Valor; string titulo = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Titulo")).Valor; string detalle = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Detalle")).Valor; string tags = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Tags")).Valor; string imagen = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Imagen")).Valor; try { #region "VALIDACION INICIAR LOGIN" Utilitarios.ValidacionIniciarPrueba(); #endregion #region "EJECIÓN DE LA PRUEBA ElementosWebMenu elementosMenu = new ElementosWebMenu(); elementosMenu.MenuProyectos.Click(); System.Threading.Thread.Sleep(1500); elementosMenu.SubMenuProyectosBitacora.Click(); System.Threading.Thread.Sleep(1500); ElementosWebBitacoras elementosBitacora = new ElementosWebBitacoras(); new SelectElement(elementosBitacora.ddlCliente).SelectByText(cliente); System.Threading.Thread.Sleep(800); new SelectElement(elementosBitacora.ddlProyecto).SelectByText(proyecto); System.Threading.Thread.Sleep(1000); elementosBitacora.btnNuevaBitacora.Click(); System.Threading.Thread.Sleep(1000); elementosBitacora.txtTitulo.SendKeys(titulo); elementosBitacora.txtDetalle.SendKeys(detalle); elementosBitacora.txtTags.SendKeys(tags); elementosBitacora.fileBitacora.SendKeys(imagen); System.Threading.Thread.Sleep(1000); elementosBitacora.btnGuardar.Click(); System.Threading.Thread.Sleep(1000); //Despliego la grilla. new SelectElement(elementosBitacora.ddlCliente).SelectByText(cliente); System.Threading.Thread.Sleep(800); new SelectElement(elementosBitacora.ddlProyecto).SelectByText(proyecto); System.Threading.Thread.Sleep(800); string[] columnasAFiltrar = new string[] { "Titulo", "Detalle" }; Dictionary <string, string> filtros = new Dictionary <string, string>(); filtros.Add("Titulo", titulo); filtros.Add("Detalle", detalle); filtros.Add("Tags", tags); Utilitarios.ValidarExistenciaGrilla("tableBitacora", columnasAFiltrar, filtros); #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && !ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } } }
public void CA1_InsertarRegistro_bkp() { Dictionary <string, string> diccionario = Utilitarios.ObtenerParametrosPorExcel("Bitacora", "CA1_InsertarRegistro"); string cliente = diccionario.Where(x => x.Key.Equals("Cliente")).FirstOrDefault().Value; string proyecto = diccionario.Where(x => x.Key.Equals("Proyecto")).FirstOrDefault().Value; string titulo = diccionario.Where(x => x.Key.Equals("Titulo")).FirstOrDefault().Value; string detalle = diccionario.Where(x => x.Key.Equals("Detalle")).FirstOrDefault().Value; string tags = diccionario.Where(x => x.Key.Equals("Tags")).FirstOrDefault().Value; string imagen = diccionario.Where(x => x.Key.Equals("Imagen")).FirstOrDefault().Value; try { #region "VALIDACION INICIAR LOGIN" Utilitarios.ValidacionIniciarPrueba(); #endregion #region "EJECIÓN DE LA PRUEBA ElementosWebMenu elementosMenu = new ElementosWebMenu(); elementosMenu.MenuProyectos.Click(); System.Threading.Thread.Sleep(1500); elementosMenu.SubMenuProyectosBitacora.Click(); System.Threading.Thread.Sleep(1500); ElementosWebBitacoras elementosBitacora = new ElementosWebBitacoras(); elementosBitacora.ddlCliente.SendKeys(cliente); elementosBitacora.ddlProyecto.SendKeys(proyecto); System.Threading.Thread.Sleep(1000); elementosBitacora.btnNuevaBitacora.Click(); System.Threading.Thread.Sleep(1000); string valorAConcatenar = DateTime.Now.ToString("hhmmss"); elementosBitacora.txtTitulo.SendKeys(titulo); elementosBitacora.txtDetalle.SendKeys(detalle); elementosBitacora.txtTags.SendKeys(tags); //Activar para IE, verificar para Firefox; //elementosBitacora.fileBitacora.Click(); elementosBitacora.fileBitacora.SendKeys("C:\\Users\\Nicolas\\Desktop\\avatar01.png"); System.Threading.Thread.Sleep(1000); elementosBitacora.btnGuardar.Click(); System.Threading.Thread.Sleep(1000); //Despliego la grilla elementosBitacora.ddlCliente.SendKeys(cliente); elementosBitacora.ddlProyecto.SendKeys(proyecto); System.Threading.Thread.Sleep(1000); string[] columnasAFiltrar = new string[] { "Titulo", "Detalle" }; Dictionary <string, string> filtros = new Dictionary <string, string>(); filtros.Add("Titulo", titulo); filtros.Add("Detalle", detalle); filtros.Add("Tags", tags); Utilitarios.ValidarExistenciaGrilla("tableBitacora", columnasAFiltrar, filtros); #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && !ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } } }
public void AA2_LoginMensajeErrorSGI() { Dictionary <string, string> diccionario = Utilitarios.ObtenerParametrosPorExcel("Login", "AA2_LoginMensajeErrorSGI"); string usuario = diccionario.Where(x => x.Key.Equals("Usuario")).FirstOrDefault().Value; string password = diccionario.Where(x => x.Key.Equals("Password")).FirstOrDefault().Value; try { #region "VALIDACION LOGIN" Utilitarios.ValidacionLogin(); #endregion #region "EJECUCION DE LA PRUEBA" ElementosWebLogin elementosLogin = new ElementosWebLogin(); System.Threading.Thread.Sleep(4000); elementosLogin.txtUsuario.SendKeys(usuario); System.Threading.Thread.Sleep(1000); elementosLogin.txtPassword.SendKeys(password); System.Threading.Thread.Sleep(1000); Utilitarios.GenerarCaptura("AA2_LoginMensajeErrorSGI_Captura1_Ingreso de campos"); System.Threading.Thread.Sleep(1500); elementosLogin.btnLogin.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA2_LoginMensajeErrorSGI_Captura2_Click botón login"); /*Validacion de pagina inicial*/ if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio + "/Gestion") { List <IWebElement> listaElementosTagName = Utilitarios.ObtieneElementosPorTag("div"); if (!listaElementosTagName.Where(x => x.Text.Equals("El nombre de usuario o la contraseña especificados son incorrectos.")).Any()) { Utilitarios.GenerarCaptura("AA2_LoginMensajeErrorSGI_Captura3_Error validación"); throw new ExcepcionSistema("VALIDACION: Error, no despliega mensaje que indica que el usuario o la contraseña son inválidos."); } else { elementosLogin.btnAceptar.Click(); } } #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } } }
public void AA4_LogoutSGI() { Dictionary <string, string> diccionario = Utilitarios.ObtenerParametrosPorExcel("Login", "AA4_LogoutSGI"); string usuario = diccionario.Where(x => x.Key.Equals("Usuario")).FirstOrDefault().Value; string password = diccionario.Where(x => x.Key.Equals("Password")).FirstOrDefault().Value; try { #region "VALIDACION LOGIN" Utilitarios.ValidacionLogin(); #endregion #region "EJECUCIÓN DE LA PRUEBA" ElementosWebLogin elementosLogout = new ElementosWebLogin(); if (PropiedadColeccionDriver.driver != null) { var dropDownMenu = Utilitarios.ObtieneElementosPorClase("user-menu"); if (dropDownMenu.Count > 0) { elementosLogout.btnCerrar.Click(); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura1_Click botón cerrar"); System.Threading.Thread.Sleep(1500); elementosLogout.btnCerrarSesion.Click(); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura2_Click botón cerrar sesión"); if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio) { System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura3_Error validación"); throw new ExcepcionSistema("VALIDACION: Error, el usuario no pudo salir del sistema."); } } else { ElementosWebLogin elementosLogin = new ElementosWebLogin(); elementosLogin.txtUsuario.SendKeys(usuario); elementosLogin.txtPassword.SendKeys(password); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura4_Completa campos"); elementosLogin.btnLogin.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura5_Click botón login"); if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio + "/Gestion") { PropiedadColeccionDriver.driver.Url = ParametrosEjecucion.RutaDelSitio + "/Gestion"; } } } else { ElementosWebLogin elementosLogin = new ElementosWebLogin(); elementosLogin.txtUsuario.SendKeys(usuario); elementosLogin.txtPassword.SendKeys(password); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura6_Completa campos"); elementosLogin.btnLogin.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura7_Click botón login"); if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio + "/Gestion") { PropiedadColeccionDriver.driver.Url = ParametrosEjecucion.RutaDelSitio + "/Gestion"; } } elementosLogout.btnCerrar.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura8_Click botón cerrar"); elementosLogout.btnCerrarSesion.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura9_Click botón cerrar sesión"); if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio) { System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA4_LogoutSGI_Captura10_Error validación"); throw new ExcepcionSistema("VALIDACION: Error, el usuario no pudo salir del sistema."); } #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } } }
public void AA3_LoginCamposRequeridos() { try { #region "VALIDACION LOGIN" Utilitarios.ValidacionLogin(); #endregion #region "EJECUCION DE LA PRUEBA" ElementosWebLogin elementosLogin = new ElementosWebLogin(); System.Threading.Thread.Sleep(1000); elementosLogin.txtUsuario.Clear(); System.Threading.Thread.Sleep(1000); elementosLogin.txtPassword.Clear(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA3_LoginCamposRequeridos_Captura1_Limpia campos"); elementosLogin.btnLogin.Click(); System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA3_LoginCamposRequeridos_Captura2_Click botón login"); List <IWebElement> listaElementoTagName = Utilitarios.ObtieneElementosPorTag("div"); if (!listaElementoTagName.Where(x => x.Text.Equals("Nombre de usuario es obligatorio")).Any()) { System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA3_LoginCamposRequeridos_Captura3_Error Validacion"); throw new ExcepcionSistema("VALIDACION: Error, al desplegar mensaje de Usuario requerido."); } else if (!listaElementoTagName.Where(x => x.Text.Equals("Contraseña es obligatorio")).Any()) { System.Threading.Thread.Sleep(1500); Utilitarios.GenerarCaptura("AA3_LoginCamposRequeridos_Captura4_Error validación"); throw new ExcepcionSistema("VALIDACION: Error, al desplegar mensaje de Contraseña requerido."); } #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } } }
public void BA1_InsertarTarea() { try { #region "VALIDACION INICIAR LOGIN" Utilitarios.ValidacionIniciarPrueba(); #endregion #region "EJECIÓN DE LA PRUEBA ElementosWebMenu elementosMenu = new ElementosWebMenu(); elementosMenu.MenuProyectos.Click(); System.Threading.Thread.Sleep(1500); elementosMenu.SubMenuProyectosTareas.Click(); System.Threading.Thread.Sleep(1500); ElementosWebTareas elementosWebTareas = new ElementosWebTareas(); elementosWebTareas.btnNuevaTarea.Click(); System.Threading.Thread.Sleep(1000); var valorAConcatenar = DateTime.Now.ToString("hhmmss"); elementosWebTareas.txtTitulo.SendKeys("Titulo" + valorAConcatenar); elementosWebTareas.txtDecripcion.SendKeys("Decripcion" + valorAConcatenar); elementosWebTareas.ddlProyectos.SendKeys("Pruebas Automatizadas"); elementosWebTareas.ddlEstado.SendKeys("Pendiente"); elementosWebTareas.btnGuardarTarea.Click(); System.Threading.Thread.Sleep(1000); string[] columnasAFiltrar = new string[] { "Título" }; Dictionary <string, string> filtros = new Dictionary <string, string>(); filtros.Add("Título", "Titulo" + valorAConcatenar); filtros.Add("Decripcion", "Decripcion" + valorAConcatenar); filtros.Add("Estado", "Pendiente"); Utilitarios.ValidarExistenciaGrilla("tableTarea", columnasAFiltrar, filtros); #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { Utilitarios.Espera(2000); if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } } }
public void DA1_InsertarRegistro(IList <ParametroPrueba> parametroPrueba) { string descripcion = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Descripcion")).Valor; string montoUF = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("MontoUF")).Valor; string proyecto = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Proyecto")).Valor; string fechaPlanificada = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("FechaPlanificada")).Valor; string fechaCumplimiento = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("FechaCumplimiento")).Valor; string rutaSVN = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("RutaSVN")).Valor; string estado = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("Estado")).Valor; string SLA = parametroPrueba.FirstOrDefault(x => x.Nombre.Equals("SLA")).Valor; try { #region "VALIDACION INICIAR LOGIN" Utilitarios.ValidacionIniciarPrueba(); #endregion #region "EJECIÓN DE LA PRUEBA ElementosWebMenu elementosMenu = new ElementosWebMenu(); elementosMenu.MenuProyectos.Click(); System.Threading.Thread.Sleep(1500); elementosMenu.SubMenuProyectosHitos.Click(); System.Threading.Thread.Sleep(1500); ElementosWebHitos elementosWebHitos = new ElementosWebHitos(); new SelectElement(elementosWebHitos.ddlProyectoInicio).SelectByText(proyecto); System.Threading.Thread.Sleep(1000); elementosWebHitos.btnNuevoHito.Click(); System.Threading.Thread.Sleep(1000); elementosWebHitos.txtDescripcion.SendKeys(descripcion); elementosWebHitos.txtMontoUF.SendKeys(montoUF); new SelectElement(elementosWebHitos.ddlProyecto).SelectByText(proyecto); elementosWebHitos.dtFechaCumplimiento.SendKeys(fechaCumplimiento); elementosWebHitos.dtFechaCumplimiento.SendKeys(fechaPlanificada); elementosWebHitos.txtRutaSVN.SendKeys(rutaSVN); new SelectElement(elementosWebHitos.ddlEstado).SelectByText(estado); new SelectElement(elementosWebHitos.ddlSLA).SelectByText(SLA); System.Threading.Thread.Sleep(1000); elementosWebHitos.btnGuardarHito.Click(); System.Threading.Thread.Sleep(1000); System.Threading.Thread.Sleep(800); if (PropiedadColeccionDriver.driver.Url != ParametrosEjecucion.RutaDelSitio + "/Gestion/Hito") { throw new ExcepcionSistema("Prueba Fallada. Revise si completó todos los campos obligatorios"); } string[] columnasAFiltrar = new string[] { "Proyecto", "Descripción", "Monto UF" }; Dictionary <string, string> filtros = new Dictionary <string, string>(); filtros.Add("Proyecto", proyecto); filtros.Add("Descripción", descripcion); filtros.Add("Monto UF", montoUF.Replace(',', '.')); Utilitarios.ValidarExistenciaGrilla("tableHito", columnasAFiltrar, filtros); #endregion } catch (ExcepcionSistema) { throw; } catch { throw; } finally { if (ParametrosEjecucion.CerrarNavegadorPorPrueba) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } if (!ParametrosEjecucion.CerrarNavegadorPorPrueba && !ParametrosEjecucion.CerrarNavegadorPorModulo) { Prueba.Finalizar(); } } }