anandmeher / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Solo waitForDialogToOpen() continues on shown toast message #667

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Implement an an activity that open a toast and a DialogFragment somewhat 
later, i.e.
   a) create and show a Toast message: Toast.makeText(this, getString(...), Toast.LENGTH_SHORT).show();
   b) create a DialogFragment and invoke show()
2. solo.waitForDialogToOpen();
3. have a test case, that waits for the dialog to open: 
solo.waitForDialogToOpen();

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

Expectation is, that the Toast message is ignored and the test case continues 
after the dialog has been opened.

Instead, the test case implementation continues once the Toast message is being 
shown. Allegedly the Toast message is handled as a dialog.

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

This refers to Robotium 5.2.1 and 5.3.1, and was reproducible on a Galaxy SIII 
(Android 4.1.2) as well as on a Samsung Alpha (Android 4.4.4). 

Please provide any additional information below.

I'm using Android Studio 1.0.2 on openSUSE 13.1 Linux

Original issue reported on code.google.com by heuner.a...@googlemail.com on 12 Mar 2015 at 10:59

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. Unfortunately there is no way to know of a dialog is 
shown or not. The only thing we can check if another window is above the bottom 
one. Unfortunately a toast will trigger this.  

Original comment by renasr...@gmail.com on 18 Mar 2015 at 4:50