Skip to content

Commit

Permalink
make ui test
Browse files Browse the repository at this point in the history
  • Loading branch information
mokhtarmoustafa committed Jan 1, 2024
1 parent 121711c commit 329c585
Showing 1 changed file with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()))
}
}
}

0 comments on commit 329c585

Please sign in to comment.