Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<crowdar.cucumber.filter>@Demo</crowdar.cucumber.filter>
<crowdar.cucumber.filter>@Fichap</crowdar.cucumber.filter>
<cucumber.runner>testngParallel.xml</cucumber.runner>
<crowdar.driverHub></crowdar.driverHub>
<crowdar.cucumber.option>src/test/resources/features --glue com/crowdar --glue com/crowdar/bdd/cukes --tags ${crowdar.cucumber.filter} --tags 'not @Ignore' --plugin com.crowdar.examples.report.Reporter: --plugin pretty</crowdar.cucumber.option>
Expand All @@ -26,15 +26,28 @@

<profiles>
<profile>
<id>Local</id>
<id>Fisico</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<crowdar.driverHub>http://127.0.0.1:4723/wd/hub</crowdar.driverHub>
<cucumber.runner>testng.xml</cucumber.runner>
<crowdar.avd></crowdar.avd>
<crowdar.appLocation>D:/Workspace/CrowdarAcademy/ExamenIntegrador/academy-mobile-exercise/sample_apk/fichap.apk</crowdar.appLocation>
<crowdar.deviceName>Moto G5s Plus</crowdar.deviceName>
</properties>
</profile>
<profile>
<id>Local</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<crowdar.driverHub>http://127.0.0.1:4723/wd/hub</crowdar.driverHub>
<cucumber.runner>testng.xml</cucumber.runner>
<crowdar.avd>Pixel3</crowdar.avd>
<crowdar.appLocation>C:/workspace/crowdar/lippia/Lippia-mobile-sample-project/sample_apk/lippia.apk</crowdar.appLocation>
<crowdar.appLocation>D:/Workspace/CrowdarAcademy/ExamenIntegrador/academy-mobile-exercise/sample_apk/fichap.apk</crowdar.appLocation>
<crowdar.deviceName>Pixel3</crowdar.deviceName>
</properties>
</profile>
Expand Down
Binary file not shown.
12 changes: 12 additions & 0 deletions src/main/java/com/crowdar/examples/constants/CameraConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class CameraConstants {

public static final String BUTTON_TAKE_PICTURE_LOCATOR = "CameraView.ButtonTakePicture"+ DriverManager.getName();
public static final String MESSAGE_OCURRIO_ERROR_LOCATOR = "CameraView.MessageOcurrioError"+DriverManager.getName();
public static final String BUTTON_REPORT_LOCATOR = "CameraView.ButtonReport"+DriverManager.getName();
public static final String MESSAGE_AVISO_ERROR_LOCATOR = "CameraView.MessageAviso"+DriverManager.getName();
public static final String BUTTON_ACCEPT_LOCATOR = "CameraView.ButtonAccept"+DriverManager.getName();
}
10 changes: 10 additions & 0 deletions src/main/java/com/crowdar/examples/constants/FicharConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class FicharConstants {

public static final String TITLE_FICHAR_VIEW_LOCATOR = "FicharView.TitleFicharView"+ DriverManager.getName();
public static final String BUTTON_COMENZAR_JORNADA_LOCATOR = "FicharView.ButtonComenzarJornada"+ DriverManager.getName();

}
11 changes: 0 additions & 11 deletions src/main/java/com/crowdar/examples/constants/HomeConstants.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/java/com/crowdar/examples/constants/LoginConstants.java

This file was deleted.

12 changes: 12 additions & 0 deletions src/main/java/com/crowdar/examples/constants/MenuConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class MenuConstants {
public static final String IMAGE_MENU_LOCATOR = "MenuView.ImageMenu"+ DriverManager.getName();
public static final String BUTTON_FICHAR_LOCATOR = "MenuView.ButtonFichar"+ DriverManager.getName();
public static final String BUTTON_SOLICITUDES_LOCATOR = "MenuView.ButtonSolicitudes"+ DriverManager.getName();
public static final String BUTTON_PERFIL_LOCATOR = "MenuView.ButtonPerfil"+ DriverManager.getName();
public static final String BUTTON_CERRAR_SESION_LOCATOR = "MenuView.ButtonCerrarSesion"+ DriverManager.getName();
public static final String MESSAGE_CONFIRMATION_CERRARSESION = "MenuView.MessageCerrarSesion"+ DriverManager.getName();
}
15 changes: 15 additions & 0 deletions src/main/java/com/crowdar/examples/constants/ProfileConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.crowdar.examples.constants;

