diff --git a/app/build.gradle b/app/build.gradle index 0e638d4..83c98f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ plugins { android { namespace 'com.example.anotoapp' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.example.anotoapp" @@ -38,17 +38,16 @@ android { } dependencies { - var nav_version = "2.5.3" + var nav_version = "2.7.6" - implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.5.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'com.google.android.material:material:1.11.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test.ext:junit:1.1.3' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' - - implementation "androidx.core:core-splashscreen:1.0.0" + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' + implementation "androidx.core:core-splashscreen:1.0.1" implementation("androidx.navigation:navigation-fragment-ktx:$nav_version") implementation("androidx.navigation:navigation-ui-ktx:$nav_version") } \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/anotoapp/MainActivityBottomNavigationTest.kt b/app/src/androidTest/java/com/example/anotoapp/MainActivityBottomNavigationTest.kt new file mode 100644 index 0000000..4930475 --- /dev/null +++ b/app/src/androidTest/java/com/example/anotoapp/MainActivityBottomNavigationTest.kt @@ -0,0 +1,50 @@ +package com.example.anotoapp + +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.ext.junit.rules.ActivityScenarioRule +import kotlinx.coroutines.delay +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.withContext +import org.junit.Rule +import org.junit.Test + + +class MainActivityBottomNavigationTest { + + @get:Rule + var activityRule = ActivityScenarioRule( + MainActivity::class.java + ) + + @Test + fun testBottomNavigation() { + runBlocking { + + delay(2000) + onView(withId(R.id.frameLayout)).check(matches(isDisplayed())) + + // home + onView(withId(R.id.home)) + .perform(click()) + delay(1000) + + //task + onView(withId(R.id.frameLayout)).check(matches(isDisplayed())) + onView(withId(R.id.task)) + .perform(click()) + delay(1000) + + //profile + onView(withId(R.id.frameLayout)).check(matches(isDisplayed())) + onView(withId(R.id.profile)) + .perform(click()) + delay(1000) + + onView(withId(R.id.frameLayout)).check(matches(isDisplayed())) + } + } +} \ No newline at end of file