本文整理汇总了Java中android.support.test.espresso.Espresso.closeSoftKeyboard方法的典型用法代码示例。如果您正苦于以下问题:Java Espresso.closeSoftKeyboard方法的具体用法?Java Espresso.closeSoftKeyboard怎么用?Java Espresso.closeSoftKeyboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.test.espresso.Espresso
的用法示例。
在下文中一共展示了Espresso.closeSoftKeyboard方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAccount_accountAppearsOnList
import android.support.test.espresso.Espresso; //导入方法依赖的package包/类
@Test
public void createAccount_accountAppearsOnList() {
openCreateAccountActivity();
// when typed account name
onView(withId(R.id.account_name_edit_text)).perform(typeText(ACCOUNT_1_NAME));
Espresso.closeSoftKeyboard();
// and click save fab
onView(withId(R.id.save_account_fab)).perform(click());
// then screen should close
onView(withId(R.id.account_name_edit_text)).check(doesNotExist());
// and account name should be visible on list
// todo add check
}
示例2: performStartAdventure
import android.support.test.espresso.Espresso; //导入方法依赖的package包/类
protected void performStartAdventure() {
ViewInteraction button = onView(allOf(withText(getString(R.string.create_new_adventure)), isDisplayed()));
button.perform(click());
//Clicks over the proper book using the property order of the GamebookEnum
DataInteraction textView = onData(anything())
.inAdapterView(allOf(withId(R.id.gamebookListView),
childAtPosition(
withClassName(is("android.widget.RelativeLayout")),
0)))
.atPosition(getGamebook().getOrder() - 1);
textView.perform(click());
button = onView(allOf(withText(getString(R.string.create_new_adventure)), isDisplayed()));
button.perform(click());
Espresso.closeSoftKeyboard();
}
示例3: addImage
import android.support.test.espresso.Espresso; //导入方法依赖的package包/类
@Test
public void addImage() {
Intent resultData = new Intent();
Bitmap icon = BitmapFactory.decodeResource(getInstrumentation().getContext().getResources(),
R.drawable.mock_camera_image);
resultData.putExtra("data", icon);
Instrumentation.ActivityResult result =
new Instrumentation.ActivityResult(Activity.RESULT_OK, resultData);
intending(not(isInternal())).respondWith(result);
Espresso.closeSoftKeyboard();
onView(withId(R.id.imageOpacityOverlay)).perform(click());
onView(withId(R.id.imageOpacityOverlay)).check(matches(not(isDisplayed())));
onView(withId(R.id.imageDelete)).perform(click());
onView(withId(R.id.imageOpacityOverlay)).check(matches(isDisplayed()));
}