Updating an EditText with Espresso

前端 未结 5 1433
慢半拍i
慢半拍i 2020-12-30 19:00

I\'m attempting to update an EditText as part of an Espresso test with:

onView(allOf(withClassName(endsWith(\"EditText\")), withText(is(\"Test\"         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 19:41

    You can use the replaceText method.

    onView(allOf(withClassName(endsWith("EditText")), withText(is("Test"))))
        .perform(replaceText("Another test"));
    

提交回复
热议问题