Pradap Pandian
Pradap Pandian

Reputation: 406

Espresso test is not finishing and it keeps on finding element when there is an issue in the application

I have the espresso test. When there is any issue in the app the test is not finishing and it keeps on staying on the same screen. Is there anyway we can give timeout for the espresso test. I cant find solution for the global timeout. Junit Android Espresso Test

@Before
public static void beforeClass() {
    IdlingPolicies.setMasterPolicyTimeout(10, TimeUnit.SECONDS);
    IdlingPolicies.setIdlingResourceTimeout(10, TimeUnit.SECONDS);
}

Upvotes: -1

Views: 695

Answers (1)

Nehemias G Miranda
Nehemias G Miranda

Reputation: 91

You could add a timeout rule. E.g. Rule to timeout after 2 minutes

@get:Rule val globalTimeout: Timeout = Timeout.seconds(120)

Upvotes: 2

Related Questions