Skip to content

Commit fabcdea

Browse files
mnoman09thomaszurkan-optimizely
authored andcommitted
Fixed IdleTimeoutException error which occured on running testApp unitTest on android version 8.1.0. (#16) (#174)
1 parent 86cd0e5 commit fabcdea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test-app/src/androidTest/java/com/optimizely/ab/android/test_app/MainActivityEspressoTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.content.Intent;
2222
import android.support.test.InstrumentationRegistry;
2323
import android.support.test.espresso.Espresso;
24+
import android.support.test.espresso.IdlingPolicies;
2425
import android.support.test.espresso.idling.CountingIdlingResource;
2526
import android.support.test.filters.LargeTest;
2627
import android.support.test.rule.ActivityTestRule;
@@ -162,6 +163,9 @@ protected void after() {
162163

163164
@Test
164165
public void experimentActivationForWhitelistUser() throws Exception {
166+
IdlingPolicies.setMasterPolicyTimeout(3, TimeUnit.MINUTES);
167+
IdlingPolicies.setIdlingResourceTimeout(3, TimeUnit.MINUTES);
168+
165169
// Check that the text was changed.
166170
// These tests are pointed at a real project.
167171
// The user 'test_user` is in the whitelist for variation_a for experiment background_experiment

0 commit comments

Comments
 (0)