-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from webex/migrate-v2-to-v3
Migrate v2 to v3
- Loading branch information
Showing
314 changed files
with
23,377 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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,86 @@ | ||
import com.ciscowebex.androidsdk.build.* | ||
|
||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'kotlin-kapt' | ||
apply plugin: 'com.google.gms.google-services' // Google Services plugin | ||
apply plugin: 'com.google.firebase.crashlytics' // Crashlytics Gradle plugin | ||
|
||
android { | ||
compileSdkVersion Versions.compileSdk | ||
buildToolsVersion Versions.buildTools | ||
ndkVersion project.hasProperty("ndkVersion") ? project.property('ndkVersion') : Versions.ndkVersion | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8 | ||
} | ||
defaultConfig { | ||
applicationId "com.cisco.sdk_android" | ||
minSdkVersion Versions.minSdk | ||
targetSdkVersion Versions.targetSdk | ||
versionCode 30001 | ||
versionName "3.0.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
buildConfigField "String", "CLIENT_ID", "${CLIENT_ID}" | ||
buildConfigField "String", "CLIENT_SECRET", "${CLIENT_SECRET}" | ||
buildConfigField "String", "REDIRECT_URI", "${REDIRECT_URI}" | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" | ||
} | ||
} | ||
buildFeatures { | ||
dataBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation 'com.ciscowebex:androidsdk:3.0.0@aar' | ||
|
||
implementation fileTree(dir: "libs", include: ["*.jar"]) | ||
implementation Dependencies.kotlinStdLib | ||
implementation Dependencies.coreKtx | ||
implementation Dependencies.appCompat | ||
implementation Dependencies.constraintLayout | ||
implementation Dependencies.material | ||
implementation Dependencies.recyclerview | ||
implementation Dependencies.cardview | ||
implementation Dependencies.viewpager2 | ||
implementation Dependencies.koin | ||
implementation Dependencies.koinViewModel | ||
implementation Dependencies.swiperefresh | ||
implementation Dependencies.media | ||
implementation Dependencies.nimbusJosh | ||
|
||
// RXJAVA | ||
implementation Dependencies.rxjava | ||
implementation Dependencies.rxandroid | ||
implementation Dependencies.rxkotlin | ||
|
||
testImplementation Dependencies.Test.junit | ||
androidTestImplementation Dependencies.Test.androidxJunit | ||
androidTestImplementation Dependencies.Test.espressoCore | ||
androidTestImplementation Dependencies.Test.espressoContrib | ||
androidTestImplementation Dependencies.Test.espressoWeb | ||
androidTestImplementation Dependencies.Test.espressoIntents | ||
androidTestImplementation Dependencies.Test.rules | ||
androidTestImplementation Dependencies.Test.testExt | ||
debugImplementation (Dependencies.Test.fragmentScenerio) { | ||
exclude group: 'androidx.test', module: 'monitor' | ||
} | ||
implementation platform(Dependencies.firebaseBom) | ||
implementation Dependencies.firebaseMessaging | ||
implementation Dependencies.firebaseAnalytics | ||
implementation Dependencies.firebaseCrashlytics | ||
implementation Dependencies.gson | ||
|
||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
105 changes: 105 additions & 0 deletions
105
app/src/androidTest/java/com/ciscowebex/androidsdk/kitchensink/HomeActivityTest.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package com.ciscowebex.androidsdk.kitchensink | ||
|
||
import android.content.Intent | ||
import android.net.Uri | ||
import android.view.View | ||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.intent.Intents.intended | ||
import androidx.test.espresso.intent.matcher.IntentMatchers.* | ||
import androidx.test.espresso.matcher.RootMatchers.isDialog | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.rule.GrantPermissionRule | ||
import com.ciscowebex.androidsdk.kitchensink.calling.CallActivity | ||
import com.ciscowebex.androidsdk.kitchensink.messaging.MessagingActivity | ||
import com.ciscowebex.androidsdk.kitchensink.search.SearchActivity | ||
import com.ciscowebex.androidsdk.kitchensink.utils.WaitUtils | ||
import org.hamcrest.Matchers.* | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import java.util.concurrent.TimeUnit | ||
|
||
|
||
class HomeActivityTest : KitchenSinkTest() { | ||
|
||
@Rule @JvmField | ||
val grantPermissionRule: GrantPermissionRule = GrantPermissionRule.grant( | ||
android.Manifest.permission.CAMERA, | ||
android.Manifest.permission.RECORD_AUDIO, | ||
android.Manifest.permission.READ_PHONE_STATE | ||
) | ||
|
||
@Before | ||
override fun initTests() { | ||
super.initTests() | ||
setUpLogin() | ||
} | ||
|
||
@Test | ||
fun testInitiateCallButton_homeActivity() { | ||
clickOnView(R.id.iv_startCall) | ||
intended(hasComponent(SearchActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun testWaitingCallButton_homeActivity() { | ||
clickOnView(R.id.iv_waitingCall) | ||
intended(hasComponent(CallActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun testFeedbackButton_homeActivity() { | ||
clickOnView(R.id.iv_feedback) | ||
val subject = targetContext.getString(R.string.feedbackLogsSubject) | ||
|
||
val expectedIntent = allOf( | ||
hasAction(Intent.ACTION_CHOOSER), | ||
hasExtra( | ||
equalTo(Intent.EXTRA_INTENT), | ||
allOf( | ||
hasAction(Intent.ACTION_SENDTO), | ||
hasData(Uri.parse("mailto:")), | ||
hasExtra( | ||
`is`(Intent.EXTRA_SUBJECT), | ||
`is`(subject) | ||
) | ||
) | ||
) | ||
) | ||
|
||
intended(expectedIntent) | ||
|
||
} | ||
|
||
@Test | ||
fun testLogoutButton_homeActivity() { | ||
clickOnView(R.id.iv_logout) | ||
assertViewDisplayed(R.id.progressLayout) | ||
WaitUtils.waitForCondition( | ||
60, TimeUnit.SECONDS, | ||
{ | ||
val rootLoginActivity = getActivity()?.findViewById<View>(R.id.rootLoginActivity) | ||
rootLoginActivity != null | ||
}, | ||
{ | ||
"$TAG:: Not able to find rootLoginActivity" | ||
} | ||
) | ||
} | ||
|
||
@Test | ||
fun testMessageButton_homeActivity() { | ||
clickOnView(R.id.iv_messaging) | ||
intended(hasComponent(MessagingActivity::class.java.name)) | ||
} | ||
|
||
@Test | ||
fun testGetMeButton_homeActivity() { | ||
clickOnView(R.id.iv_getMe) | ||
onView(withId(R.id.dialogOk)) | ||
.inRoot(isDialog()) | ||
.check(matches(isDisplayed())) | ||
} | ||
} |
Oops, something went wrong.