Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple calls to a helper function containing onData will yield inconsistent results #82

Open
GoogleCodeExporter opened this issue Apr 15, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Created a helper method for performing taps to a button.

public void performFavoritesSelection(int photoIndex, int buttonId) throws 
InterruptedException{
        onData(anything())
                .inAdapterView(withId(android.R.id.list))
                .atPosition(photoIndex)
                .onChildView(withId(buttonId))
                .perform(click());
    }
2. In the test method, call this helper function multiple times.

public void testPickFavorites() throws InterruptedException {
        navigateToPickFavorites(0);
        performFavoritesSelection(0, noButtonId);
        performFavoritesSelection(0, maybeButtonId);
        performFavoritesSelection(0, yesButtonId);

        performFavoritesSelection(1, noButtonId);
        performFavoritesSelection(1, maybeButtonId);
        performFavoritesSelection(1, yesButtonId);
    }

What is the expected output? What do you see instead?

Expected: The test will cycle through all the button selections.
Actual: The results are inconsistent. Sometimes a button will not be selected. 
(e.g. on the device, it will appear as though "performFavoritesSelection(1, 
maybeButtonId);" is not called at times. The results are inconsistent. 
Sometimes, all6 calls are made. There are also times when 5/6 of the above 
calls are made.

What version of the product are you using? On what operating system?

Tested on a Nexus 4 on 4.4.2 and a Galaxy Tab 3 8.0 on 4.2.2

Please provide any additional information below.

None.

Original issue reported on code.google.com by [email protected] on 24 Jun 2014 at 10:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant