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

Fixes part of #973: Fixed DialogBox test in AdministratorControlActivityTest #1011

Conversation

abhinavraj23
Copy link
Contributor

@abhinavraj23 abhinavraj23 commented Apr 22, 2020

Explanation

Fixes part of #973: The currently written tests will pass in roboelectric

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@abhinavraj23 abhinavraj23 requested a review from rt4914 April 22, 2020 20:10
@abhinavraj23
Copy link
Contributor Author

@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
article

@abhinavraj23 abhinavraj23 changed the title Fixes part of #973:Fixed dialog test in AdministratorControlActivityTest Fixes part of #973: Fixed DialogBox test in AdministratorControlActivityTest Apr 22, 2020
@rt4914
Copy link
Contributor

rt4914 commented Apr 23, 2020

@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
article

@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.

Copy link
Contributor

@veena14cs veena14cs left a 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 veena14cs removed their assignment Apr 23, 2020
@rt4914
Copy link
Contributor

rt4914 commented Apr 23, 2020

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.

@rt4914 rt4914 assigned veena14cs and unassigned rt4914 Apr 23, 2020
@veena14cs
Copy link
Contributor

@abhinavraj23 can you try without using Shadows. Try writing testcase for AlerDialog instead of using ShadowDialog.getLatestDialog

@veena14cs veena14cs assigned abhinavraj23 and unassigned veena14cs Apr 24, 2020
@abhinavraj23
Copy link
Contributor Author

@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.

@veena14cs
Copy link
Contributor

veena14cs commented Apr 27, 2020

@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.

@anandwana001
Copy link
Contributor

@abhinavraj23 Did you try putting delay after click on logout button in test?

@veena14cs
Copy link
Contributor

veena14cs commented May 22, 2020

@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)

@veena14cs
Copy link
Contributor

@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.

@veena14cs veena14cs removed their assignment May 22, 2020
@rt4914
Copy link
Contributor

rt4914 commented Jun 12, 2020

Closing this PR as there has been no updates on this PR from contributor.

@rt4914 rt4914 closed this Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants