-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate with Firebase and update to AndroidX
Added Crashlytics and Firebase App Distribution. Updated projects from old support libraries to androidx equivalents.
- Loading branch information
Showing
12 changed files
with
116 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "3225927432", | ||
"project_id": "ci-matters-a498c", | ||
"storage_bucket": "ci-matters-a498c.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:3225927432:android:1299f0babc1137e8b2b6bd", | ||
"android_client_info": { | ||
"package_name": "com.vgaidarji.cimatters" | ||
} | ||
}, | ||
"oauth_client": [], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyC-6cjWLUnfo7hd0dXRW_Gd2E_CxUrXOEk" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [] | ||
} | ||
} | ||
}, | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:3225927432:android:10d44974fc042c1eb2b6bd", | ||
"android_client_info": { | ||
"package_name": "com.vgaidarji.cimatters.debug" | ||
} | ||
}, | ||
"oauth_client": [], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyC-6cjWLUnfo7hd0dXRW_Gd2E_CxUrXOEk" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.vgaidarji.cimatters | ||
|
||
import android.support.test.espresso.Espresso | ||
import android.support.test.espresso.action.ViewActions | ||
import android.support.test.espresso.assertion.ViewAssertions | ||
import android.support.test.espresso.matcher.ViewMatchers | ||
import android.support.test.rule.ActivityTestRule | ||
import android.support.test.runner.AndroidJUnit4 | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.action.ViewActions | ||
import androidx.test.espresso.assertion.ViewAssertions | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.espresso.matcher.ViewMatchers.withText | ||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import org.hamcrest.CoreMatchers | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
@@ -14,35 +16,35 @@ import org.junit.runner.RunWith | |
@RunWith(AndroidJUnit4::class) | ||
class LoginActivityTest { | ||
@get:Rule | ||
val activityTestRule = ActivityTestRule( | ||
val activityTestRule = ActivityScenarioRule( | ||
LoginActivity::class.java | ||
) | ||
|
||
@Test | ||
@Throws(Exception::class) | ||
fun onLoginClick_shouldOpenNextActivityForAllowedCredentials() { | ||
Espresso.onView(ViewMatchers.withId(R.id.edit_text_email)) | ||
onView(withId(R.id.edit_text_email)) | ||
.perform(ViewActions.typeText("[email protected]")) | ||
Espresso.onView(ViewMatchers.withId(R.id.edit_text_password)) | ||
onView(withId(R.id.edit_text_password)) | ||
.perform(ViewActions.typeText("1111")) | ||
Espresso.onView(ViewMatchers.withId(R.id.button_login)).perform(ViewActions.click()) | ||
Espresso.onView(ViewMatchers.withText("OK")) | ||
.check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
onView(withId(R.id.button_login)).perform(ViewActions.click()) | ||
onView(withText("OK")) | ||
.check(ViewAssertions.matches(isDisplayed())) | ||
} | ||
|
||
@Test | ||
@Throws(Exception::class) | ||
fun onLoginClick_shouldShowErrorForIncorrectCredentials() { | ||
Espresso.onView(ViewMatchers.withId(R.id.edit_text_email)) | ||
onView(withId(R.id.edit_text_email)) | ||
.perform(ViewActions.typeText("[email protected]")) | ||
Espresso.onView(ViewMatchers.withId(R.id.edit_text_password)) | ||
onView(withId(R.id.edit_text_password)) | ||
.perform(ViewActions.typeText("not_a_password")) | ||
Espresso.onView(ViewMatchers.withId(R.id.button_login)).perform(ViewActions.click()) | ||
Espresso.onView( | ||
onView(withId(R.id.button_login)).perform(ViewActions.click()) | ||
onView( | ||
CoreMatchers.allOf( | ||
ViewMatchers.withId(android.support.design.R.id.snackbar_text), | ||
ViewMatchers.withText("Wrong credentials.") | ||
withId(R.id.snackbar_text), // Update this ID based on your layout | ||
withText("Wrong credentials.") | ||
) | ||
).check(ViewAssertions.matches(ViewMatchers.isDisplayed())) | ||
).check(ViewAssertions.matches(isDisplayed())) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...a/com/vgaidarji/cimatters/MainActivity.kt → ...n/com/vgaidarji/cimatters/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters