I have a few buttons, on clicking on them i open different dialog fragments. I want to know how to test whether does dialog open ? or if it opens is it of correct type?
Please Help. Thanks in advance.
Well I figure it out by myself. From this very good tutorial by Colin Miller (Sr software engineer @ LinkedIn) i will be able to solve this.
https://www.youtube.com/watch?v=UEklodQTJZY
This question might not be useful but this tutorial is definitely useful.
Solution of this problem is:
button.performClick()
XDialogFragment dialog = (XDialogFragment) activity
.getFragmentManager().findFragmentByTag(XDialogFragment.TAG);
Assert.assertNotNull(dialog);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With