mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Closes #3416 // FREEBIE
This commit is contained in:
parent
d935be7b0a
commit
d98cb7b53f
@ -20,6 +20,7 @@ import android.content.Context;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.Espresso.openActionBarOverflowOrOptionsMenu;
|
||||
import static android.support.test.espresso.Espresso.openContextualActionModeOverflowMenu;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
@ -42,6 +43,11 @@ public class ConversationActivityActions {
|
||||
onView(withText(R.string.conversation__menu_delete_thread)).perform(click());
|
||||
}
|
||||
|
||||
public static void clickForwardMessage() throws Exception {
|
||||
openContextualActionModeOverflowMenu();
|
||||
onView(withText(R.string.conversation_context__menu_forward_message)).perform(click());
|
||||
}
|
||||
|
||||
public static void toggleEmojiKeyboard() throws Exception {
|
||||
onView(withId(R.id.emoji_toggle)).perform(click());
|
||||
}
|
||||
@ -50,4 +56,8 @@ public class ConversationActivityActions {
|
||||
typeTextAndCloseKeyboard(onView(withId(R.id.embedded_text_editor)), message);
|
||||
}
|
||||
|
||||
public static void clickSend() throws Exception {
|
||||
onView(withId(R.id.send_button)).perform(click());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
package org.thoughtcrime.securesms;
|
||||
|
||||
import android.test.suitebuilder.annotation.LargeTest;
|
||||
|
||||
import static android.support.test.espresso.Espresso.onView;
|
||||
import static android.support.test.espresso.action.ViewActions.click;
|
||||
import static android.support.test.espresso.action.ViewActions.longClick;
|
||||
import static android.support.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static android.support.test.espresso.matcher.ViewMatchers.withText;
|
||||
import static org.thoughtcrime.securesms.EspressoUtil.addContact;
|
||||
import static org.thoughtcrime.securesms.EspressoUtil.waitOn;
|
||||
|
||||
/**
|
||||
* rhodey
|
||||
*/
|
||||
@LargeTest
|
||||
public class ConversationActivityTest extends TextSecureEspressoTestCase<ConversationListActivity> {
|
||||
|
||||
public ConversationActivityTest() {
|
||||
super(ConversationListActivity.class);
|
||||
}
|
||||
|
||||
public void testForwardMessage() throws Exception {
|
||||
final String[] CONTACT_NAMES = new String[] {"Clement Duval", "Masha Kolenkia"};
|
||||
final String[] CONTACT_NUMBERS = new String[] {"55555555555", "33333333333"};
|
||||
final String MESSAGE = "I struck him in the name of liberty";
|
||||
|
||||
addContact(getContext(), CONTACT_NAMES[0], CONTACT_NUMBERS[0]);
|
||||
addContact(getContext(), CONTACT_NAMES[1], CONTACT_NUMBERS[1]);
|
||||
loadActivity(ConversationListActivity.class, STATE_REGISTERED);
|
||||
|
||||
ConversationListActivityActions.clickNewConversation();
|
||||
waitOn(NewConversationActivity.class);
|
||||
NewConversationActivityActions.clickContactWithName(CONTACT_NAMES[0]);
|
||||
waitOn(ConversationActivity.class);
|
||||
ConversationActivityActions.typeMessage(MESSAGE);
|
||||
ConversationActivityActions.clickSend();
|
||||
|
||||
onView(withText(MESSAGE)).perform(longClick());
|
||||
ConversationActivityActions.clickForwardMessage();
|
||||
|
||||
waitOn(ShareActivity.class);
|
||||
onView(withId(R.id.menu_new_message)).perform(click());
|
||||
waitOn(NewConversationActivity.class);
|
||||
NewConversationActivityActions.filterNameOrNumber(CONTACT_NAMES[1]);
|
||||
NewConversationActivityActions.clickContactWithName(CONTACT_NAMES[1]);
|
||||
|
||||
waitOn(ConversationActivity.class);
|
||||
onView(withText(MESSAGE)).check(matches(isDisplayed()));
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user