@Override public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) { return base.invokeMenuActionSync(targetActivity, id, flag); }
/** * Clicks on an ActionBar item with a given resource id * * @param resourceId the R.id of the ActionBar item */ public void clickOnActionBarItem(int resourceId){ sleeper.sleep(); Activity activity = activityUtils.getCurrentActivity(); if(activity != null){ inst.invokeMenuActionSync(activity, resourceId, 0); } }
@Override public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) { return base.invokeMenuActionSync(targetActivity, id, flag); }
@Override public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) { return base.invokeMenuActionSync(targetActivity, id, flag); }
@Override @CallSuper public boolean invokeMenuActionSync(Activity targetActivity, int id, int flag) { if (DEBUG) { Logger.d(TAG,"invokeMenuActionSync"); } return mInstrumentation.invokeMenuActionSync(targetActivity, id, flag); }
} else { instrumentation.invokeMenuActionSync(activity, ((MenuItem)item).getItemId(), 0);
/** * Clicks on an ActionBar item with a given resource id * * @param resourceId the R.id of the ActionBar item */ public void clickOnActionBarItem(int resourceId){ sleeper.sleep(); Activity activity = activityUtils.getCurrentActivity(); if(activity != null){ inst.invokeMenuActionSync(activity, resourceId, 0); } }
/** * Test that selecting the refresh menu item triggers a refresh. */ public void testRefreshMenuItem() { // When the refresh menu item is selected getInstrumentation().invokeMenuActionSync(mTestActivity, R.id.menu_refresh, 0); // Then the SwipeRefreshLayout should be refreshing assertTrue(mSwipeRefreshLayout.isRefreshing()); }
/** * Test that selecting the refresh menu item triggers a refresh. */ public void testRefreshMenuItem() { // When the refresh menu item is selected getInstrumentation().invokeMenuActionSync(mTestActivity, R.id.menu_refresh, 0); // Then the SwipeRefreshLayout should be refreshing assertTrue(mSwipeRefreshLayout.isRefreshing()); }
clicked.set(InstrumentationRegistry.getInstrumentation().invokeMenuActionSync(mActivity, menuItemResourceId, 0)); if (clicked.get()) { MyLog.i(this, method + "-Log instrumentation clicked");