-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add assumptions for Spoon tests to be ignored on API 21+
- Loading branch information
Showing
8 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
falcon-sample/src/androidTest/java/com/jraska/falcon/sample/Assumptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.jraska.falcon.sample; | ||
|
||
import android.content.Context; | ||
import android.content.pm.PackageManager; | ||
import android.os.Build; | ||
import android.support.v4.content.ContextCompat; | ||
import org.junit.Assume; | ||
|
||
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; | ||
import static org.hamcrest.Matchers.is; | ||
import static org.hamcrest.Matchers.lessThan; | ||
|
||
public final class Assumptions { | ||
public static void assumeNoCI() { | ||
Assume.assumeThat("Test should not run on CI server.", isContinuousIntegration(), is(false)); | ||
} | ||
|
||
public static boolean isContinuousIntegration() { | ||
return BuildConfig.CI_BUILD; | ||
} | ||
|
||
public static void assumeSpoonPermissions() { | ||
// TODO: 28/07/16 PULL WELCOME: grant permissions to test application on API 21+ | ||
Assume.assumeThat("Spoon cannot take screenshots on API 21+" + | ||
" without granted WRITE_EXTERNAL_STORAGE permission", | ||
Build.VERSION.SDK_INT, lessThan(Build.VERSION_CODES.LOLLIPOP)); | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
falcon-sample/src/androidTest/java/com/jraska/falcon/sample/CICheck.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters