cambios y correcciones al login2
This commit is contained in:
parent
0eccfbd010
commit
d58f2c3fda
17
.classpath
17
.classpath
|
@ -24,5 +24,22 @@
|
|||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.testng.TESTNG_CONTAINER"/>
|
||||
<classpathentry kind="src" path="target/generated-sources/annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
|
|
11
.project
11
.project
|
@ -20,4 +20,15 @@
|
|||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1640619014105</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
|
|
|
@ -12,5 +12,6 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
|||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=disabled
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
|
Binary file not shown.
BIN
reserva.xls
BIN
reserva.xls
Binary file not shown.
|
@ -8,7 +8,7 @@ public class AutorizacionesBC {
|
|||
|
||||
public static ResponseDTO consultarAutorizaciones(AutorizacionesDTO autorizaciones) {
|
||||
return new HomeView().
|
||||
ingresarAutorizaciones().
|
||||
ingresarAutorizaciones().// aun por probar
|
||||
consultarAutorizaciones(autorizaciones);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@ import com.nuevaeps.webapp.view.LoginView;
|
|||
|
||||
public class LoginBC {
|
||||
|
||||
|
||||
public static ResponseDTO realizarLogin(LoginDTO login){
|
||||
return new LoginView().realizarLogin(login);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static ResponseDTO realizarLoginValido(LoginDTO login){
|
||||
return new LoginView().realizarLoginValido(login);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package com.nuevaeps.webapp.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.testng.AssertJUnit.assertEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.nuevaeps.webapp.bc.AutorizacionesBC;
|
||||
import com.nuevaeps.webapp.bc.LoginBC;
|
||||
import com.nuevaeps.webapp.ral.dto.AutorizacionesDTO;
|
||||
import com.nuevaeps.webapp.ral.dto.LoginDTO;
|
||||
import com.nuevaeps.webapp.utils.Configuracion;
|
||||
|
@ -27,7 +29,7 @@ public class AutorizacionesTest {
|
|||
|
||||
|
||||
ArrayList<AutorizacionesDTO> AutorizacionesDataPool = new ArrayList<AutorizacionesDTO>();
|
||||
|
||||
ArrayList<LoginDTO> loginDataPool = new ArrayList<LoginDTO>();
|
||||
//Ingresa la configuracion del navegador,la url, y la ruta del archivo de la data
|
||||
public void setup(){
|
||||
Configuracion.iniciarConfiguracion();
|
||||
|
@ -45,7 +47,7 @@ public class AutorizacionesTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void cargarAutorizacionSoporteTamanoMaximo() {
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.solicitarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
|
@ -61,7 +63,7 @@ public class AutorizacionesTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void cargarAutorizacionSoporteYActualizar() {
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.solicitarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
|
@ -77,7 +79,7 @@ public class AutorizacionesTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void cargarAutorizacionSoporteActualizandoDatos() {
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.solicitarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
|
@ -94,7 +96,7 @@ public class AutorizacionesTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void cargarAutorizacionSinSoporte() {
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.solicitarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
|
@ -112,6 +114,11 @@ public class AutorizacionesTest {
|
|||
* **/
|
||||
@Test
|
||||
public void consultaAutorizacionesFechaMayorMaxima() {
|
||||
/*
|
||||
* Al ingresar un rango de fechas igual a 91 días y pulsar el botón consultar,
|
||||
* se genera una ventana emergente con el mensaje de alerta: "El rango de fechas
|
||||
* es máximo de 90 días" y el botón Aceptar.
|
||||
* */
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.consultarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
}
|
||||
|
@ -127,9 +134,27 @@ public class AutorizacionesTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
/*
|
||||
* Al ingresar un rango de fechas igual a 90 días y pulsar el botón consultar, se despliega
|
||||
* en pantalla la información relacionada a los diferentes radicados que tiene el afiliado en
|
||||
* este periodo de tiempo. Se genera la siguiente información por cada uno de los radicados:
|
||||
* Nro. Radicado y estado
|
||||
*
|
||||
* */
|
||||
@Test
|
||||
public void consultaAutorizacionesFechaMaxima() {
|
||||
public void consultaAutorizacionesFechaMaxima() {/* en diseño.... cargar con file y llamar por STRING */
|
||||
setup();
|
||||
assertEquals(AutorizacionesBC.consultarAutorizaciones(null).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
for (LoginDTO login : loginDataPool)
|
||||
{
|
||||
/*Enviar cada objeto que contiene el escenario*/
|
||||
|
||||
LoginBC.realizarLoginValido(login);
|
||||
}
|
||||
|
||||
AutorizacionesDTO SolicitudAutorizacion= new AutorizacionesDTO();
|
||||
SolicitudAutorizacion.setFechaDesde("01/12/2021");
|
||||
SolicitudAutorizacion.setFechaHasta("10/01/2022");
|
||||
SolicitudAutorizacion.setRadicado("");
|
||||
assertEquals(AutorizacionesBC.consultarAutorizaciones(null).getMensajePantalla(),"Consultar autorizaciones");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,10 @@ import java.util.ArrayList;
|
|||
import org.junit.Test;
|
||||
|
||||
import com.nuevaeps.webapp.bc.LoginBC;
|
||||
import com.nuevaeps.webapp.ral.LoginRAL;
|
||||
import com.nuevaeps.webapp.ral.dto.LoginDTO;
|
||||
import com.nuevaeps.webapp.utils.Configuracion;
|
||||
import com.nuevaeps.webapp.utils.PATH;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
@ -31,6 +33,7 @@ public class LoginTest {
|
|||
//Ingresa la configuracion del navegador,la url, y la ruta del archivo de la data
|
||||
public void setup(){
|
||||
Configuracion.iniciarConfiguracion();
|
||||
this.loginDataPool = LoginRAL.obtenerDatosLogin(PATH.DATA_POOL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,7 +47,7 @@ public class LoginTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void realizarLoginUsuarioInvalido() {
|
||||
setup();
|
||||
/*Enviar cada objeto que contiene el escenario*/
|
||||
|
@ -52,7 +55,7 @@ public class LoginTest {
|
|||
login.setTipoDocumento("0");
|
||||
login.setTipoUsuario("1");
|
||||
login.setNumeroDocumento("12345");
|
||||
login.setContrasena("1234");
|
||||
login.setContrasena("123456");
|
||||
|
||||
assertEquals(LoginBC.realizarLogin(login).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
}
|
||||
|
@ -68,7 +71,7 @@ public class LoginTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
@Test
|
||||
//@Test
|
||||
public void realizarLoginContrasenaInvalida() {
|
||||
/*Enviar cada objeto que contiene el escenario*/
|
||||
setup();
|
||||
|
@ -76,7 +79,7 @@ public class LoginTest {
|
|||
login.setTipoDocumento("0");
|
||||
login.setTipoUsuario("1");
|
||||
login.setNumeroDocumento("21078447");
|
||||
login.setContrasena("00000");
|
||||
login.setContrasena("0000");
|
||||
|
||||
assertEquals(LoginBC.realizarLogin(login).getMensajePantalla(),"Usuario o clave incorrecto");
|
||||
}
|
||||
|
@ -92,10 +95,13 @@ public class LoginTest {
|
|||
* @author Dilan Steven Mejia
|
||||
*
|
||||
* **/
|
||||
public void realizarLoginUsuarioValido(LoginDTO login) {
|
||||
@Test
|
||||
public void realizarLoginUsuarioValido() {
|
||||
setup();
|
||||
for (LoginDTO login : loginDataPool) {
|
||||
/*Enviar cada objeto que contiene el escenario*/
|
||||
assertEquals(LoginBC.realizarLogin(login),true);
|
||||
|
||||
assertEquals(LoginBC.realizarLogin(login).getMensajePantalla(),"En qué podemos ayudarte!!");
|
||||
}
|
||||
}
|
||||
|
||||
//Se cierran las sesiones del driver.
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package com.nuevaeps.webapp.test;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import org.openqa.selenium.support.ui.Select;
|
||||
|
||||
public class some {
|
||||
|
||||
@Test
|
||||
public static void AutorizacionesFecha() {
|
||||
|
||||
|
||||
System.setProperty("webdriver.chrome.driver", "C:\\Users\\dariza\\Trabajo\\greenSQA\\NuevaEPS\\Java\\chromedriver.exe");
|
||||
WebDriver driver = new ChromeDriver();
|
||||
String frdate = "1";
|
||||
String todate = "10";
|
||||
driver.get("https://nepsqa.nuevaeps.com.co/#/Authorizations");
|
||||
// wait of 2 seconds
|
||||
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
|
||||
WebElement e = driver.findElement(By.xpath("//*[@id='birthdatef']/iframe"));
|
||||
driver.switchTo().frame(e);
|
||||
// choose from date
|
||||
driver.findElement(By.xpath("//input[@id='from']")).click();
|
||||
//Thread.sleep(1000);
|
||||
// choose month from dropdown
|
||||
WebElement m = driver
|
||||
.findElement(By.xpath("//div/select[@class='ui− datepicker−month']"));
|
||||
Select s = new Select(m);
|
||||
s.selectByVisibleText("Nov");
|
||||
//Thread.sleep(1000);
|
||||
// select day
|
||||
driver.findElement(By.xpath("//td[not(contains(@class,'ui−datepicker− month'))]/a[text()='"+frdate+"']")).click();
|
||||
//Thread.sleep(1000);
|
||||
// choose to date
|
||||
driver.findElement(By.xpath("//input[@id='to']")).click();
|
||||
//Thread.sleep(1000);
|
||||
// choose month from dropdown
|
||||
WebElement n = driver
|
||||
.findElement(By.xpath("//div/select[@class='ui− datepicker−month']"));
|
||||
Select sel = new Select(n);
|
||||
sel.selectByVisibleText("Jan");
|
||||
//Thread.sleep(1000);
|
||||
// select day
|
||||
driver.findElement(By.xpath("//td[not(contains(@class,'ui−datepicker− month'))]/a[text()='"+todate+"']")).click();
|
||||
//Thread.sleep(1000);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -3,5 +3,5 @@ package com.nuevaeps.webapp.utils;
|
|||
public class PATH {
|
||||
public static final TipoDriver NAVEGADOR = TipoDriver.CHROME;
|
||||
public static final String URL = "https://nepsqa.nuevaeps.com.co/#/";
|
||||
public static final String DATA_POOL = "reserva.xls";
|
||||
}
|
||||
public static final String DATA_POOL = "DatosLogin.xls";
|
||||
}
|
|
@ -42,9 +42,9 @@ public class AutorizacionesView {
|
|||
@FindBy(css="#consutarForm > div > div:nth-child(5) > button")
|
||||
private WebElement btnConsultarAutorizaciones;
|
||||
|
||||
@FindBy(css=".light text-center mb20")
|
||||
private WebElement RespuestaConsulta;
|
||||
|
||||
|
||||
|
||||
public AutorizacionesView() {
|
||||
SeleniumUtils.esperarElemento(".btn.btn-primary.mt10","css",30);
|
||||
PageFactory.initElements(Configuracion.driver, this);
|
||||
|
@ -58,7 +58,8 @@ public class AutorizacionesView {
|
|||
public ResponseDTO solicitarAutorizaciones(AutorizacionesDTO autorizaciones) {
|
||||
btnSolicitar.click();
|
||||
SeleniumUtils.esperarElemento("solictarAutorizaciones","id",30);
|
||||
inputRadicado.sendKeys(autorizaciones.getRadicado());
|
||||
/*inputRadicado.sendKeys(autorizaciones.getRadicado());*/
|
||||
inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
inputObservaciones.sendKeys(autorizaciones.getObservaciones());
|
||||
btnGrabar.click();
|
||||
|
||||
|
@ -77,13 +78,69 @@ public class AutorizacionesView {
|
|||
|
||||
btnConsultar.click();
|
||||
SeleniumUtils.esperarElemento("consutarForm","id",30);
|
||||
inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
//inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
inputRadicado.sendKeys(autorizaciones.getRadicado());
|
||||
inputDesde.sendKeys(autorizaciones.getFechaDesde());
|
||||
inputHasta.sendKeys(autorizaciones.getFechaHasta());
|
||||
btnConsultarAutorizaciones.click();
|
||||
|
||||
return new ResponseDTO(true, "Autorizacion Consultada");
|
||||
SeleniumUtils.esperarElemento("Consultar Autorizaciones","class",30 );//Revision
|
||||
String Respuesta = RespuestaConsulta.getText();
|
||||
return new ResponseDTO(true, Respuesta);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// /**
|
||||
// *
|
||||
// * @param autorizaciones
|
||||
// * @return
|
||||
// */
|
||||
// public ResponseDTO solicitarAutorizaciones(AutorizacionesDTO autorizaciones) {
|
||||
// btnSolicitar.click();
|
||||
// SeleniumUtils.esperarElemento("solictarAutorizaciones","id",30);
|
||||
// /*inputRadicado.sendKeys(autorizaciones.getRadicado());*/
|
||||
// inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
// inputObservaciones.sendKeys(autorizaciones.getObservaciones());
|
||||
// btnGrabar.click();
|
||||
|
||||
// Alert alertDialog = Configuracion.driver.switchTo().alert();
|
||||
// String mensajeRespuesta = alertDialog.getText();
|
||||
|
||||
// return new ResponseDTO(true, mensajeRespuesta);
|
||||
// }
|
||||
// /**
|
||||
// *
|
||||
// * @param autorizaciones
|
||||
// * @return
|
||||
// */
|
||||
// public ResponseDTO solicitarAutorizaciones(AutorizacionesDTO autorizaciones) {
|
||||
// btnSolicitar.click();
|
||||
// SeleniumUtils.esperarElemento("solictarAutorizaciones","id",30);
|
||||
// /*inputRadicado.sendKeys(autorizaciones.getRadicado());*/
|
||||
// inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
// inputObservaciones.sendKeys(autorizaciones.getObservaciones());
|
||||
// btnGrabar.click();
|
||||
|
||||
// Alert alertDialog = Configuracion.driver.switchTo().alert();
|
||||
// String mensajeRespuesta = alertDialog.getText();
|
||||
|
||||
// return new ResponseDTO(true, mensajeRespuesta);
|
||||
// }
|
||||
// /**
|
||||
// *
|
||||
// * @param autorizaciones
|
||||
// * @return
|
||||
// */
|
||||
// public ResponseDTO solicitarAutorizaciones(AutorizacionesDTO autorizaciones) {
|
||||
// btnSolicitar.click();
|
||||
// SeleniumUtils.esperarElemento("solictarAutorizaciones","id",30);
|
||||
// /*inputRadicado.sendKeys(autorizaciones.getRadicado());*/
|
||||
// inputSorporte.sendKeys(autorizaciones.getSoporte());
|
||||
// inputObservaciones.sendKeys(autorizaciones.getObservaciones());
|
||||
// btnGrabar.click();
|
||||
|
||||
// Alert alertDialog = Configuracion.driver.switchTo().alert();
|
||||
// String mensajeRespuesta = alertDialog.getText();
|
||||
|
||||
// return new ResponseDTO(true, mensajeRespuesta);
|
||||
// }
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import org.openqa.selenium.WebElement;
|
|||
import org.openqa.selenium.support.FindBy;
|
||||
import org.openqa.selenium.support.PageFactory;
|
||||
|
||||
import com.nuevaeps.webapp.bc.AutorizacionesBC;
|
||||
import com.nuevaeps.webapp.utils.Configuracion;
|
||||
import com.nuevaeps.webapp.utils.SeleniumUtils;
|
||||
|
||||
|
@ -19,11 +20,17 @@ public class HomeView {
|
|||
}
|
||||
|
||||
|
||||
public AutorizacionesView ingresarAutorizaciones() {
|
||||
public AutorizacionesView AutorizacionesView() {
|
||||
btnAutorizaciones.click();
|
||||
return new AutorizacionesView();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public AutorizacionesBC ingresarAutorizaciones() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -28,6 +28,9 @@ public class LoginView {
|
|||
@FindBy(id="btnLogin")
|
||||
private WebElement btnIngresar;
|
||||
|
||||
@FindBy(id="txtSWelcom2")
|
||||
private WebElement txtBienvenidos;
|
||||
|
||||
|
||||
public LoginView() {
|
||||
SeleniumUtils.esperarElemento("usertype","id",30);
|
||||
|
@ -71,4 +74,32 @@ public class LoginView {
|
|||
}
|
||||
|
||||
|
||||
public ResponseDTO realizarLoginValido(LoginDTO loginDTO) {
|
||||
|
||||
try {
|
||||
|
||||
Select tipoUsuario = new Select(selectTipoUsuario);
|
||||
tipoUsuario.selectByIndex(Integer.parseInt(loginDTO.getTipoUsuario()));
|
||||
|
||||
Select tipoDocumento = new Select(selectTipoUsuario);
|
||||
tipoDocumento.selectByIndex(Integer.parseInt(loginDTO.getTipoDocumento()));
|
||||
|
||||
inputNumeroDocumento.sendKeys(loginDTO.getNumeroDocumento());
|
||||
|
||||
inputContrasena.sendKeys(loginDTO.getContrasena());
|
||||
|
||||
btnIngresar.click();
|
||||
|
||||
SeleniumUtils.esperarElemento("En qué podemos ayudarte!!", "id",30);
|
||||
String Bienvenido = txtBienvenidos.getText();
|
||||
|
||||
return new ResponseDTO(true,Bienvenido);
|
||||
|
||||
} catch (Exception e) {
|
||||
return new ResponseDTO(false, e.getMessage());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue