Search in sources :

Example 46 with IConversation

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

the class AudioRecordingTest method verifyPlayButtonIsVisibleAfterLongPressiingAudioMessageButton.

@Test
public void verifyPlayButtonIsVisibleAfterLongPressiingAudioMessageButton() 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);
    onView(withId(R.id.cursor_menu_item_audio_message)).check(isVisible());
    onView(withId(R.id.cursor_menu_item_audio_message)).perform(ViewActions.longClick());
    String label = activity.getString(R.string.glyph__play);
    onView(withId(R.id.gtv__audido_message__recording__bottom_button)).check(hasText(label));
}
Also used : IConversation(com.waz.api.IConversation) Test(org.junit.Test) FragmentTest(com.waz.zclient.testutils.FragmentTest)

Example 47 with IConversation

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

the class AudioRecordingTest method verifyCancellingOfAudioMessageRecordingView.

@Test
public void verifyCancellingOfAudioMessageRecordingView() 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);
    onView(withId(R.id.cursor_menu_item_audio_message)).check(isVisible());
    onView(withId(R.id.cursor_menu_item_audio_message)).perform(ViewActions.longClick());
    onView(withId(R.id.fl__audio_message__recording__cancel_button_container)).check(isVisible());
    onView(withId(R.id.fl__audio_message__recording__cancel_button_container)).perform(ViewActions.click());
    onView(withId(R.id.amrv_audio_message_recording)).check(isInvisible());
}
Also used : IConversation(com.waz.api.IConversation) Test(org.junit.Test) FragmentTest(com.waz.zclient.testutils.FragmentTest)

Example 48 with IConversation

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

the class ConversationFragmentTest method assertAudioCallInitatedInGroupConversation.

@Test
public void assertAudioCallInitatedInGroupConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    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 49 with IConversation

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

the class ConversationFragmentTest method assertToolbarVisibleInGroupConversation.

@Test
public void assertToolbarVisibleInGroupConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.t_conversation_toolbar)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 50 with IConversation

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

the class ConversationFragmentTest method assertGIFIconVisibleInOneToOneConversation.

@Test
public void assertGIFIconVisibleInOneToOneConversation() 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_gif)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

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