Search in sources :

Example 11 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertAudioCallInitatedInOneToOneConversation.

@Test
public void assertAudioCallInitatedInOneToOneConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    ICallingController mockCallingController = activity.getControllerFactory().getCallingController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_audio_call)).check(isVisible());
    onView(withId(R.id.action_audio_call)).perform(click());
    verify(mockCallingController).startCall(false);
}
Also used : IConversation(com.waz.api.IConversation) ICallingController(com.waz.zclient.controllers.calling.ICallingController) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 12 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertVideoCallInitatedInOneToOneConversation.

@Test
public void assertVideoCallInitatedInOneToOneConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    ICallingController mockCallingController = activity.getControllerFactory().getCallingController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_video_call)).check(isVisible());
    onView(withId(R.id.action_video_call)).perform(click());
    verify(mockCallingController).startCall(true);
}
Also used : IConversation(com.waz.api.IConversation) ICallingController(com.waz.zclient.controllers.calling.ICallingController) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 13 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertCursorImagesBackButtonVisible.

@Test
public void assertCursorImagesBackButtonVisible() throws Exception {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    when(mockConversation.isActive()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.cursor_menu_item_camera)).check(isVisible());
    onView(withId(R.id.cursor_menu_item_camera)).perform(click());
    Thread.sleep(500);
    onView(withId(R.id.rv__cursor_images)).check(isVisible());
    onView(withId(R.id.gtv__cursor_image__nav_camera_back)).check(isGone());
    onView(withId(R.id.rv__cursor_images)).perform(swipeLeft());
    Thread.sleep(200);
    onView(withId(R.id.gtv__cursor_image__nav_camera_back)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 14 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertFileUploadIconVisibleInOneToOneConversation.

@Test
public void assertFileUploadIconVisibleInOneToOneConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    when(mockConversation.isActive()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    Thread.sleep(500);
    onView(withId(R.id.cursor_menu_item_more)).perform(click());
    Thread.sleep(500);
    onView(withId(R.id.cursor_menu_item_file)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 15 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ParticipantHeaderFragmentTest method assertGroupConversationNameCanBeEdited.

@Test
public void assertGroupConversationNameCanBeEdited() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    String conversationName = "A group";
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.getName()).thenReturn(conversationName);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    MockHelper.setupParticipantsMocks(mockConversation, activity);
    attachFragment(ParticipantHeaderFragment.newInstance(IConnectStore.UserRequester.CONVERSATION), ParticipantHeaderFragment.TAG);
    onView(withId(R.id.gtv__participants_header__pen_icon)).check(isVisible());
    onView(withId(R.id.gtv__participants_header__pen_icon)).perform(click());
    Thread.sleep(500);
    onView(withId(R.id.gtv__participants_header__pen_icon)).check(isGone());
    onView(withId(R.id.taet__participants__header__editable)).check(hasText(conversationName));
}
Also used : IConversation(com.waz.api.IConversation) Test(org.junit.Test) FragmentTest(com.waz.zclient.testutils.FragmentTest)

Aggregations

IConversation (com.waz.api.IConversation)69 FragmentTest (com.waz.zclient.testutils.FragmentTest)25 Test (org.junit.Test)25 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)14 View (android.view.View)10 User (com.waz.api.User)9 ArrayList (java.util.ArrayList)6 SuppressLint (android.annotation.SuppressLint)5 Intent (android.content.Intent)4 Handler (android.os.Handler)4 AbsListView (android.widget.AbsListView)4 CreatedGroupConversationEvent (com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent)4 FooterMenuCallback (com.waz.zclient.views.menus.FooterMenuCallback)4 Instrumentation (android.app.Instrumentation)3 TextView (android.widget.TextView)3 BaseScalaActivity (com.waz.zclient.BaseScalaActivity)3 AddedMemberToGroupEvent (com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)3 ExceptionHandler (net.hockeyapp.android.ExceptionHandler)3 Animator (android.animation.Animator)2 AnimatorSet (android.animation.AnimatorSet)2