本文整理汇总了Java中com.squareup.spoon.Spoon类的典型用法代码示例。如果您正苦于以下问题:Java Spoon类的具体用法?Java Spoon怎么用?Java Spoon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Spoon类属于com.squareup.spoon包,在下文中一共展示了Spoon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show_characters_name
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void
show_characters_name() throws Exception {
Observable<List<GoTCharacter>> charactersObservable = TestUtils.getCharacters(NUMBER_OF_CHARACTERS);
List<GoTCharacter> characterList = charactersObservable.toBlocking().first();
given(remote.getAll()).willReturn(charactersObservable);
given(local.getAll()).willReturn(charactersObservable);
activityTestRule.launchActivity(null);
Spoon.screenshot(activityTestRule.getActivity(), "Character_list");
RecyclerViewInteraction.<GoTCharacter>onRecyclerView(allOf(withId(R.id.recycler_view), isDisplayed()))
.withItems(characterList)
.check((character, view, e) -> matches(hasDescendant(withText(character.getName()))).check(view, e));
}
示例2: openNavFromMainShouldHaveMainChecked
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void openNavFromMainShouldHaveMainChecked() {
onView(withId(R.id.mainLayout)).perform(SWIPE_OPEN);
Spoon.screenshot(rule.getActivity(), "openNavFromMainShouldHaveMainChecked");
onView(withText(R.string.navigation_graphs)).perform(new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isDisplayed();
}
@Override
public String getDescription() {
return "Check if menu item is checked.";
}
@Override
public void perform(UiController uiController, View view) {
NavigationMenuItemView menuItem = (NavigationMenuItemView) view;
assertThat(menuItem.getItemData().isChecked(), is(true));
}
});
}
示例3: openNavFromSettingsShouldHaveSettingsChecked
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void openNavFromSettingsShouldHaveSettingsChecked() {
onView(withId(R.id.mainLayout)).perform(SWIPE_OPEN);
onView(withText(R.string.navigation_settings)).perform(click());
onView(withId(R.id.mainLayout)).perform(SWIPE_OPEN);
Spoon.screenshot(rule.getActivity(), "openNavFromSettingsShouldHaveSettingsChecked");
onView(allOf(withText(R.string.navigation_settings), withClassName(endsWith("MenuItemView")))).perform(new ViewAction() {
@Override
public Matcher<View> getConstraints() {
return isDisplayed();
}
@Override
public String getDescription() {
return "Check if menu item is checked.";
}
@Override
public void perform(UiController uiController, View view) {
NavigationMenuItemView menuItem = (NavigationMenuItemView) view;
assertThat(menuItem.getItemData().isChecked(), is(true));
}
});
}
示例4: testClickButton
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@SmallTest
public void testClickButton() {
Spoon.screenshot(bookActivity, "Book_Activity_started");
ActivityMonitor activityMonitor = getInstrumentation().addMonitor(AuthorActivity.class.getName(), null, false);
bookActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
button.performClick();
}
});
AuthorActivity authorActivity = (AuthorActivity) getInstrumentation().waitForMonitorWithTimeout(activityMonitor, 5000);
assertNotNull(authorActivity);
authorActivity.finish();
Spoon.screenshot(authorActivity, "Author_Activity_opened");
}
示例5: dropZoneForRectangle
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void dropZoneForRectangle() {
final DropZone dropZone = new DropZone(Rectangle.class,
Collections.<Class<? extends Shape>>emptyList(), GameLevels.LEVEL_1);
final TestActivity activity = activityRule.getActivity();
setDropZone(dropZone);
Spoon.screenshot(activity, "drop-zone-for-rectangle");
}
示例6: dropZoneForTriangle
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void dropZoneForTriangle() {
final DropZone dropZone = new DropZone(Triangle.class,
Collections.<Class<? extends Shape>>emptyList(), GameLevels.LEVEL_1);
final TestActivity activity = activityRule.getActivity();
setDropZone(dropZone);
Spoon.screenshot(activity, "drop-zone-for-triangle");
}
示例7: dropZoneForCircle
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void dropZoneForCircle() {
final DropZone dropZone = new DropZone(Circle.class,
Collections.<Class<? extends Shape>>emptyList(), GameLevels.LEVEL_1);
final TestActivity activity = activityRule.getActivity();
setDropZone(dropZone);
Spoon.screenshot(activity, "drop-zone-for-circle");
}
示例8: dropZoneForDiamond
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void dropZoneForDiamond() {
final DropZone dropZone = new DropZone(Diamond.class,
Collections.<Class<? extends Shape>>emptyList(), GameLevels.LEVEL_1);
final TestActivity activity = activityRule.getActivity();
setDropZone(dropZone);
Spoon.screenshot(activity, "drop-zone-for-diamond");
}
示例9: drawRectangleShape
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void drawRectangleShape() {
final Rectangle rectangle = new Rectangle(shapeBorderWidth);
final TestActivity activity = activityRule.getActivity();
setShape(rectangle);
Spoon.screenshot(activity, "draw-rectangle");
}
示例10: drawTriangleShape
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void drawTriangleShape() {
final Triangle triangle = new Triangle(shapeBorderWidth);
final TestActivity activity = activityRule.getActivity();
setShape(triangle);
Spoon.screenshot(activity, "draw-triangle");
}
示例11: drawCircleShape
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void drawCircleShape() {
final Circle circle = new Circle(shapeBorderWidth);
final TestActivity activity = activityRule.getActivity();
setShape(circle);
Spoon.screenshot(activity, "draw-circle");
}
示例12: drawDiamondShape
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void drawDiamondShape() {
final Diamond diamond = new Diamond(shapeBorderWidth);
final TestActivity activity = activityRule.getActivity();
setShape(diamond);
Spoon.screenshot(activity, "draw-diamond");
}
示例13: show_conversation_users_in_toolbar_subtitle_when_init_activity
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void
show_conversation_users_in_toolbar_subtitle_when_init_activity() throws Exception {
given(conversationRepository.get(any(Conversation.class))).willReturn(getConversationObservable());
initActivity();
Spoon.screenshot(activityTestRule.getActivity(), "init_state_conversation");
onView(withId(R.id.toolbar))
.check(withSubtitle(getUserListSubtitle()));
}
示例14: show_my_message_when_send_a_message
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void
show_my_message_when_send_a_message() throws Exception {
given(conversationRepository.get(any(Conversation.class))).willReturn(getConversationObservable());
MockMessageRepository messageRepository = daggerMockRule.getMockMessageRepository();
messageRepository.disableMessages();
initActivity();
WaitForHasClick waitForHasClick = registerKeyboardIdlingResource();
onView(withId(R.id.message_edit_text))
.perform(typeText(MESSAGE_TEXT));
onView(withId(R.id.attach))
.perform(click());
Spoon.screenshot(activityTestRule.getActivity(), "after_type_a_message");
RecyclerViewInteraction.<Message>onRecyclerView(withId(R.id.recycler_view))
.withItems(Arrays.asList(new Message("1", null, 2, true, new TextPayLoad(MESSAGE_TEXT))))
.check((item, view, e) -> {
String message = ((TextPayLoad) item.getPayload()).getTextMessage().toString();
matches(hasDescendant(withText(message))).check(view, e);
});
unregisterIdlingResources(waitForHasClick);
}
示例15: show_messages_in_order_from_others_when_there_are_messages
import com.squareup.spoon.Spoon; //导入依赖的package包/类
@Test
public void
show_messages_in_order_from_others_when_there_are_messages() throws Exception {
given(conversationRepository.get(any(Conversation.class))).willReturn(getConversationObservable());
MockMessageRepository messageRepository = daggerMockRule.getMockMessageRepository();
messageRepository.enableMessages();
initActivity();
Spoon.screenshot(activityTestRule.getActivity(), "after_show_message_from_others");
onView(withId(R.id.recycler_view))
.check(RecyclerSortedViewAssertion.isSorted(this::getAdapterMessages));
}