Skip to content

Commit

Permalink
Merge pull request #25 from webex/migrate-v2-to-v3
Browse files Browse the repository at this point in the history
Migrate v2 to v3
  • Loading branch information
ankibatr authored May 24, 2021
2 parents f8bfd5a + 3c5febb commit 1f92416
Show file tree
Hide file tree
Showing 314 changed files with 23,377 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This demo support Android device with **Android 7.0** or later
## Usage
For example see [README.md](https://github.com/webex/webex-android-sdk/README.md)
For example see [README](https://github.com/webex/webex-android-sdk/blob/master/README.md)
## Note
Expand Down
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
86 changes: 86 additions & 0 deletions app/build.gradle
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

}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
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
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()))
}
}
Loading

0 comments on commit 1f92416

Please sign in to comment.