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

Check the Intent Key for the AdminPinActivity and AdminAuthActivity in ProfileChooserFragmentTest #2058

Closed
anandwana001 opened this issue Oct 30, 2020 · 4 comments · Fixed by #2247
Assignees
Labels
Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@anandwana001
Copy link
Contributor

anandwana001 commented Oct 30, 2020

Is your feature request related to a problem? Please describe.
Need to test the passing intent key from the ProfileChooserActivity to AdminPinActivity and AdminAuthActivity

Describe the solution you'd like
AdminAuthEnum.PROFILE_ADD_PROFILE - clicking on add profile item, If the admin pin is already set it will open to add profile screen
AdminAuthEnum.PROFILE_ADMIN_CONTROLS - clicking on admin controls item in the profile chooser screen, check If the admin pin is already set it will open the admin controls

@chrk2205
Copy link
Contributor

chrk2205 commented Nov 2, 2020

@anandwana001
where should we write this tests in ProfileChooserFragmentTest or in AdminAuthActivityTest
i see that the test are already present in ProfileChooserFragmentTest but are ignored
testProfileChooserFragment_clickAddProfile_checkOpensAdminAuthActivity_onBackButton_opensProfileChooserFragment

@anandwana001
Copy link
Contributor Author

anandwana001 commented Nov 2, 2020

Once this pr #2045 get's merged, you can get a clear view to work on it. You had mentioned the correct test. But, we are breaking this test into parts and need to put in AdminAuthActivityTest from where we need to check pressing back will satisfy both the conditions mentioned in the issue above.

@FareesHussain
Copy link
Contributor

This can't be done in AdminAuthActivityTest right? as on back press the current activity i.e AdminAuthActivity would be destroyed and the test fails with a message

androidx.test.espresso.NoActivityResumedException: Pressed back and killed the app

May be we need to add tests in ProfileChooserActivity and AdministratorControlsActivity

@anandwana001
Copy link
Contributor Author

@FareesHussain Correct, as in the test we are launching AdminAuthActivityTest standalone, so we cannot move back.
Let's do one thing:
We have two ways to open AdminAuthActivity

  • AdminAuthEnum.PROFILE_ADD_PROFILE - clicking on add profile item, If the admin pin is already set it will open to add profile screen
  • AdminAuthEnum.PROFILE_ADMIN_CONTROLS - clicking on admin controls item in the profile chooser screen check If the admin pin is already set it will open the admin controls

So, could you update the test cases in ProfileChooserFragmentTest to check hasExtras has these required keys or not?
Also, for the AdminPin as well.

@anandwana001 anandwana001 changed the title Add tests for back press in AdminAuthActivityTest Check the Intent Key for the AdminPinActivity and AdminAuthActivity in ProfileChooserFragmentTest Dec 10, 2020
BenHenning pushed a commit that referenced this issue Dec 11, 2020
* Intent Key Checks ProfileChooserFragmentTest.kt

* resolving ktlint checks

* Resolving requested changes

* avoiding max line limit
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Development

Successfully merging a pull request may close this issue.

4 participants