Skip to content

Instantly share code, notes, and snippets.

@Egorand
Created July 17, 2016 11:57
Show Gist options
  • Select an option

  • Save Egorand/13d7e83431349cea37fb9d7a8836a5c1 to your computer and use it in GitHub Desktop.

Select an option

Save Egorand/13d7e83431349cea37fb9d7a8836a5c1 to your computer and use it in GitHub Desktop.

Revisions

  1. Egor Andreevici created this gist Jul 17, 2016.
    12 changes: 12 additions & 0 deletions ContactsSyncTest.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    @Test
    public void c_shouldDisplayLongRationaleIfPermissionWasDeniedPermanently() throws Exception {
    denyCurrentPermissionPermanently(device);

    onView(withText(R.string.permission_denied_rationale_long)).check(matches(isDisplayed()));
    onView(withText(R.string.grant_permission)).check(matches(isDisplayed()));

    // will grant the permission for the next test
    onView(withText(R.string.grant_permission)).perform(click());
    openPermissions(device);
    grantPermission(device, "Contacts");
    }