本文整理汇总了Java中com.squareup.spoon.Spoon.screenshot方法的典型用法代码示例。如果您正苦于以下问题:Java Spoon.screenshot方法的具体用法?Java Spoon.screenshot怎么用?Java Spoon.screenshot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.squareup.spoon.Spoon
的用法示例。
在下文中一共展示了Spoon.screenshot方法的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: 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");
}
示例3: 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");
}
示例4: 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");
}
示例5: 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");
}
示例6: 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");
}
示例7: 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");
}
示例8: 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");
}
示例9: 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");
}
示例10: 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");
}
示例11: 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()));
}
示例12: 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);
}
示例13: 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));
}
示例14: show_messages_in_order_from_others_and_me_when_send_messages_and_receive_messages
import com.squareup.spoon.Spoon; //导入方法依赖的package包/类
@Test
public void
show_messages_in_order_from_others_and_me_when_send_messages_and_receive_messages() throws Exception {
given(conversationRepository.get(any(Conversation.class))).willReturn(getConversationObservable());
MockMessageRepository messageRepository = daggerMockRule.getMockMessageRepository();
messageRepository.enableMessages();
Conversation conversation = getConversation();
initActivity();
WaitForHasClick waitForHasClick = registerKeyboardIdlingResource();
onView(withId(R.id.message_edit_text))
.perform(typeText(MESSAGE_TEXT));
onView(withId(R.id.attach))
.perform(click());
messageRepository.sendMessage(conversation);
onView(withId(R.id.message_edit_text))
.perform(typeText(MESSAGE_TEXT + " Other message"));
onView(withId(R.id.attach))
.perform(click());
messageRepository.sendMessage(conversation);
Spoon.screenshot(activityTestRule.getActivity(), "show_messages_and_type_text");
onView(withId(R.id.recycler_view))
.check(RecyclerSortedViewAssertion.isSorted(this::getAdapterMessages));
unregisterIdlingResources(waitForHasClick);
}
示例15: should_character_name_as_toolbar_tittle
import com.squareup.spoon.Spoon; //导入方法依赖的package包/类
@Test
public void
should_character_name_as_toolbar_tittle() throws Exception {
GoTCharacter character = TestUtils.defaultGotCharacter(0);
startActivity(character);
Spoon.screenshot(activityTestRule.getActivity(), "init_state_character_detail");
onView(withId(R.id.toolbar))
.check(ToolbarTitleViewAssertion.withTitle(character.getName()));
}