Package 

Class TestHarnessKt

    • Method Summary

      Modifier and Type Method Description
      final static Unit TestHarness(DpSize size, Boolean darkMode, LocaleListCompat locales, LayoutDirection layoutDirection, Float fontScale, Integer fontWeightAdjustment, Boolean isScreenRound, Function0<Unit> content) Render content in a Box within a harness, overriding various device configuration values to make testing easier.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • TestHarness

        @Composable()@Deprecated(replaceWith = @ReplaceWith(imports = {androidx.compose.ui.test.DeviceConfigurationOverride, androidx.compose.ui.test.ForcedSize, androidx.compose.ui.test.DarkMode, androidx.compose.ui.test.Locales, androidx.compose.ui.test.LayoutDirection, androidx.compose.ui.test.FontScale, androidx.compose.ui.test.FontWeightAdjustment, androidx.compose.ui.test.RoundScreen, androidx.compose.ui.test.then, androidx.compose.ui.text.intl.LocaleList}, expression = DeviceConfigurationOverride(DeviceConfigurationOverride.ForcedSize(size) then DeviceConfigurationOverride.DarkMode(darkMode) then DeviceConfigurationOverride.Locales(LocaleList(locales.toLanguageTags()))then DeviceConfigurationOverride.LayoutDirection(layoutDirection)then DeviceConfigurationOverride.FontScale(fontScale)then DeviceConfigurationOverride.FontWeightAdjustment(fontWeightAdjustment)then DeviceConfigurationOverride.RoundScreen(isScreenRound), content)), message = TestHarness has been superceded by DeviceConfigurationOverride in ui-test. Each argument in TestHarness have been replaced with an individual DeviceConfigurationOverride, so the suggested replacement is likely unnecessarily adding overrides for anything that was previously using the default arguments.) final static Unit TestHarness(DpSize size, Boolean darkMode, LocaleListCompat locales, LayoutDirection layoutDirection, Float fontScale, Integer fontWeightAdjustment, Boolean isScreenRound, Function0<Unit> content)

        Render content in a Box within a harness, overriding various device configuration values to make testing easier.

        Parameters:
        size - if not DpSize.Unspecified, the content will be forced to be drawn with at this size, overriding LocalDensity if necessary to ensure that there is enough space.
        darkMode - if true, the content will be rendered with dark mode.
        locales - the list of locales to render the app with.
        layoutDirection - an overriding layout direction.
        fontScale - the font scale to render text at.
        fontWeightAdjustment - the font weight adjustment for fonts.
        isScreenRound - the device roundness.