mardi 22 novembre 2016

Greenhouse ci - Instrumentation test run failed to complete Espresso

I am attempting to setup Jenkins for my team's android projects. All of my tests will consistently pass when ran through the IDE; however, through Greenhouse test results vary. The build might pass but most of the time will either fail with a similar message below or the build will seem to run indefinitely.

payment[gh-23(AVD) - 6.0] FAILED java.lang.RuntimeException: Could not launch intent Intent { flg=0x10000000 cmp=com.sixdbytes.client/.ui.activ ities.PrimaryActivity } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amoun t of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1479231282924 and now the last time the queue went idle was: 14792313 24327. If these numbers are the same your activity might be hogging the event queue. at android.support.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:360)

My test class:

@RunWith(AndroidJUnit4.class)
@LargeTest
public class ExploreMenuTest {

private static final String Payment = "Payment";

@Rule
    public ActivityTestRule<PrimaryActivity> pActivityRule = new ActivityTestRule<>(PrimaryActivity.class); 

   @Test
    public void payment() throws InterruptedException {

        check_login();
        onView(withText(Payment)).check(matches(isDisplayed())).perform(click());
        onView(withId(R.id.button_scan_card)).check(matches(isDisplayed()));
    }

How fix this problem?

Aucun commentaire:

Enregistrer un commentaire