-
Notifications
You must be signed in to change notification settings - Fork 554
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
Fixes part of #973: Fixed DialogBox test in AdministratorControlActivityTest #1011
Fixes part of #973: Fixed DialogBox test in AdministratorControlActivityTest #1011
Conversation
@rt4914 The currently written test of DialogBox works well with roboelectric, but when I try to run the same test in espresso it gives dependency errors. From what I have concluded is that things like alertDialog, Navigation bar will not work with espresso apis in roboelectric, please refer this |
@veena14cs This PR is related to Roboelectric test case in which the author is testing the alert dialog box and he is facing issues with that as mentioned above. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This is working fine in roboelectric but @rt4914 I just want to clarify whether we are not going to check this in expresso. Because in express this import gives error saying org.robolectric.shadows.ShadowDialog.getLatestDialog
is unresolved. Are we suppose to ignore this?
@veena14cs Actually thats the main point, the test case should pass in both espresso as well as roboelectic and the author is stuck on making it possible in this PR. |
@abhinavraj23 can you try without using Shadows. Try writing testcase for AlerDialog instead of using |
@veena14cs I have tried various things but it seems like we cannot test AlertDialog without shadows in Roboelectric. Please let me know if you find something or what should the next step. |
Even I am stuck on this. I will try several things and update you. @abhinavraj23 you can pick some other issue and will get back to you on this. |
@abhinavraj23 Did you try putting delay after click on logout button in test? |
@anandwana001 I tried adding delay but it didn't work. But adding LooperMode annotation did work that you mentioned in this comment #973 (comment) |
@abhinavraj23 please check this above comment and test this PR. You can remove shadowDialog and revert the testcase. Add annotation dependency for LooperMode and use it in this test. Also check other testcases in this file which are using alertdialog. Once you are done assign me back. |
Closing this PR as there has been no updates on this PR from contributor. |
Explanation
Fixes part of #973: The currently written tests will pass in roboelectric
Checklist