mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
adding and recording example paparazzi test
This commit is contained in:
parent
df752b9e58
commit
be1e8a8ef8
2 changed files with 48 additions and 0 deletions
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package im.vector.app.screenshot
|
||||
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import app.cash.paparazzi.DeviceConfig.Companion.PIXEL_3
|
||||
import app.cash.paparazzi.Paparazzi
|
||||
import im.vector.app.R
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class PaparazziExampleScreenshotTest {
|
||||
|
||||
@get:Rule
|
||||
val paparazzi = Paparazzi(
|
||||
deviceConfig = PIXEL_3,
|
||||
theme = "Theme.Vector.Light",
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `example paparazzi test`() {
|
||||
val view = paparazzi.inflate<ConstraintLayout>(R.layout.item_radio)
|
||||
|
||||
view.findViewById<TextView>(R.id.actionTitle).text = paparazzi.resources.getString(R.string.room_settings_all_messages)
|
||||
view.findViewById<ImageView>(R.id.radioIcon).setImageResource(R.drawable.ic_radio_on)
|
||||
|
||||
paparazzi.snapshot(view)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:113cf006e9a881f19b79462297cf276aea2b82268182f9ecc297d4b31640b507
|
||||
size 11174
|
Loading…
Reference in a new issue