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

Add Unit Test for logging into app #410

Open
Sheeri opened this issue Oct 15, 2020 · 0 comments
Open

Add Unit Test for logging into app #410

Sheeri opened this issue Oct 15, 2020 · 0 comments
Labels

Comments

@Sheeri
Copy link
Collaborator

Sheeri commented Oct 15, 2020

Is your feature request related to a problem? Please describe.
We would like to start adding unit tests for components in our app.

Describe the solution you'd like:
Add gradle or fastlane tests to test logging into the app.

How to test the tests:
Build with a nonexistent realm-app-id (e.g. realm-app-id=abcd). It will build with no problems, but when attempting to login, the user sees "Invalid username and password" and the output shows:

D/Login: Cannot log in. Error cannot find app using Client App ID 'abcd'

Build with the sandbox realm-app-id and login. When attempting to login, it works,

D/REALM_JAVA: HTTP Request = 
    POST https://realm.mongodb.com/api/client/v2.0/app/REALM-APP-ID/auth/providers/local-userpass/login
    Accept: application/json
    Content-Type: application/json;charset=utf-8
    {"password":"***","provider":"local-userpass","username":"***","options":{"device":{"appVersion":"1","appId":"REALM-APP-ID","platform":"android","platformVersion":"9","sdkVersion":"10.0.0-BETA.6"}}}

Additional Context:
Our app/build.gradle includes testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant