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
UI Testing with Espresso for Authorization Request and Response of Intents #492
Comments
Hi @davenotdavid, |
@tobi512 could you please share the working test setup? |
Hey @ishaan-khan |
Hi @tobi512 |
Hey @ishaan-khan LoginUiTest.kt
Following dependencies were added for it in the build.gradle:
|
Current environment including, but not limited to:
With the following code snippets, I've been trying to use Espresso (
UiAutomator
for automatically filling in the user input fields) for testing out the login auth flow where logging in occurs externally via a custom Chrome Tab intent with a successful login taking the user back to the app via the launching Activity'sonActivityResult()
callback to then run some logic afterwards (asserting that the screen really changed by validating that the next screen's views are being displayed in this case). But it turns out that the app isn't resumed properly after logging in which later throws aNoActivityResumedException
.And yes, I've tried using Espresso Intents, but couldn't figure out how to tie it in this scenario since I'm going as far as testing the overall login flow within the login screen as the
ActivityTestRule
, particularly triggering its own intent (auth request) after the login button is pressed. I feel like I'm on the right track so far, so any help would be appreciated on pointing me to the right direction!Login screen:
Helper auth functions:
Espresso UI test:
... but
LoginActivity
is not resumed as shown here in the logs (prior to aNoActivityResumedException
):The text was updated successfully, but these errors were encountered: