diff --git a/src/main/java/com/crowdar/tella/constants/HomeConstants.java b/src/main/java/com/crowdar/tella/constants/HomeConstants.java index bbc1ea9..2ead9b6 100644 --- a/src/main/java/com/crowdar/tella/constants/HomeConstants.java +++ b/src/main/java/com/crowdar/tella/constants/HomeConstants.java @@ -20,4 +20,5 @@ public class HomeConstants { public static final String ALOW_GOOGLE_IN_TELLA = "xpath://android.widget.Button[@resource-id=\"com.google.android.gms:id/agree_and_share_button\"]"; public static final String SLIDE_DELETE = "id:org.hzontal.tella:id/panic_seek"; public static final String LBL_CONNECTIOS = "id:org.hzontal.tella:id/serversText"; + public static final String BTN_CLOSES_APP = "xpath://android.widget.ImageButton[@content-desc=\"quick exit\"]"; } diff --git a/src/main/java/com/crowdar/tella/constants/LockUnlockConstants.java b/src/main/java/com/crowdar/tella/constants/LockUnlockConstants.java index ec83c5b..0b8cd5d 100644 --- a/src/main/java/com/crowdar/tella/constants/LockUnlockConstants.java +++ b/src/main/java/com/crowdar/tella/constants/LockUnlockConstants.java @@ -2,8 +2,8 @@ public class LockUnlockConstants { public static final String START_BUTTON = "xpath://android.widget.TextView[@resource-id=\"org.hzontal.tella:id/startBtn\"]"; - public static final String REOPEN_APP_PASSWORD_VERIFICATION= "id:password_msgTV"; - public static final String REOPEN_APP_PIN_VERIFICATION= "id:pin_enterTV"; + public static final String REOPEN_APP_PASSWORD_VERIFICATION = "id:password_msgTV"; + public static final String REOPEN_APP_PIN_VERIFICATION = "id:pin_enterTV"; public static final String NEXT_BUTTON = "id:next_btn"; public static final String LOCK_PASSWORD_BUTTON = "id:lockPasswordBtn"; public static final String PASSWORD_RIGHT_BUTTON = "id:password_right_button"; @@ -20,4 +20,6 @@ public class LockUnlockConstants { public static final String TELLA_APP = "ACCESSIBILITY_ID:Tella"; public static final String VIEW_NOT_DISPLAYED_MESSAGE = "Login page is not displayed."; + public static final String BTN_UNLOCK = "id:org.hzontal.tella:id/password_right_button"; + } diff --git a/src/main/java/com/crowdar/tella/services/HomeService.java b/src/main/java/com/crowdar/tella/services/HomeService.java index 6bde7c0..fb7c900 100644 --- a/src/main/java/com/crowdar/tella/services/HomeService.java +++ b/src/main/java/com/crowdar/tella/services/HomeService.java @@ -3,19 +3,14 @@ import com.crowdar.core.actions.MobileActionManager; import com.crowdar.tella.constants.HomeConstants; import com.crowdar.tella.constants.HomeConstantsIOS; - import io.appium.java_client.android.AndroidDriver; - - import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.PointerInput; import org.openqa.selenium.interactions.Sequence; - import org.testng.Assert; - - import java.time.Duration; import java.util.Arrays; +import java.util.Collections; public class HomeService { @@ -80,7 +75,7 @@ public static void isConnection() { public static void isNotConnection() { isHomeLoaded(); - try{ + try { //Hacemos falla al proposito para indicar que el LBl de conexion ya no esta. // Indicando que la conexion desaparecio boolean flag = MobileActionManager.getElement(HomeConstants.LBL_CONNECTIOS).isDisplayed(); @@ -94,4 +89,7 @@ public static void clicHomeButton() { MobileActionManager.waitClickable(HomeConstants.HOME_BUTTON).click(); } + public static void clicClosesBtnInHome() { + MobileActionManager.waitClickable(HomeConstants.BTN_CLOSES_APP).click(); + } } diff --git a/src/main/java/com/crowdar/tella/services/ServersService.java b/src/main/java/com/crowdar/tella/services/ServersService.java index 0182c49..b86e8e4 100644 --- a/src/main/java/com/crowdar/tella/services/ServersService.java +++ b/src/main/java/com/crowdar/tella/services/ServersService.java @@ -218,29 +218,22 @@ public static void googleDrive() { } - public static void clicNextBtn() { - //Como el boton esta abajo de la pantalla, tenemos q escroliar hasta el final - // por ello utilizamos PointerInput para simular el movimiento del dedo - AndroidDriver driver = (AndroidDriver) GenericService.getDriver(); - - Dimension size = driver.manage().window().getSize(); - int width = size.width / 2; - - // Cambiar: empezar desde abajo y mover hacia arriba - int startY = (int) (size.height * 0.70); // más abajo - int endY = (int) (size.height * 0.30); // más arriba + WebElement botonOK = scrollAndroid("text", "OK", 0); + MobileActionManager.waitPresence(FilesConstants.NEXT_BTN).click(); - PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger"); - Sequence swipe = new Sequence(finger, 1); - swipe.addAction(finger.createPointerMove(Duration.ZERO, PointerInput.Origin.viewport(), width, startY)); - swipe.addAction(finger.createPointerDown(PointerInput.MouseButton.LEFT.asArg())); - swipe.addAction(finger.createPointerMove(Duration.ofMillis(300), PointerInput.Origin.viewport(), width, endY)); - swipe.addAction(finger.createPointerUp(PointerInput.MouseButton.LEFT.asArg())); - driver.perform(List.of(swipe)); + } - MobileActionManager.waitPresence(FilesConstants.NEXT_BTN).click(); + private static WebElement scrollAndroid(String locatorType, String locatorValue, int index) { + String locator = String.format( + "new UiScrollable(new UiSelector().scrollable(true).instance(0))" + + ".setAsVerticalList()" + + ".scrollForward()" + + ".scrollIntoView(new UiSelector().%s(\"%s\").instance(%d))", + locatorType, locatorValue, index + ); + return DriverManager.getDriverInstance().findElement(MobileBy.AndroidUIAutomator(locator)); } -} \ No newline at end of file +} diff --git a/src/main/java/com/crowdar/tella/services/UnlockService.java b/src/main/java/com/crowdar/tella/services/UnlockService.java index d50df65..04af239 100644 --- a/src/main/java/com/crowdar/tella/services/UnlockService.java +++ b/src/main/java/com/crowdar/tella/services/UnlockService.java @@ -57,8 +57,7 @@ public static void setPassword(String password) { public static void enterPassword(String password) throws InterruptedException { if (MobileActionManager.isAndroid()) { MobileActionManager.setInput(LockUnlockConstants.PASSWORD_INPUT, password); - EventFiringWebDriver driver = DriverManager.getDriverInstance(); - driver.getKeyboard().sendKeys(Keys.ENTER); + MobileActionManager.waitClickable(LockUnlockConstants.BTN_UNLOCK).click(); } else { Thread.sleep(1000); MobileActionManager.waitVisibility(LockUnlockConstantsIOS.PASSWORD_INPUT); @@ -201,8 +200,6 @@ public static void reopenTheApp() throws InterruptedException { driver.activateApp("org.hzontal.tella"); } else { driver.activateApp("org.wearehorizontal.tella"); // Usa el package name de tu app para traerla de vuelta al frente - - } } } diff --git a/src/main/java/com/crowdar/tella/steps/HomeSteps.java b/src/main/java/com/crowdar/tella/steps/HomeSteps.java index 874ab93..30df9e5 100644 --- a/src/main/java/com/crowdar/tella/steps/HomeSteps.java +++ b/src/main/java/com/crowdar/tella/steps/HomeSteps.java @@ -22,4 +22,6 @@ public void theUserOpensTheAppForTheFirstTime() { public void seesThatTheFilesHaveBeenDeleted() { System.out.println(""); } + + } diff --git a/src/main/java/com/crowdar/tella/steps/SettingsSteps.java b/src/main/java/com/crowdar/tella/steps/SettingsSteps.java index 66ac9cd..3709413 100644 --- a/src/main/java/com/crowdar/tella/steps/SettingsSteps.java +++ b/src/main/java/com/crowdar/tella/steps/SettingsSteps.java @@ -328,4 +328,22 @@ public void theUserHasAlreadyConnectedToTheTellaWebServer() { public void theUserIsNoLongerConnectedToTheTellaWebServer() { HomeService.isNotConnection(); } + + @And("the user closes and reopens the Tella app") + public void theUserClosesTheTellaApplicationFromTheCloseButton() throws InterruptedException { + SettingsService.goToHomeFromSecurityPage(); + HomeService.isHomeLoaded(); + HomeService.clicClosesBtnInHome(); + Thread.sleep(2000); + GenericService.openAppTella(); + } + + @Then("the app displays the {string} screen to the user") + public void theAppDisplaysTheScreenToTheUser(String arg0) { + GenericService.openAppTella(); + UnlockService.isViewLoaded(); + UnlockService.setPassword(PropertyManager.getProperty("password")); + UnlockService.goTella(); + HomeService.isHomeLoaded(); + } } diff --git a/src/test/resources/features/Audio/Audio.feature b/src/test/resources/features/Audio/Audio.feature index 7d2452e..f68a441 100644 --- a/src/test/resources/features/Audio/Audio.feature +++ b/src/test/resources/features/Audio/Audio.feature @@ -4,7 +4,7 @@ Feature: Audio Background: Given the user is in Tella home page - @Smoke @Automated #@ok + @Smoke @Automated #@TestAngi #paso en BS Scenario Outline: Record an audio file When the user press the Rec option And the user press the microphone @@ -15,7 +15,7 @@ Feature: Audio | message_title | | The audio recording was saved to your Tella files | - @Smoke @Automated #@ok + @Smoke @Automated #@TestAngi Scenario Outline: Record an audio file in two parts When the user press the Rec option And the user press the microphone @@ -28,7 +28,7 @@ Feature: Audio | message_title | | The audio recording was saved to your Tella files | - @Smoke @Automated + @Smoke @Automated #@TestAngi Scenario Outline: Rename an audio file When the user press the Rec option And the user press the pencil icon @@ -41,7 +41,7 @@ Feature: Audio | recording_name | | Audio1 | - @Smoke @Automated + @Smoke @Automated #@TestAngi Scenario Outline: Rename an audio file during the recording When the user press the Rec option And the user press the microphone diff --git a/src/test/resources/features/Settings/Security.feature b/src/test/resources/features/Settings/Security.feature index 842ed7d..e40e982 100644 --- a/src/test/resources/features/Settings/Security.feature +++ b/src/test/resources/features/Settings/Security.feature @@ -33,7 +33,7 @@ Feature: Security And taps "next" button Then "Your lock has been changed" message is shown - @Smoke @SmokeManual @LockTimeout @LockFlow #@TestAngi + @Smoke @SmokeManual @LockTimeout @LockFlow @Automated @TestAngi Scenario Outline: Security - Lock Timeout Given the user sets the app lock timeout to When the user leaves the app, waits for the configured time , and returns @@ -43,11 +43,11 @@ Feature: Security | timeout | | Immediately | | 1 minute | - | 5 minutes | + #| 5 minutes | #| 30 minutes | #| 1 hour | - @Smoke @LockTimeout @Automated #@TestAngi + @Smoke @LockTimeout @Automated @TestAngi Scenario Outline: Security - Change Lock Timeout When the user clicks the "Lock Timeout" option And select timeout option @@ -62,7 +62,7 @@ Feature: Security #| 30 minutes | #| 1 hour | - @Smoke @LockTimeout @Automated #@TestAngi + @Smoke @LockOnDeviceScreenOff @Automated @TestAngi Scenario Outline: Security - Lock on Device Screen Off Given the user sets the app lock timeout to When the user locks the device screen, waits for the configured time , and unlocks it @@ -76,15 +76,17 @@ Feature: Security #| 30 minutes | #| 1 hour | - @Smoke @DeleteAfterFailedUnlock @SmokeManual + @Smoke @DeleteAfterFailedUnlock @SmokeManual @E2E #@TestAngi Scenario Outline: Security - Delete after failed unlock + Given the user records an audio file When the user clicks the "Delete after failed unlock" option And select attempts option And taps "OK" button And the sucessfull message is displayed - And the user close the app + And the user closes and reopens the Tella app And the user set incorrect in - Then sees that the files have been deleted + Then the app displays the "Get started" screen to the user + And that files were deleted Examples: | attempts | PIN | message | @@ -92,7 +94,7 @@ Feature: Security #| 10 attempts | 123451 | Your Tella data will be deleted after 10 failed unlock attempts | #| 20 attempts | 123450 | Your Tella data will be deleted after 20 failed unlock attempts | - @Smoke @DeleteAfterFailedUnlock @Automated + @Smoke @DeleteAfterFailedUnlock @Automated @LockFlow @TestAngi Scenario Outline: Security - Delete after failed unlock When the user clicks the "Delete after failed unlock" option And select attempts option @@ -104,8 +106,8 @@ Feature: Security | attempts | status | message | | Off (do not delete data) | Off | | | 5 attempts | On | Your Tella data will be deleted after 5 failed unlock attempts | - | 10 attempts | On | Your Tella data will be deleted after 10 failed unlock attempts | - | 20 attempts | On | Your Tella data will be deleted after 20 failed unlock attempts | + #| 10 attempts | On | Your Tella data will be deleted after 10 failed unlock attempts | + #| 20 attempts | On | Your Tella data will be deleted after 20 failed unlock attempts | @Smoke @Camouflage @SmokeManual Scenario Outline: Security - camouflage - change camuflaje method - change name and icon @@ -141,7 +143,7 @@ Feature: Security | Calculator_3 | Please wait. You will return to your device's home screen in a few seconds. | | Calculator_4 | Please wait. You will return to your device's home screen in a few seconds. | - @Smoke @QuickDelete @SmokeManual #@TestAngi #Ok # Prueba E2E, de crear un archivo y eliminarlo + @Smoke @QuickDelete @SmokeManual @Automated #@TestAngi @E2E Scenario: Security - Quick delete - Delete files Given the user records an audio file When toggle the switch on the "Quick delete" option @@ -156,7 +158,7 @@ Feature: Security Then that files were deleted - @Smoke @QuickDelete @SmokeManual @TestAngi @E2E #Ok # Prueba E2E, de eliminar conexion + @Smoke @QuickDelete @SmokeManual @Automated @E2E #@TestAngi Scenario: Security - Quick delete - Delete connection to the server Given The user has already connected to the Tella web server When toggle the switch on the "Quick delete" option @@ -169,14 +171,14 @@ Feature: Security And set security code valid Then The user is no longer connected to the Tella web server. - @Smoke @QuickDelete @SmokeManual #@TestAngi #Ok #Validamos que este el Slider para eliminar. + @Smoke @QuickDelete @SmokeManual @Automated @TestAngi Scenario: Security - Quick delete - Verify slide Delete When toggle the switch on the "Quick delete" option And Go to the Tella homepage from Security Page Then verify slide "DELETE" button is present - @Smoke @QuickDelete @SmokeManual #Ok #En la APP no esta el check para eliminar la APP + @Smoke @QuickDelete @SmokeManual #En la APP no esta el check para eliminar la APP Scenario: Security - Quick delete - Delete Tella When toggle the switch on the "Quick delete" option And select check box “Delete Tella” @@ -187,7 +189,7 @@ Feature: Security And waits finish counter Then uninstall message appears - #@Smoke @QuickDelete @Automated #@TestAngi #Ok + @Smoke @QuickDelete @HelpInfo @Automated @TestAngi Scenario Outline: Security - Quick delete - Help info When toggle the switch on the "Quick delete" option And click on the help icon in @@ -262,8 +264,8 @@ Feature: Security | timeout | | Immediately | | 1 minute | - | 5 minutes | - | 30 minutes | + #| 5 minutes | + #| 30 minutes | #| 1 hour | @@ -331,7 +333,7 @@ Feature: Security | Calculator_3 | Please wait. You will return to your device's home screen in a few seconds. | | Calculator_4 | Please wait. You will return to your device's home screen in a few seconds. | - @Smoke @QuickDelete @SmokeManual #RepetidoEscenarioEstaMasArriba + @Smoke @QuickDelete @SmokeManual #RepetidoEscenarioDeletefiles Scenario Outline: Security - Quick delete - When taps switch in "Quick delete" option And select check box "" @@ -350,7 +352,8 @@ Feature: Security | Delete files | | Delete draft and submitted forms | | Delete server settings | -#RepetidoEscenarioEstaMasArriba + +#RepetidoEscenarioEstaMasArribaDeleteTella Scenario: Security - Quick delete - Delete Tella When taps switch in "Quick delete" option And select check box “Delete Tella” @@ -362,7 +365,7 @@ Feature: Security And view closed the Tella application Then view uninstall message - #RepetidoEscenarioEstaMasArriba + #EscenaioRepetidoCon@HelpInfo @Smoke @QuickDelete @ToBeAutomated @Bug Scenario Outline: Security - Quick delete - help info When taps switch in "Quick delete" option