本文整理汇总了Java中android.support.test.espresso.contrib.DrawerActions类的典型用法代码示例。如果您正苦于以下问题:Java DrawerActions类的具体用法?Java DrawerActions怎么用?Java DrawerActions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DrawerActions类属于android.support.test.espresso.contrib包,在下文中一共展示了DrawerActions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: challengeRequestAccept
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void challengeRequestAccept() {
// Send message
sendTestMessage(Message.Type.CHALLENGE_REQUEST, Challenge.Type.DISTANCE, true);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
//Tap on Accept
tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
onView(withId(R.id.accept_btn)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.readyBtn), UI_TEST_TIMEOUT));
//Delete challenges from firebase
new FirebaseHelper().deleteChallengeNode("Runnest IHL vs Test User test1");
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:20,代码来源:MessageTest.java
示例2: scheduleMessageCancelAndAccept
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void scheduleMessageCancelAndAccept() {
// Send message
sendTestMessage(Message.Type.SCHEDULE_REQUEST, Challenge.Type.DISTANCE, false);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
//Tap on Cancel
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
tryIsDisplayed(withId(R.id.cancel_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.cancel_btn)).perform(click());
//Tap on Accept
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.accept_btn)).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:22,代码来源:MessageTest.java
示例3: scheduleMessageDecline
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void scheduleMessageDecline() {
// Send message
sendTestMessage(Message.Type.SCHEDULE_REQUEST, Challenge.Type.TIME, false);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
//Tap on Decline
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
tryIsDisplayed(withId(R.id.decline_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.decline_btn)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:18,代码来源:MessageTest.java
示例4: memoMessageCloseDelete
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void memoMessageCloseDelete() {
// Send message
sendTestMessage(Message.Type.MEMO, Challenge.Type.TIME, false);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
//Tap on Close
tryIsDisplayed(withId(R.id.cancel_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.cancel_btn)).perform(click());
//Tap on Delete
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
tryIsDisplayed(withId(R.id.decline_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.decline_btn)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:24,代码来源:MessageTest.java
示例5: memoMessageChallenge
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void memoMessageChallenge() {
// Send message
sendTestMessage(Message.Type.MEMO, Challenge.Type.DISTANCE, false);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
//Tap on Challenge
tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.accept_btn)).perform(click());
tryIsDisplayed(withId(R.id.time_radio), UI_TEST_TIMEOUT);
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:19,代码来源:MessageTest.java
示例6: runFragmentLifecycleTest
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void runFragmentLifecycleTest() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
// Jenkins sleep (1/3)
//
// Sleep necessary in order to successfully build on Jenkins, I wasn't able to
// reproduce the failure in local. After a lot of attempts I decided to keep it.
SystemClock.sleep(FIREBASE_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
activityRule.getActivity().finish();
activityRule.getActivity();
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:18,代码来源:BackHandTest.java
示例7: startAndStopRun
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void startAndStopRun() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
// Jenkins sleep (1/3)
//
// Sleep necessary in order to successfully build on Jenkins, I wasn't able to
// reproduce the failure in local. After a lot of attempts I decided to keep it.
SystemClock.sleep(FIREBASE_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
onView(withId(R.id.start_run)).perform(click());
SystemClock.sleep(MOCK_LOCATION_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));
onView(withId(R.id.stop_run)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.button_history), UI_TEST_TIMEOUT));
onView(withId(R.id.button_history)).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:23,代码来源:RunTest.java
示例8: navigateToLogout
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void navigateToLogout() {
// Logout cancel
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_logout));
tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
onView(withId(android.R.id.button2)).perform(click());
// Logout ok
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_logout));
tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
onView(withText("OK")).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.sign_in_button), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:17,代码来源:AppNavigationTest.java
示例9: inviteWasNotSent
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void inviteWasNotSent() {
Instrumentation.ActivityResult result = new Instrumentation
.ActivityResult(Activity.RESULT_CANCELED, null);
intending(toPackage("com.google.android.gms")).respondWith(result);
waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
onView(withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_invite));
intended(allOf(hasAction("com.google.android.gms.appinvite.ACTION_APP_INVITE"),
toPackage("com.google.android.gms")));
onView(withText(R.string.invitation_failed_message))
.inRoot(withDecorView(not(mActivityRule.getActivity().getWindow().getDecorView())))
.check(matches(isDisplayed()));
}
开发者ID:dasfoo,项目名称:delern,代码行数:17,代码来源:NavigationTest.java
示例10: inviteSent
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void inviteSent() {
Instrumentation.ActivityResult result = new Instrumentation
.ActivityResult(Activity.RESULT_OK, null);
intending(toPackage("com.google.android.gms")).respondWith(result);
waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
onView(withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_invite));
intended(allOf(hasAction("com.google.android.gms.appinvite.ACTION_APP_INVITE"),
toPackage("com.google.android.gms")));
waitView(() -> onView(withText(R.string.invitation_sent_message))
.inRoot(withDecorView(not(mActivityRule.getActivity().getWindow().getDecorView())))
.check(matches(isDisplayed())));
}
开发者ID:dasfoo,项目名称:delern,代码行数:17,代码来源:NavigationTest.java
示例11: sendFeedbackEmailTest
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void sendFeedbackEmailTest() {
Context context = mActivityRule.getActivity().getBaseContext();
intending(toPackage("android.intent.action.CHOOSER"));
waitView(() -> onView(withId(R.id.fab)).check(matches(isDisplayed())));
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
waitView(() -> onView(withId(R.id.nav_view)).check(matches(isDisplayed())));
waitView(() -> onView(withId(R.id.nav_view))
.perform(NavigationViewActions.navigateTo(R.id.nav_contact_us)));
intended(allOf(
hasAction("android.intent.action.CHOOSER"),
hasExtra("android.intent.extra.TITLE", context.
getString(R.string.send_email_intent_chooser_message))));
}
开发者ID:dasfoo,项目名称:delern,代码行数:17,代码来源:NavigationTest.java
示例12: challengeRequestCancelAndDecline
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void challengeRequestCancelAndDecline() {
// Send message
sendTestMessage(Message.Type.CHALLENGE_REQUEST, Challenge.Type.TIME, true);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
//Tap on Cancel
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
SystemClock.sleep(FIREBASE_DURATION);
tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
onView(withId(R.id.cancel_btn)).perform(click());
//Tap on Decline
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
tryIsDisplayed(withId(R.id.request_layout), UI_TEST_TIMEOUT);
onView(withId(R.id.decline_btn)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
//Delete challenges from firebase
new FirebaseHelper().deleteChallengeNode("Runnest IHL vs Test User test1");
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:30,代码来源:MessageTest.java
示例13: memoMessageBusyChallenge
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void memoMessageBusyChallenge() {
// Send message
Message msg1 = new Message("busyEmail",
"Test User",
"busyUser",
"Test User",
Message.Type.MEMO,
"test1",
new Date(),
1,
0,
Challenge.Type.DISTANCE);
FirebaseHelper firebaseHelper = new FirebaseHelper();
firebaseHelper.sendMessage(msg1);
// Needed to be sure that the sent message appears on firebase
SystemClock.sleep(FIREBASE_DURATION);
//Tap on the request
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_messages));
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
//Tap on Challenge
tryIsDisplayed(withId(R.id.accept_btn), UI_TEST_TIMEOUT);
onView(withId(R.id.accept_btn)).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:32,代码来源:MessageTest.java
示例14: displayChallenge
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void displayChallenge() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:12,代码来源:ChallengeTest.java
示例15: startAndAbortRun
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void startAndAbortRun() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
// Jenkins sleep (2/3)
//
// Sleep necessary in order to successfully build on Jenkins, I wasn't able to
// reproduce the failure in local. After a lot of attempts I decided to keep it.
SystemClock.sleep(FIREBASE_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
onView(withId(R.id.start_run)).perform(click());
SystemClock.sleep(MOCK_LOCATION_DURATION);
//Press on CANCEL
pressBack();
tryIsDisplayed(withId(android.R.id.button2), UI_TEST_TIMEOUT);
onView(withId(android.R.id.button2)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));
pressBack();
tryIsDisplayed(withId(android.R.id.button1), UI_TEST_TIMEOUT);
onView(withId(android.R.id.button1)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.main_layout), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:30,代码来源:RunTest.java
示例16: deleteRun
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void deleteRun() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
// Jenkins sleep (3/3)
//
// Sleep necessary in order to successfully build on Jenkins, I wasn't able to
// reproduce the failure in local. After a lot of attempts I decided to keep it.
SystemClock.sleep(FIREBASE_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
onView(withId(R.id.start_run)).perform(click());
SystemClock.sleep(MOCK_LOCATION_DURATION);
onView(isRoot()).perform(waitForMatch(withId(R.id.stop_run), UI_TEST_TIMEOUT));
onView(withId(R.id.stop_run)).perform(click());
// Exit and enter displayChallenge
tryIsDisplayed(withId(R.id.button_history), TIME_CHALLENGE_DURATION + UI_TEST_TIMEOUT);
onView(withId(R.id.button_history)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.button_delete), UI_TEST_TIMEOUT));
onView(withId(R.id.button_delete)).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:34,代码来源:RunTest.java
示例17: displayRun
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void displayRun() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
onView(isRoot()).perform(waitForMatch(withId(R.id.list), UI_TEST_TIMEOUT));
onData(anything()).inAdapterView(withId(R.id.list)).atPosition(0).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:12,代码来源:RunTest.java
示例18: navigateToChallengeHistory
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void navigateToChallengeHistory() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:9,代码来源:AppNavigationTest.java
示例19: navigateToSingleRunHistory
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void navigateToSingleRunHistory() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_history));
onView(isRoot()).perform(waitForMatch(withId(R.id.tabs), UI_TEST_TIMEOUT));
onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
onView(allOf(withText("Challenges"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
onView(allOf(withText("Runs"), isDescendantOfA(withId(R.id.tabs)))).perform(click());
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:11,代码来源:AppNavigationTest.java
示例20: backButtonWorks
import android.support.test.espresso.contrib.DrawerActions; //导入依赖的package包/类
@Test
public void backButtonWorks() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
onView(withId(R.id.nav_view)).perform(NavigationViewActions.navigateTo(R.id.nav_run));
onView(isRoot()).perform(waitForMatch(withId(R.id.start_run), UI_TEST_TIMEOUT));
Espresso.pressBack();
onView(isRoot()).perform(waitForMatch(withId(R.id.main_layout), UI_TEST_TIMEOUT));
}
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:10,代码来源:AppNavigationTest.java
注:本文中的android.support.test.espresso.contrib.DrawerActions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论