File tree Expand file tree Collapse file tree 2 files changed +42
-4
lines changed
androidTest/java/com/xxmassdeveloper/mpchartexample Expand file tree Collapse file tree 2 files changed +42
-4
lines changed Original file line number Diff line number Diff line change 1+ package com.xxmassdeveloper.mpchartexample
2+
3+ import androidx.test.core.graphics.writeToTestStorage
4+ import androidx.test.espresso.Espresso.onView
5+ import androidx.test.espresso.action.ViewActions.swipeLeft
6+ import androidx.test.espresso.matcher.ViewMatchers
7+ import androidx.test.espresso.matcher.ViewMatchers.withId
8+ import androidx.test.espresso.screenshot.captureToBitmap
9+ import androidx.test.ext.junit.rules.activityScenarioRule
10+ import androidx.test.ext.junit.runners.AndroidJUnit4
11+ import com.xxmassdeveloper.mpchartexample.fragments.SimpleChartDemo
12+ import org.junit.Rule
13+ import org.junit.Test
14+ import org.junit.rules.TestName
15+ import org.junit.runner.RunWith
16+
17+ @RunWith(AndroidJUnit4 ::class )
18+ class ViewPagerTest {
19+
20+ @get:Rule
21+ val activityScenarioRule = activityScenarioRule<SimpleChartDemo >()
22+
23+ @get:Rule
24+ var nameRule = TestName ()
25+
26+ @Test
27+ fun smokeTestSimplyStart () {
28+ onView(ViewMatchers .isRoot())
29+ .captureToBitmap()
30+ .writeToTestStorage(" ${javaClass.simpleName} _${nameRule.methodName} " )
31+
32+ repeat(4 ) {
33+ onView(withId(R .id.pager)).perform(swipeLeft());
34+ onView(ViewMatchers .isRoot())
35+ .captureToBitmap()
36+ .writeToTestStorage(" ${javaClass.simpleName} _${nameRule.methodName} -${it} " )
37+ }
38+ }
39+ }
Original file line number Diff line number Diff line change 55 android : orientation =" vertical" >
66
77 <androidx .viewpager.widget.ViewPager
8- xmlns : android =" http://schemas.android.com/apk/res/android"
9- android : id =" @+id/pager"
10- android : layout_width =" match_parent"
11- android : layout_height =" match_parent" />
8+ android : id =" @+id/pager"
9+ android : layout_width =" match_parent"
10+ android : layout_height =" match_parent" />
1211
1312</RelativeLayout >
You can’t perform that action at this time.
0 commit comments