Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Test cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Jun 26, 2016
1 parent f9e0f01 commit be72b08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 55 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import java.io.IOException;

import static com.nononsenseapps.filepicker.sample.Helpers.createTestDirsAndFiles;
import static com.nononsenseapps.filepicker.sample.PermissionGranter.allowPermissionsIfNeeded;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.is;
Expand All @@ -32,7 +31,13 @@
public class SelectNewFile {

@Rule
public ActivityTestRule<NoNonsenseFilePicker> mActivityTestRule = new ActivityTestRule<>(NoNonsenseFilePicker.class);
public ActivityTestRule<NoNonsenseFilePickerTest> mActivityTestRule =
new ActivityTestRule<>(NoNonsenseFilePickerTest.class);

@Before
public void allowPermissions() {
allowPermissionsIfNeeded(mActivityTestRule.getActivity());
}

@Test
public void selectNewFile() throws IOException {
Expand All @@ -50,9 +55,6 @@ public void selectNewFile() throws IOException {
allOf(withId(R.id.button_sd), withText("Pick SD-card"), isDisplayed()));
button.perform(click());

allowPermissionsIfNeeded(mActivityTestRule.getActivity());
createTestDirsAndFiles();

ViewInteraction recyclerView = onView(
allOf(withId(android.R.id.list), isDisplayed()));

Expand Down Expand Up @@ -101,9 +103,6 @@ public void withSingleClick() throws IOException {
allOf(withId(R.id.button_sd), isDisplayed()));
button.perform(click());

allowPermissionsIfNeeded(mActivityTestRule.getActivity());
createTestDirsAndFiles();

ViewInteraction recyclerView = onView(
allOf(withId(android.R.id.list), isDisplayed()));

Expand All @@ -120,7 +119,6 @@ public void withSingleClick() throws IOException {
// Should have returned
ViewInteraction textView = onView(withId(R.id.text));
textView.check(matches(withText("file:///storage/emulated/0/000000_nonsense-tests/B-dir/file-3.txt")));

}

@Test
Expand All @@ -135,10 +133,6 @@ public void clickTwiceShouldNotClearFilename() throws IOException {
allOf(withId(R.id.button_sd), withText("Pick SD-card"), isDisplayed()));
button.perform(click());


allowPermissionsIfNeeded(mActivityTestRule.getActivity());
createTestDirsAndFiles();

ViewInteraction recyclerView = onView(
allOf(withId(android.R.id.list), isDisplayed()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@

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.replaceText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition;
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.withParent;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static com.nononsenseapps.filepicker.sample.Helpers.createTestDirsAndFiles;
import static com.nononsenseapps.filepicker.sample.PermissionGranter.allowPermissionsIfNeeded;
import static org.hamcrest.Matchers.allOf;

Expand Down

0 comments on commit be72b08

Please sign in to comment.