在最近的应用程序模式下无法检查应用程序的标题背景颜色

时间:2019-06-10 15:08:46

标签: android-espresso android-uiautomator

无法检查应用的标题背景颜色。

当我按下最近使用的应用时,我需要进行测试,然后应用的标题正确。

以下屏幕截图: enter image description here

此处 UI Automator 测试:

@RunWith(AndroidJUnit4::class)
class MyActivityTest {

    private val instrumentation = InstrumentationRegistry.getInstrumentation()
    private val uiDevice: UiDevice = UiDevice.getInstance(instrumentation)

    @Test
    fun recentApp_click_checkAppTitleText() {
        uiDevice.pressRecentApps()
        Thread.sleep(1000)
        val appBack = uiDevice.findObject(UiSelector().textContains("My application for test"))
        assertTrue(appBack.exists())
    }

}

测试成功通过。不错。

但是我还需要检查最近使用的应用程序标题的背景色(在此示例中为深灰色)。 我该怎么做?

0 个答案:

没有答案
相关问题