Ejemplo n.º 1
0
        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();
                }
            }
        }
Ejemplo n.º 2
0
        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();
                }
            }
        }
Ejemplo n.º 3
0
        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();
                }
            }
        }
Ejemplo n.º 4
0
        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();
                }
            }
        }