android - Monkey UI test on app with login -


i want run ui monkey test utility comes android sdk on app.

the problem first screen in app login screen, , if not successful in screen not allowed see anything.

this way, monkey tests stay in login screen, not being able go past that.

is there solution this?

i faced same problem while testing app espresso. solved creating product flavor in app.gradle this:

    productflavors {         automated_test {             buildconfigfield 'string', 'customflavor', '"automated_test"'         }     } 

now can check example in login activity if running product flavor , skip login process.

if(buildconfig.customflavor.equals("automated_test")) {         this.emailtext.settext(gettext(r.string.automated_test_username));         this.passwordtext.settext(gettext(r.string.automated_test_password));         login(); } 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -