I'm writing an instrumented unit test for my android application that verifies the state of the UI (correct message displayed etc.) after pressing a button. When the phone is locked and I run the instrumented unit test, it fails. However, when I unlock the phone and run the instrumented unit test then it passes.
From the output of the failed test, it looks like the test is not waiting for the buttons onclick code to finish before running the next lines of the test.
Here's the test:
setActivityInitialTouchMode(true);
MainActivity mainActivity = startActivityWithGivenUri(sqrlUri);
View denySiteButton = mainActivity.findViewById(R.id.DenySiteButton);
TouchUtils.clickView(this, denySiteButton);
assertTapToProceedMessageShownAndConfirmDenyButtonsNotVisible(mainActivity);
Any ideas what's going on and how to fix it?
Aucun commentaire:
Enregistrer un commentaire