public class ProfileConstants {

public static final String TITLE_PROFILE_VIEW_LOCATOR = "ProfileView.TitleViewProfile";
public static final String INPUT_NAME_LOCATOR = "ProfileView.InputName";
public static final String INPUT_LASTNAME_LOCATOR = "ProfileView.InputLastName";
public static final String INPUT_DNI_LOCATOR = "ProfileView.InputDNI";
public static final String INPUT_PHONE_NUMBER_LOCATOR = "ProfileView.InputPhoneNumber";
public static final String INPUT_ADDRESS_LOCATOR = "ProfileView.InputAddress";
public static final String BUTTON_SAVE_LOCATOR = "ProfileView.ButtonSave";
public static final String BUTTON_MENU_LOCATOR = "ProfileView.ButtonMenu";
public static final String MESSAGE_AVISO_LOCATOR = "ProfileView.MessageAviso";
public static final String BUTTON_OKAVISO_LOCATOR = "ProfileView.ButtonOkAviso";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.crowdar.examples.constants;


import com.crowdar.driver.DriverManager;

public class RecorridoConstant {
public static final String TITLE_RECORRIDO_VIEW_LOCATOR = "RecorridoView.TitleRecorridoView"+ DriverManager.getName();
public static final String BUTTON_MENU_LOCATOR = "RecorridoView.ButtonMenu"+ DriverManager.getName();
public static final String BUTTON_FINALIZAR_JORNADA_LOCATOR = "RecorridoView.ButtonFinalizarJornada"+ DriverManager.getName();
public static final String MESSAGE_CONFIRMATION_FIN_LOCATOR = "RecorridoView.MessageFinalizarJornada"+ DriverManager.getName();
public static final String BUTTON_CONFIRMATIO_OK_LOCATOR = "RecorridoView.ButtonOkMessage"+ DriverManager.getName();
public static final String BUTTON_FINISH_LOCATOR = "RecorridoView.ButtonFinish"+ DriverManager.getName();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class ReporteConstant {

public static final String MODAL_TITLE_REPORT_LOCATOR = "ReporteView.ModalTitleReportSucces"+ DriverManager.getName();
public static final String BUTTON_COMENZAR_JORNADA_LOCATOR = "ReporteView.ButtonComenzarJornada"+ DriverManager.getName();
}
10 changes: 10 additions & 0 deletions src/main/java/com/crowdar/examples/constants/SignInConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class SignInConstants {

public static final String SIGN_IN_BUTTON_LOCATOR = "SignInView.SignInButton"+ DriverManager.getName();
public static final String EMAIL_INPUT_LOCATOR = "SignInView.EmailInput"+ DriverManager.getName();
public static final String PASSWORD_INPUT_LOCATOR = "SignInView.PasswordInput"+ DriverManager.getName();
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.crowdar.examples.constants;

import com.crowdar.driver.DriverManager;

public class SolicitudesConstants {
public static final String TITLE_VIEW_LOCATOR = "SolicitudesView.TitleView" + DriverManager.getName();
public static final String CALENDAR_DAYS_LOCATOR = "SolicitudesView.CalendarDays" + DriverManager.getName();
public static final String CALENDAR_MONTHS_LOCATOR = "SolicitudesView.CalendarMonth" + DriverManager.getName();
public static final String INPUT_MOTIVO_LOCATOR = "SolicitudesView.InputMotivo" + DriverManager.getName();
public static final String BUTTON_ENVIAR_SOLICITUD_LOCATOR = "SolicitudesView.ButtonEnviarSolicitud" + DriverManager.getName();
public static final String BUTTON_NEXTMONTH_CALENDAR_LOCATOR = "SolicitudesView.ButtonCalendarNextMonth" + DriverManager.getName();
public static final String MESSAGE_CONFIRMATION_ENVIAR_LOCATOR = "SolicitudesView.ConfirmationEnviarSolicitud" + DriverManager.getName();
public static final String BUTTON_OK_CONFIRMATION_LOCATOR = "SolicitudesView.ButtonOkConfirmation" + DriverManager.getName();
public static final String MESSAGE_SOLICITUD_REGISTRADA_LOCATOR = "SolicitudesView.MessageSolicitudRegistrada" + DriverManager.getName();
public static final String BUTTON_OK_SOLICITUD_REGISTRADA_LOCATOR = "SolicitudesView.ButtonOkSolicitudRegistrada" + DriverManager.getName();

}
39 changes: 39 additions & 0 deletions src/main/java/com/crowdar/examples/services/CameraService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.crowdar.examples.services;

import com.crowdar.core.actions.MobileActionManager;
import com.crowdar.examples.constants.CameraConstants;
import org.testng.Assert;

public class CameraService {

public static void isCameraViewLoaded(){
MobileActionManager.waitVisibility(CameraConstants.BUTTON_TAKE_PICTURE_LOCATOR);
Assert.assertTrue(MobileActionManager.isPresent(CameraConstants.BUTTON_TAKE_PICTURE_LOCATOR), "El elemento no esta visible");
}

public static void takePicture() {
MobileActionManager.click(CameraConstants.BUTTON_TAKE_PICTURE_LOCATOR);
}

public static void verifyErrorMessage(String message) {
switch (message){
case "Aviso": Assert.assertEquals(MobileActionManager.getText(CameraConstants.MESSAGE_AVISO_ERROR_LOCATOR), message);
case "Ocurrió un error": Assert.assertEquals(MobileActionManager.getText(CameraConstants.MESSAGE_OCURRIO_ERROR_LOCATOR),message);
}
}

public static void clickButtons(String button){
switch (button){
case "Aceptar": clickAcceptButton(); break;
case "Reportar": clickReportButton(); break;
}
}

private static void clickReportButton() {
MobileActionManager.click(CameraConstants.BUTTON_REPORT_LOCATOR);
}
private static void clickAcceptButton() {
MobileActionManager.click(CameraConstants.BUTTON_ACCEPT_LOCATOR);
}

}
17 changes: 17 additions & 0 deletions src/main/java/com/crowdar/examples/services/FicharService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.crowdar.examples.services;

import com.crowdar.core.actions.MobileActionManager;
import com.crowdar.examples.constants.FicharConstants;
import org.testng.Assert;

public class FicharService {

public static void isFicharViewLoaded(){
MobileActionManager.waitVisibility(FicharConstants.BUTTON_COMENZAR_JORNADA_LOCATOR);
Assert.assertEquals(MobileActionManager.getText(FicharConstants.TITLE_FICHAR_VIEW_LOCATOR), "Fichar");
}

public static void clickButton(){
MobileActionManager.click(FicharConstants.BUTTON_COMENZAR_JORNADA_LOCATOR);
}
}
18 changes: 0 additions & 18 deletions src/main/java/com/crowdar/examples/services/HomeService.java

This file was deleted.

25 changes: 0 additions & 25 deletions src/main/java/com/crowdar/examples/services/LoginService.java

This file was deleted.

26 changes: 26 additions & 0 deletions src/main/java/com/crowdar/examples/services/MenuService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.crowdar.examples.services;

import com.crowdar.core.actions.MobileActionManager;
import com.crowdar.examples.constants.MenuConstants;
import org.testng.Assert;

public class MenuService {
public static void isMenuViewLoaded() {
MobileActionManager.waitVisibility(MenuConstants.IMAGE_MENU_LOCATOR);
Assert.assertTrue(MobileActionManager.isPresent(MenuConstants.IMAGE_MENU_LOCATOR),"El elemento no esta visible");
}

public static void clickButtons(String button){
switch (button){
case "Fichar": MobileActionManager.click(MenuConstants.BUTTON_FICHAR_LOCATOR); break;
case "Solicitudes": MobileActionManager.click(MenuConstants.BUTTON_SOLICITUDES_LOCATOR); break;
case "Perfil": MobileActionManager.click(MenuConstants.BUTTON_PERFIL_LOCATOR); break;
case "Cerrar Sesion": MobileActionManager.click(MenuConstants.BUTTON_CERRAR_SESION_LOCATOR); break;
}
}

public static void verifyMessage() {
Assert.assertEquals(MobileActionManager.getText(MenuConstants.MESSAGE_CONFIRMATION_CERRARSESION), "¿Está seguro que desea cerrar sesión?");
}

}
39 changes: 39 additions & 0 deletions src/main/java/com/crowdar/examples/services/ProfileService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.crowdar.examples.services;

import com.crowdar.core.actions.MobileActionManager;
import com.crowdar.examples.constants.ProfileConstants;
import org.testng.Assert;

public class ProfileService {

public static void isProfileViewLoaded() {
Assert.assertEquals(MobileActionManager.getText(ProfileConstants.TITLE_PROFILE_VIEW_LOCATOR), "Mi Perfil");
}

public static void setPersonalInfo(String nombre, String apellido, String dni, String tel, String dir) {
MobileActionManager.setInput(ProfileConstants.INPUT_NAME_LOCATOR, nombre, false, true);
MobileActionManager.setInput(ProfileConstants.INPUT_LASTNAME_LOCATOR, apellido, false, true);
MobileActionManager.setInput(ProfileConstants.INPUT_DNI_LOCATOR, dni, false, true);
MobileActionManager.setInput(ProfileConstants.INPUT_PHONE_NUMBER_LOCATOR, tel, false, true);
MobileActionManager.setInput(ProfileConstants.INPUT_ADDRESS_LOCATOR, dir, false, true);
}

public static void verifyMessage() {
Assert.assertEquals(MobileActionManager.getText(ProfileConstants.MESSAGE_AVISO_LOCATOR), "Los datos se actualizaron con éxito.");
}

public static void clickButtons(String button) {
switch (button) {
case "Guardar":
MobileActionManager.click(ProfileConstants.BUTTON_SAVE_LOCATOR);
break;
case "Menu":
MobileActionManager.click(ProfileConstants.BUTTON_MENU_LOCATOR);
break;
case "Ok":
MobileActionManager.click(ProfileConstants.BUTTON_OKAVISO_LOCATOR);
break;
}

}
}
Loading