-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from KakaoCup/develop
Develop sync
- Loading branch information
Showing
12 changed files
with
322 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
sample/src/androidTest/kotlin/io/github/kakaocup/sample/HorizontalScrollTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import io.github.kakaocup.kakao.screen.Screen.Companion.onScreen | ||
import io.github.kakaocup.sample.screen.ScrollScreen | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
class HorizontalScrollTest { | ||
@Rule | ||
@JvmField | ||
val rule = ActivityScenarioRule(HorizontalScrollActivity::class.java) | ||
|
||
@Test | ||
fun test() { | ||
onScreen<ScrollScreen> { | ||
checkStart() | ||
scroll { scrollToEnd() } | ||
checkEnd() | ||
|
||
scroll { scrollToStart() } | ||
checkStart() | ||
|
||
scroll { scrollTo(5000) } | ||
checkEnd() | ||
} | ||
} | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
sample/src/androidTest/kotlin/io/github/kakaocup/sample/NestedScrollTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import io.github.kakaocup.kakao.screen.Screen.Companion.onScreen | ||
import io.github.kakaocup.sample.screen.ScrollScreen | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
class NestedScrollTest { | ||
@Rule | ||
@JvmField | ||
val rule = ActivityScenarioRule(NestedScrollActivity::class.java) | ||
|
||
@Test | ||
fun test() { | ||
onScreen<ScrollScreen> { | ||
checkStart() | ||
scroll { scrollToEnd() } | ||
checkEnd() | ||
|
||
scroll { scrollToStart() } | ||
checkStart() | ||
|
||
scroll { scrollTo(5000) } | ||
checkEnd() | ||
} | ||
} | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
sample/src/androidTest/kotlin/io/github/kakaocup/sample/ScrollTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import androidx.test.ext.junit.rules.ActivityScenarioRule | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import io.github.kakaocup.kakao.screen.Screen.Companion.onScreen | ||
import io.github.kakaocup.sample.screen.ScrollScreen | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
class ScrollTest { | ||
@Rule | ||
@JvmField | ||
val rule = ActivityScenarioRule(ScrollActivity::class.java) | ||
|
||
@Test | ||
fun test() { | ||
onScreen<ScrollScreen> { | ||
checkStart() | ||
scroll { scrollToEnd() } | ||
checkEnd() | ||
|
||
scroll { scrollToStart() } | ||
checkStart() | ||
|
||
scroll { scrollTo(5000) } | ||
checkEnd() | ||
} | ||
} | ||
} | ||
|
33 changes: 33 additions & 0 deletions
33
sample/src/androidTest/kotlin/io/github/kakaocup/sample/screen/ScrollScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.github.kakaocup.sample.screen | ||
|
||
import io.github.kakaocup.kakao.screen.Screen | ||
import io.github.kakaocup.kakao.scroll.KScrollView | ||
import io.github.kakaocup.kakao.text.KTextView | ||
import io.github.kakaocup.sample.R | ||
|
||
|
||
class ScrollScreen : Screen<ScrollScreen>() { | ||
val firstElement = KTextView { withId(R.id.first_element) } | ||
val secondElement = KTextView { withId(R.id.second_element) } | ||
val scroll = KScrollView { withId(R.id.scroll) } | ||
|
||
fun checkStart() { | ||
idle(1000) | ||
firstElement { | ||
isDisplayed() | ||
} | ||
secondElement { | ||
isNotDisplayed() | ||
} | ||
} | ||
|
||
fun checkEnd() { | ||
idle(1000) | ||
firstElement { | ||
isNotDisplayed() | ||
} | ||
secondElement { | ||
isDisplayed() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
sample/src/main/kotlin/io/github/kakaocup/sample/HorizontalScrollActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class HorizontalScrollActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_horizontal_scroll) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
sample/src/main/kotlin/io/github/kakaocup/sample/NestedScrollActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class NestedScrollActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_nested_scroll) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
sample/src/main/kotlin/io/github/kakaocup/sample/ScrollActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.kakaocup.sample | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class ScrollActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_nested_scroll) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<HorizontalScrollView | ||
android:id="@+id/scroll" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<LinearLayout | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal"> | ||
|
||
<TextView | ||
android:id="@+id/first_element" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="123" /> | ||
|
||
<View | ||
android:layout_width="1000dp" | ||
android:layout_height="wrap_content" /> | ||
|
||
<TextView | ||
android:id="@+id/second_element" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="321" /> | ||
</LinearLayout> | ||
</HorizontalScrollView> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<androidx.core.widget.NestedScrollView | ||
android:id="@+id/scroll" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/first_element" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="123" /> | ||
|
||
<View | ||
android:layout_width="wrap_content" | ||
android:layout_height="1000dp" /> | ||
|
||
<TextView | ||
android:id="@+id/second_element" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="321" /> | ||
</LinearLayout> | ||
</androidx.core.widget.NestedScrollView> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical"> | ||
|
||
<ScrollView | ||
android:id="@+id/scroll" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<TextView | ||
android:id="@+id/first_element" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="123" /> | ||
|
||
<View | ||
android:layout_width="wrap_content" | ||
android:layout_height="1000dp" /> | ||
|
||
<TextView | ||
android:id="@+id/second_element" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="321" /> | ||
</LinearLayout> | ||
</ScrollView> | ||
</LinearLayout> |