androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
waitSeconds(10) // Waiting for smartlock window
val uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
val currentPackageName = uiDevice.currentPackageName
if (currentPackageName != "your.app.package") {
uiDevice.pressBack()
}
onView(withText("NO THANKS")).perform(click())
这样的语句可行吗?或者是no thanks
、No Thanks
或者No thanks
(不确定它如何处理大小写)。 - Bartek Lipinski