@@ -16,8 +16,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
1616import androidx.test.platform.app.InstrumentationRegistry
1717import androidx.test.rule.GrantPermissionRule
1818import androidx.test.rule.GrantPermissionRule.grant
19- import androidx.test.uiautomator.UiDevice
20- import androidx.test.uiautomator.UiSelector
2119import kotlinx.coroutines.runBlocking
2220import net.vonforst.evmap.EXTRA_CHARGER_ID
2321import net.vonforst.evmap.EXTRA_LAT
@@ -30,20 +28,15 @@ import net.vonforst.evmap.api.goingelectric.GoingElectricApiWrapper
3028import net.vonforst.evmap.model.Favorite
3129import net.vonforst.evmap.storage.AppDatabase
3230import net.vonforst.evmap.storage.PreferenceDataSource
33- import org.junit.AfterClass
3431import org.junit.Before
3532import org.junit.BeforeClass
3633import org.junit.Rule
3734import org.junit.Test
3835import org.junit.runner.RunWith
39- import tools.fastlane.screengrab.FalconScreenshotStrategy
4036import tools.fastlane.screengrab.Screengrab
41- import tools.fastlane.screengrab.ScreenshotStrategy
42- import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy
4337import tools.fastlane.screengrab.cleanstatusbar.CleanStatusBar
4438import tools.fastlane.screengrab.cleanstatusbar.IconVisibility
4539import tools.fastlane.screengrab.locale.LocaleTestRule
46- import java.lang.RuntimeException
4740import java.time.Instant
4841
4942
@@ -55,7 +48,12 @@ class ScreenshotTest {
5548 fun beforeAll () {
5649 IdlingRegistry .getInstance().register(EspressoIdlingResource .countingIdlingResource)
5750
58- Screengrab .setDefaultScreenshotStrategy(UiAutomatorScreenshotStrategy ())
51+ Screengrab .setDefaultScreenshotStrategy { screenshotName, screenshotCallback ->
52+ screenshotCallback.screenshotCaptured(
53+ screenshotName,
54+ androidx.test.core.app.takeScreenshot()
55+ )
56+ }
5957
6058 CleanStatusBar ()
6159 .setWifiVisibility(IconVisibility .HIDE )
0 commit comments