38 lines
1.2 KiB
Kotlin
38 lines
1.2 KiB
Kotlin
package pl.edu.amu.wmi.socialaggregator
|
|
|
|
import androidx.test.espresso.Espresso.onView
|
|
import androidx.test.espresso.action.ViewActions.click
|
|
import androidx.test.espresso.intent.Intents.intended
|
|
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
|
|
import androidx.test.espresso.intent.rule.IntentsTestRule
|
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
import org.junit.Rule
|
|
import org.junit.Test
|
|
import org.junit.runner.RunWith
|
|
import pl.edu.amu.wmi.socialaggregator.activity.AddSocialActivity
|
|
import pl.edu.amu.wmi.socialaggregator.activity.MainActivity
|
|
import pl.edu.amu.wmi.socialaggregator.activity.NewPostActivity
|
|
|
|
@RunWith(AndroidJUnit4::class)
|
|
class MainActivityTest {
|
|
|
|
@Rule
|
|
@JvmField
|
|
val activity = IntentsTestRule(MainActivity::class.java)
|
|
|
|
@Test
|
|
fun clickAddNewSocial_shouldOpenAddNewSocialActivity() {
|
|
onView(withId(R.id.connectedSocialsButton)).perform(click())
|
|
|
|
intended(hasComponent(AddSocialActivity::class.java.name))
|
|
}
|
|
|
|
@Test
|
|
fun clickCreatePost_shouldOpenAddNewNewPostActivity() {
|
|
onView(withId(R.id.createPostButton)).perform(click())
|
|
|
|
intended(hasComponent(NewPostActivity::class.java.name))
|
|
}
|
|
|
|
} |