Search code examples
androidtravis-ciandroid-uiautomator

uiautomator - button is not getting selected


I have the following piece of code in my test:

    device.findObject(By.text("Widgets")).click();
    device.wait(Until.hasObject(By.text("Widgets").selected(true)), LAUNCH_TIMEOUT);
    device.waitForIdle(LAUNCH_TIMEOUT);
    assertTrue("Widgets button is selected after the click",
               device.findObject(By.text("Widgets")).isSelected());

Where "Widgets" is the component of TabWidget. This works when I run it on emulator on my computer, but assertion fails when the test is performed on Travis. Here's the link to the failed build: https://travis-ci.org/aragaer/jtt_android/builds/239115606

How do I fix that?


Solution

  • It appears that it is the problem that I have already encountered two years ago - Disabling first-run greeter on fresh android emulator

    The combination of and hinted me that it was something I've encountered earlier.