-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ANDROID-14098 add roborazzi tests for the xml layout
- Loading branch information
Showing
4 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
library/src/test/java/com/telefonica/mistica/list/ListRowViewTest.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,29 @@ | ||
package com.telefonica.mistica.list | ||
|
||
import android.widget.FrameLayout | ||
import androidx.test.espresso.Espresso | ||
import androidx.test.espresso.matcher.ViewMatchers | ||
import androidx.test.ext.junit.rules.activityScenarioRule | ||
import com.telefonica.mistica.DummyActivity | ||
import com.telefonica.mistica.R | ||
import com.telefonica.mistica.testutils.ScreenshotsTest | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
|
||
@RunWith(RobolectricTestRunner::class) | ||
internal class ListRowViewTest: ScreenshotsTest() { | ||
@get:Rule | ||
val rule = activityScenarioRule<DummyActivity>() | ||
|
||
@Test | ||
fun `check ListRowView xml`() { | ||
rule.scenario.onActivity { activity -> | ||
val wrapper: FrameLayout = activity.findViewById(R.id.dummy_activity_wrapper) | ||
activity.layoutInflater.inflate(R.layout.test_list_row_view, wrapper, true) | ||
|
||
compareScreenshot(Espresso.onView(ViewMatchers.withId(R.id.dummy_activity_wrapper))) | ||
} | ||
} | ||
} |
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,14 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="200dp" | ||
android:height="200dp" | ||
android:viewportWidth="120" | ||
android:viewportHeight="120"> | ||
<path | ||
android:pathData="M0,0h120v120h-120z" | ||
android:fillColor="#EFF1F3"/> | ||
<path | ||
android:pathData="M7.71,18.03C7.73,15.2 10.02,12.91 12.85,12.89h93.3c2.84,0 5.14,2.3 5.14,5.14v82.93c-0.02,2.83 -2.31,5.12 -5.14,5.14H12.85c-2.84,-0 -5.14,-2.3 -5.14,-5.14zM100.93,23.25H18.07v72.5l48.12,-48.13c2.02,-2.02 5.3,-2.02 7.32,0L100.93,75.09ZM28.43,43.96c0,5.72 4.64,10.36 10.36,10.36 5.72,0 10.36,-4.64 10.36,-10.36 0,-5.72 -4.64,-10.36 -10.36,-10.36 -5.72,0 -10.36,4.64 -10.36,10.36z" | ||
android:strokeWidth="1.97283" | ||
android:fillColor="#687787" | ||
android:fillType="evenOdd"/> | ||
</vector> |
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,46 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:padding="16dp" | ||
android:orientation="vertical"> | ||
|
||
<com.telefonica.mistica.list.ListRowView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:listRowActionLayout="@layout/list_row_chevron_action" | ||
app:listRowAssetDrawable="@drawable/placeholder" | ||
app:listRowBadgeCount="gone" | ||
app:listRowBadgeVisible="false" | ||
app:listRowDescription="Test Subtitle" | ||
app:listRowAssetType="image_rounded" | ||
app:listRowIsBoxed="true" | ||
app:listRowTitle="Image 32 x 32" | ||
app:listRowAssetHeight="32" | ||
app:listRowAssetWidth="32" /> | ||
<com.telefonica.mistica.list.ListRowView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:listRowActionLayout="@layout/list_row_chevron_action" | ||
app:listRowAssetDrawable="@drawable/placeholder" | ||
app:listRowBadgeCount="gone" | ||
app:listRowBadgeVisible="false" | ||
app:listRowDescription="Test Subtitle" | ||
app:listRowAssetType="image_rounded" | ||
app:listRowIsBoxed="true" | ||
app:listRowTitle="Image 64 x 64" | ||
app:listRowAssetHeight="64" | ||
app:listRowAssetWidth="64" /> | ||
<com.telefonica.mistica.list.ListRowView | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:listRowActionLayout="@layout/list_row_chevron_action" | ||
app:listRowAssetDrawable="@drawable/placeholder" | ||
app:listRowBadgeCount="gone" | ||
app:listRowBadgeVisible="false" | ||
app:listRowDescription="Test Subtitle" | ||
app:listRowAssetType="image_1_1" | ||
app:listRowIsBoxed="true" | ||
app:listRowTitle="Image_1_1" /> | ||
</LinearLayout> |