public class LithoViewTestHelper extends Object
LithoView
that is relevant during end to end
tests. In order for the data to be collected, ComponentsConfiguration.isEndToEndTestRun
must be enabled.Constructor and Description |
---|
LithoViewTestHelper() |
Modifier and Type | Method and Description |
---|---|
static TestItem |
findTestItem(LithoView lithoView,
String testKey) |
static Deque<TestItem> |
findTestItems(LithoView lithoView,
String testKey)
|
static String |
viewToString(LithoView view)
Provide a nested string representation of a LithoView and its nested
components for debugging purposes.
|
@Nullable public static TestItem findTestItem(LithoView lithoView, String testKey)
lithoView
- The component view the component is mounted to.testKey
- The unique identifier the component was constructed with.UnsupportedOperationException
- If the e2e flag is not enabled in the configuration.Note: If there is more than one element mounted under the given key,
the last one to render will be returned.
@NonNull public static Deque<TestItem> findTestItems(LithoView lithoView, String testKey)
TestItem
given a LithoView
based on the test key it was
assigned during construction.
Example use:
{@code final LithoView lithoView = ComponentTestHelper.mountComponent( mContext, new InlineLayoutSpec() {
lithoView
- The component view the component is mounted to.testKey
- The unique identifier the component was constructed with.UnsupportedOperationException
- If the e2e flag is not enabled in the configuration.