Android Open Source - verival-uiautomator Test04_call Emergency Numbers






From Project

Back to project page verival-uiautomator.

License

The source code is released under:

GNU General Public License

If you think the Android project verival-uiautomator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package br.unb.vvs.uiautomator;
/* ww w .  j a va  2  s  . c  o m*/
//Device used to implement this test: Samsung Galaxy S3- Android version 4.3, CyanogenMod
//Import the uiautomator libraries
import com.android.uiautomator.core.UiObject;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import com.android.uiautomator.testrunner.UiAutomatorTestCase;

public class Test04_callEmergencyNumbers extends UiAutomatorTestCase {
  public void setUp() {
    String output = "\nTest " + this.getName().substring(4) + "() ";
    System.out.println(output);
    // Simulate a short press on the HOME button.
    // getUiDevice().pressHome();
  }

  public void callEmergencyNumbersTest() throws UiObjectNotFoundException {

    UiObject emergencyCall = new UiObject(
        new UiSelector().text("CHAMADA DE EMERGNCIA"));

    emergencyCall.click();

    UiObject zero = new UiObject(new UiSelector().description("zero"));
    UiObject one = new UiObject(new UiSelector().description("um"));
    UiObject two = new UiObject(new UiSelector().description("dois"));
    UiObject nine = new UiObject(new UiSelector().description("nove"));

    // Calling the police
    one.click();
    nine.click();
    zero.click();

    UiObject call = new UiObject(new UiSelector().description("discar"));
    call.click();

    // Finishing the call
    UiObject endCall = new UiObject(
        new UiSelector().description("Finalizar"));
    endCall.click();

    // Simulate a short press on the HOME button.
    // getUiDevice().pressHome();

    emergencyCall.click();

    // Calling the fireman
    one.click();
    nine.click();
    two.click();
    call.click();

    // Finishing the call
    endCall.click();

  }

}




Java Source Code List

br.unb.vvs.uiautomator.StringGetter.java
br.unb.vvs.uiautomator.Test01_20minutesCall.java
br.unb.vvs.uiautomator.Test02_40SequencedCalls.java
br.unb.vvs.uiautomator.Test04_callEmergencyNumbers.java
br.unb.vvs.uiautomator.Test05_TurnOnOffAdapters.java
br.unb.vvs.uiautomator.Test06_Send100TextMessage.java
br.unb.vvs.uiautomator.Test07_SendVerifyEmail.java
br.unb.vvs.uiautomator.Test08_Add1000NewContacts.java