Skip to content

Commit e09a540

Browse files
committed
wip
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 6b88a69 commit e09a540

1 file changed

Lines changed: 11 additions & 23 deletions

File tree

app/src/androidTest/java/com/nmc/android/ui/LauncherActivityIT.kt

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,12 @@
66
*/
77
package com.nmc.android.ui
88

9+
import android.view.View
910
import androidx.test.core.app.launchActivity
10-
import androidx.test.espresso.Espresso.onView
11-
import androidx.test.espresso.assertion.ViewAssertions.matches
12-
import androidx.test.espresso.matcher.ViewMatchers
13-
import androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed
14-
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
15-
import androidx.test.espresso.matcher.ViewMatchers.withId
1611
import androidx.test.ext.junit.runners.AndroidJUnit4
1712
import com.owncloud.android.AbstractIT
1813
import com.owncloud.android.R
14+
import org.junit.Assert.assertEquals
1915
import org.junit.Test
2016
import org.junit.runner.RunWith
2117

@@ -24,29 +20,21 @@ class LauncherActivityIT : AbstractIT() {
2420

2521
@Test
2622
fun testSplashScreenWithEmptyTitlesShouldHideTitles() {
27-
launchActivity<LauncherActivity>().use { scenario ->
28-
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
29-
onView(
30-
withId(R.id.splashScreenBold)
31-
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
32-
onView(
33-
withId(R.id.splashScreenNormal)
34-
).check(matches(withEffectiveVisibility(ViewMatchers.Visibility.GONE)))
23+
launchActivity<LauncherActivity>().onActivity { activity ->
24+
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.ivSplash).visibility)
25+
assertEquals(View.GONE, activity.findViewById<View>(R.id.splashScreenBold).visibility)
26+
assertEquals(View.GONE, activity.findViewById<View>(R.id.splashScreenNormal).visibility)
3527
}
3628
}
3729

3830
@Test
3931
fun testSplashScreenWithTitlesShouldShowTitles() {
40-
launchActivity<LauncherActivity>().use { scenario ->
41-
onView(withId(R.id.ivSplash)).check(matches(isCompletelyDisplayed()))
32+
launchActivity<LauncherActivity>().onActivity { activity ->
33+
activity.setSplashTitles("Example", "Cloud")
4234

43-
scenario.onActivity {
44-
it.setSplashTitles("Example", "Cloud")
45-
}
46-
47-
val onePercentArea = ViewMatchers.isDisplayingAtLeast(1)
48-
onView(withId(R.id.splashScreenBold)).check(matches(onePercentArea))
49-
onView(withId(R.id.splashScreenNormal)).check(matches(onePercentArea))
35+
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.ivSplash).visibility)
36+
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.splashScreenBold).visibility)
37+
assertEquals(View.VISIBLE, activity.findViewById<View>(R.id.splashScreenNormal).visibility)
5038
}
5139
}
5240
}

0 commit comments

Comments
 (0)