Skip to content

Commit

Permalink
Don't run tests that require an SD card when it's not present
Browse files Browse the repository at this point in the history
The feature this tests verifies requires an SD card and will fail
if it's not available.
  • Loading branch information
penguin359 committed Jan 31, 2022
1 parent 744526e commit 95b7259
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions androidTest/java/org/aprsdroid/app/ProfileTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.allOf;
import static org.junit.Assume.assumeTrue;

import android.app.Instrumentation;
import android.content.Intent;
import android.os.Environment;

import androidx.test.core.app.ActivityScenario;
import androidx.test.espresso.intent.Intents;
Expand All @@ -34,6 +36,7 @@ public void tearDown() {

@Test
public void testThatExportProfileOpensTheChooser() {
assumeTrue(Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()));
ActivityScenario scenario = ActivityScenario.launch(PrefsAct.class);
Intents.intending(hasAction(Intent.ACTION_CHOOSER)).respondWith(new Instrumentation.ActivityResult(0, null));
openActionBarOverflowOrOptionsMenu(InstrumentationRegistry.getInstrumentation().getTargetContext());
Expand Down

0 comments on commit 95b7259

Please sign in to comment.