say Hellow
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了say Hellow相关的知识,希望对你有一定的参考价值。
/** 2 * Created by GuYin on 2017/3/15. 3 */ 4 @RunWith(androidJUnit4.class) 5 @LargeTest 6 public class MainTest { 7 private static final String STRING_TO_BE_TYPED = "peter"; 8 9 @Rule 10 public ActivityTestRule<MainActivity> mainActivityRule = new ActivityTestRule<>(MainActivity.class); 11 12 @Test 13 public void sayHello(){ 14 onView(withId(R.id.name)).perform(typeText(STRING_TO_BE_TYPED), ViewActions.closeSoftKeyboard()); 15 onView(withText("SAY HELLO")).perform(click()); 16 String expectedText = "Hello,"+STRING_TO_BE_TYPED+"!"; 17 onView(withId(R.id.text)).check(matches(withText(expectedText))); 18 } 19 }
以上是关于say Hellow的主要内容,如果未能解决你的问题,请参考以下文章