From 1c90e648946ecbf76e67d3623a7d2648558b1f55 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Thu, 6 Sep 2018 16:00:29 -0300 Subject: [PATCH] Split up UI and Screenshot tests Closes #1377 --- briar-android/build.gradle | 120 +++++++++--------- briar-android/fastlane/Screengrabfile | 7 +- .../android/{test => }/BriarTestRunner.java | 8 +- .../{test/ScreenshotTest.java => UiTest.java} | 47 +------ .../briar/android/{test => }/ViewActions.java | 2 +- .../briar/android/BriarUiTestComponent.java | 25 ++++ .../navdrawer/NavDrawerActivityTest.java | 4 +- .../briar/android/BriarUiTestComponent.java | 2 - .../briar/android/ScreenshotTest.java | 51 ++++++++ .../ConversationActivityScreenshotTest.java | 4 +- .../login/SetupActivityScreenshotTest.java | 6 +- .../SettingsActivityScreenshotTest.java | 4 +- 12 files changed, 154 insertions(+), 126 deletions(-) rename briar-android/src/androidTest/java/org/briarproject/briar/android/{test => }/BriarTestRunner.java (63%) rename briar-android/src/androidTest/java/org/briarproject/briar/android/{test/ScreenshotTest.java => UiTest.java} (56%) rename briar-android/src/androidTest/java/org/briarproject/briar/android/{test => }/ViewActions.java (98%) create mode 100644 briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/BriarUiTestComponent.java rename briar-android/src/{androidTest => androidTestOfficial}/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java (93%) rename briar-android/src/{androidTest => androidTestScreenshot}/java/org/briarproject/briar/android/BriarUiTestComponent.java (89%) create mode 100644 briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java rename briar-android/src/{androidTest => androidTestScreenshot}/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java (95%) rename briar-android/src/{androidTest => androidTestScreenshot}/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java (94%) rename briar-android/src/{androidTest => androidTestScreenshot}/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java (96%) diff --git a/briar-android/build.gradle b/briar-android/build.gradle index 1bb45a77c..ebe50797c 100644 --- a/briar-android/build.gradle +++ b/briar-android/build.gradle @@ -2,65 +2,6 @@ apply plugin: 'com.android.application' apply plugin: 'witness' apply from: 'witness.gradle' -dependencies { - implementation project(path: ':briar-core', configuration: 'default') - implementation project(path: ':bramble-core', configuration: 'default') - implementation project(':bramble-android') - - def supportVersion = '27.1.1' - implementation "com.android.support:support-v4:$supportVersion" - implementation("com.android.support:appcompat-v7:$supportVersion") { - exclude module: 'support-v4' - } - implementation("com.android.support:preference-v14:$supportVersion") { - exclude module: 'support-v4' - } - implementation("com.android.support:design:$supportVersion") { - exclude module: 'support-v4' - exclude module: 'recyclerview-v7' - } - implementation "com.android.support:cardview-v7:$supportVersion" - implementation "com.android.support:support-annotations:$supportVersion" - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - - implementation('ch.acra:acra:4.9.1') { - exclude module: 'support-v4' - exclude module: 'support-annotations' - } - implementation 'info.guardianproject.panic:panic:0.5' - implementation 'info.guardianproject.trustedintents:trustedintents:0.2' - implementation 'de.hdodenhof:circleimageview:2.2.0' - implementation 'com.google.zxing:core:3.3.0' - implementation 'uk.co.samuelwall:material-tap-target-prompt:2.8.0' - implementation 'com.vanniktech:emoji-google:0.5.1' - - annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2' - - compileOnly 'javax.annotation:jsr250-api:1.0' - - testImplementation project(path: ':bramble-api', configuration: 'testOutput') - testImplementation project(path: ':bramble-core', configuration: 'testOutput') - testImplementation 'org.robolectric:robolectric:3.8' - testImplementation 'org.robolectric:shadows-support-v4:3.3.2' - testImplementation 'org.mockito:mockito-core:2.13.0' - testImplementation 'junit:junit:4.12' - testImplementation "org.jmock:jmock:2.8.2" - testImplementation "org.jmock:jmock-junit4:2.8.2" - testImplementation "org.jmock:jmock-legacy:2.8.2" - testImplementation "org.hamcrest:hamcrest-library:1.3" - testImplementation "org.hamcrest:hamcrest-core:1.3" - - def espressoVersion = '3.0.2' - androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion" - androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion" - androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion" - androidTestImplementation "tools.fastlane:screengrab:1.1.0" - androidTestImplementation "com.android.support.test.uiautomator:uiautomator-v18:2.1.3" - androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.0.2" - androidTestCompileOnly 'javax.annotation:jsr250-api:1.0' - androidTestImplementation 'junit:junit:4.12' -} - def getStdout = { command, defaultValue -> def stdout = new ByteArrayOutputStream() try { @@ -89,7 +30,7 @@ android { def now = (long) (System.currentTimeMillis() / 1000) buildConfigField "Long", "BuildTimestamp", "${getStdout(['git', 'log', '-n', '1', '--format=%ct'], now)}000L" - testInstrumentationRunner 'org.briarproject.briar.android.test.BriarTestRunner' + testInstrumentationRunner 'org.briarproject.briar.android.BriarTestRunner' } buildTypes { @@ -144,6 +85,65 @@ android { } } +dependencies { + implementation project(path: ':briar-core', configuration: 'default') + implementation project(path: ':bramble-core', configuration: 'default') + implementation project(':bramble-android') + + def supportVersion = '27.1.1' + implementation "com.android.support:support-v4:$supportVersion" + implementation("com.android.support:appcompat-v7:$supportVersion") { + exclude module: 'support-v4' + } + implementation("com.android.support:preference-v14:$supportVersion") { + exclude module: 'support-v4' + } + implementation("com.android.support:design:$supportVersion") { + exclude module: 'support-v4' + exclude module: 'recyclerview-v7' + } + implementation "com.android.support:cardview-v7:$supportVersion" + implementation "com.android.support:support-annotations:$supportVersion" + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + + implementation('ch.acra:acra:4.9.1') { + exclude module: 'support-v4' + exclude module: 'support-annotations' + } + implementation 'info.guardianproject.panic:panic:0.5' + implementation 'info.guardianproject.trustedintents:trustedintents:0.2' + implementation 'de.hdodenhof:circleimageview:2.2.0' + implementation 'com.google.zxing:core:3.3.0' + implementation 'uk.co.samuelwall:material-tap-target-prompt:2.8.0' + implementation 'com.vanniktech:emoji-google:0.5.1' + + annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2' + + compileOnly 'javax.annotation:jsr250-api:1.0' + + testImplementation project(path: ':bramble-api', configuration: 'testOutput') + testImplementation project(path: ':bramble-core', configuration: 'testOutput') + testImplementation 'org.robolectric:robolectric:3.8' + testImplementation 'org.robolectric:shadows-support-v4:3.3.2' + testImplementation 'org.mockito:mockito-core:2.13.0' + testImplementation 'junit:junit:4.12' + testImplementation "org.jmock:jmock:2.8.2" + testImplementation "org.jmock:jmock-junit4:2.8.2" + testImplementation "org.jmock:jmock-legacy:2.8.2" + testImplementation "org.hamcrest:hamcrest-library:1.3" + testImplementation "org.hamcrest:hamcrest-core:1.3" + + def espressoVersion = '3.0.2' + androidTestImplementation "com.android.support.test.espresso:espresso-core:$espressoVersion" + androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espressoVersion" + androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espressoVersion" + androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:2.0.2" + androidTestCompileOnly 'javax.annotation:jsr250-api:1.0' + androidTestImplementation 'junit:junit:4.12' + androidTestScreenshotImplementation "tools.fastlane:screengrab:1.1.0" + androidTestScreenshotImplementation "com.android.support.test.uiautomator:uiautomator-v18:2.1.3" +} + task verifyTranslations { doLast { def file = project.file("src/main/res/values/arrays.xml") diff --git a/briar-android/fastlane/Screengrabfile b/briar-android/fastlane/Screengrabfile index a74c46ea4..8a6f13534 100644 --- a/briar-android/fastlane/Screengrabfile +++ b/briar-android/fastlane/Screengrabfile @@ -1,10 +1,5 @@ app_package_name "org.briarproject.briar.android.screenshot.debug" locales ['en-US'] -use_tests_in_classes([ - 'org.briarproject.briar.android.login.SetupActivityScreenshotTest', - 'org.briarproject.briar.android.settings.SettingsActivityScreenshotTest', - 'org.briarproject.briar.android.contact.ConversationActivityScreenshotTest', -]) app_apk_path "build/outputs/apk/screenshot/debug/briar-android-screenshot-debug.apk" tests_apk_path "build/outputs/apk/androidTest/screenshot/debug/briar-android-screenshot-debug-androidTest.apk" -test_instrumentation_runner "org.briarproject.briar.android.test.BriarTestRunner" \ No newline at end of file +test_instrumentation_runner "org.briarproject.briar.android.BriarTestRunner" \ No newline at end of file diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/BriarTestRunner.java b/briar-android/src/androidTest/java/org/briarproject/briar/android/BriarTestRunner.java similarity index 63% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/test/BriarTestRunner.java rename to briar-android/src/androidTest/java/org/briarproject/briar/android/BriarTestRunner.java index bf520102d..4d1081b42 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/BriarTestRunner.java +++ b/briar-android/src/androidTest/java/org/briarproject/briar/android/BriarTestRunner.java @@ -1,11 +1,9 @@ -package org.briarproject.briar.android.test; +package org.briarproject.briar.android; import android.app.Application; import android.content.Context; import android.support.test.runner.AndroidJUnitRunner; -import org.briarproject.briar.android.BriarTestComponentApplication; - public class BriarTestRunner extends AndroidJUnitRunner { @Override @@ -13,8 +11,8 @@ public class BriarTestRunner extends AndroidJUnitRunner { Context context) throws InstantiationException, IllegalAccessException, ClassNotFoundException { - return super.newApplication(cl, BriarTestComponentApplication.class.getName(), - context); + return super.newApplication(cl, + BriarTestComponentApplication.class.getName(), context); } } diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/ScreenshotTest.java b/briar-android/src/androidTest/java/org/briarproject/briar/android/UiTest.java similarity index 56% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/test/ScreenshotTest.java rename to briar-android/src/androidTest/java/org/briarproject/briar/android/UiTest.java index 2d3b1ced8..a767da8ee 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/ScreenshotTest.java +++ b/briar-android/src/androidTest/java/org/briarproject/briar/android/UiTest.java @@ -1,35 +1,20 @@ -package org.briarproject.briar.android.test; +package org.briarproject.briar.android; import android.app.Activity; import android.content.Intent; import android.support.test.espresso.intent.rule.IntentsTestRule; -import android.util.Log; import org.briarproject.bramble.api.account.AccountManager; import org.briarproject.bramble.api.lifecycle.LifecycleManager; import org.briarproject.bramble.api.nullsafety.NotNullByDefault; -import org.briarproject.bramble.api.plugin.ConnectionRegistry; -import org.briarproject.bramble.api.system.Clock; -import org.briarproject.briar.android.BriarService; -import org.briarproject.briar.android.BriarTestComponentApplication; -import org.briarproject.briar.android.BriarUiTestComponent; -import org.briarproject.briar.api.test.TestDataCreator; -import org.junit.ClassRule; import javax.annotation.Nullable; import javax.inject.Inject; -import tools.fastlane.screengrab.Screengrab; -import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; -import tools.fastlane.screengrab.locale.LocaleTestRule; - import static android.support.test.InstrumentationRegistry.getTargetContext; -import static tools.fastlane.screengrab.Screengrab.setDefaultScreenshotStrategy; -public abstract class ScreenshotTest { - - @ClassRule - public static final LocaleTestRule localeTestRule = new LocaleTestRule(); +@SuppressWarnings("WeakerAccess") +public abstract class UiTest { protected static final String USERNAME = "Alice"; protected static final String PASSWORD = "123456"; @@ -38,16 +23,8 @@ public abstract class ScreenshotTest { protected AccountManager accountManager; @Inject protected LifecycleManager lifecycleManager; - @Inject - protected TestDataCreator testDataCreator; - @Inject - protected ConnectionRegistry connectionRegistry; - @Inject - protected Clock clock; - public ScreenshotTest() { - super(); - setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy()); + public UiTest() { BriarTestComponentApplication app = (BriarTestComponentApplication) getTargetContext() .getApplicationContext(); @@ -56,22 +33,6 @@ public abstract class ScreenshotTest { protected abstract void inject(BriarUiTestComponent component); - protected void screenshot(String name) { - try { - Screengrab.screenshot(name); - } catch (RuntimeException e) { - if (!e.getMessage().equals("Unable to capture screenshot.")) - throw e; - // The tests should still pass when run from AndroidStudio - // without manually granting permissions like fastlane does. - Log.w("Screengrab", "Permission to write screenshot is missing."); - } - } - - protected long getMinutesAgo(int minutes) { - return clock.currentTimeMillis() - minutes * 60 * 1000; - } - @NotNullByDefault protected class CleanAccountTestRule extends IntentsTestRule { diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/ViewActions.java b/briar-android/src/androidTest/java/org/briarproject/briar/android/ViewActions.java similarity index 98% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/test/ViewActions.java rename to briar-android/src/androidTest/java/org/briarproject/briar/android/ViewActions.java index 0d1aceba5..ac3edab65 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/test/ViewActions.java +++ b/briar-android/src/androidTest/java/org/briarproject/briar/android/ViewActions.java @@ -1,4 +1,4 @@ -package org.briarproject.briar.android.test; +package org.briarproject.briar.android; import android.app.Activity; import android.support.test.espresso.PerformException; diff --git a/briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/BriarUiTestComponent.java b/briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/BriarUiTestComponent.java new file mode 100644 index 000000000..8aa02d42a --- /dev/null +++ b/briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/BriarUiTestComponent.java @@ -0,0 +1,25 @@ +package org.briarproject.briar.android; + +import org.briarproject.bramble.BrambleAndroidModule; +import org.briarproject.bramble.BrambleCoreModule; +import org.briarproject.bramble.account.BriarAccountModule; +import org.briarproject.briar.BriarCoreModule; +import org.briarproject.briar.android.navdrawer.NavDrawerActivityTest; + +import javax.inject.Singleton; + +import dagger.Component; + +@Singleton +@Component(modules = { + AppModule.class, + BriarCoreModule.class, + BrambleAndroidModule.class, + BriarAccountModule.class, + BrambleCoreModule.class +}) +public interface BriarUiTestComponent extends AndroidComponent { + + void inject(NavDrawerActivityTest test); + +} diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java b/briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java similarity index 93% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java rename to briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java index e92ae6693..5d55f2600 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java +++ b/briar-android/src/androidTestOfficial/java/org/briarproject/briar/android/navdrawer/NavDrawerActivityTest.java @@ -6,8 +6,8 @@ import android.view.Gravity; import org.briarproject.briar.R; import org.briarproject.briar.android.BriarUiTestComponent; +import org.briarproject.briar.android.UiTest; import org.briarproject.briar.android.settings.SettingsActivity; -import org.briarproject.briar.android.test.ScreenshotTest; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -23,7 +23,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; @RunWith(AndroidJUnit4.class) -public class NavDrawerActivityTest extends ScreenshotTest { +public class NavDrawerActivityTest extends UiTest { @Rule public CleanAccountTestRule testRule = diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/BriarUiTestComponent.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/BriarUiTestComponent.java similarity index 89% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/BriarUiTestComponent.java rename to briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/BriarUiTestComponent.java index da6b49622..afbe0eaa3 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/BriarUiTestComponent.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/BriarUiTestComponent.java @@ -6,7 +6,6 @@ import org.briarproject.bramble.account.BriarAccountModule; import org.briarproject.briar.BriarCoreModule; import org.briarproject.briar.android.contact.ConversationActivityScreenshotTest; import org.briarproject.briar.android.login.SetupActivityScreenshotTest; -import org.briarproject.briar.android.navdrawer.NavDrawerActivityTest; import org.briarproject.briar.android.settings.SettingsActivityScreenshotTest; import javax.inject.Singleton; @@ -25,7 +24,6 @@ public interface BriarUiTestComponent extends AndroidComponent { void inject(ConversationActivityScreenshotTest test); void inject(SetupActivityScreenshotTest test); - void inject(NavDrawerActivityTest test); void inject(SettingsActivityScreenshotTest test); } diff --git a/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java new file mode 100644 index 000000000..bc544b0f9 --- /dev/null +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/ScreenshotTest.java @@ -0,0 +1,51 @@ +package org.briarproject.briar.android; + +import android.util.Log; + +import org.briarproject.bramble.api.plugin.ConnectionRegistry; +import org.briarproject.bramble.api.system.Clock; +import org.briarproject.briar.api.test.TestDataCreator; +import org.junit.ClassRule; + +import javax.inject.Inject; + +import tools.fastlane.screengrab.Screengrab; +import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy; +import tools.fastlane.screengrab.locale.LocaleTestRule; + +import static tools.fastlane.screengrab.Screengrab.setDefaultScreenshotStrategy; + +public abstract class ScreenshotTest extends UiTest { + + @ClassRule + public static final LocaleTestRule localeTestRule = new LocaleTestRule(); + + @Inject + protected TestDataCreator testDataCreator; + @Inject + protected ConnectionRegistry connectionRegistry; + @Inject + protected Clock clock; + + public ScreenshotTest() { + super(); + setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy()); + } + + protected void screenshot(String name) { + try { + Screengrab.screenshot(name); + } catch (RuntimeException e) { + if (!e.getMessage().equals("Unable to capture screenshot.")) + throw e; + // The tests should still pass when run from AndroidStudio + // without manually granting permissions like fastlane does. + Log.w("Screengrab", "Permission to write screenshot is missing."); + } + } + + protected long getMinutesAgo(int minutes) { + return clock.currentTimeMillis() - minutes * 60 * 1000; + } + +} diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java similarity index 95% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java rename to briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java index ac5aa89e2..e61e5ea1f 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/contact/ConversationActivityScreenshotTest.java @@ -9,7 +9,7 @@ import org.briarproject.bramble.api.contact.Contact; import org.briarproject.bramble.api.db.DbException; import org.briarproject.briar.R; import org.briarproject.briar.android.BriarUiTestComponent; -import org.briarproject.briar.android.test.ScreenshotTest; +import org.briarproject.briar.android.ScreenshotTest; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -22,7 +22,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static org.briarproject.bramble.api.plugin.LanTcpConstants.ID; import static org.briarproject.briar.android.contact.ConversationActivity.CONTACT_ID; -import static org.briarproject.briar.android.test.ViewActions.waitUntilMatches; +import static org.briarproject.briar.android.ViewActions.waitUntilMatches; import static org.hamcrest.Matchers.allOf; @RunWith(AndroidJUnit4.class) diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java similarity index 94% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java rename to briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java index 475ae87a1..8b3981e0d 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/login/SetupActivityScreenshotTest.java @@ -8,7 +8,7 @@ import android.support.test.uiautomator.UiSelector; import org.briarproject.briar.R; import org.briarproject.briar.android.BriarUiTestComponent; -import org.briarproject.briar.android.test.ScreenshotTest; +import org.briarproject.briar.android.ScreenshotTest; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -27,8 +27,8 @@ import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; import static android.support.test.runner.lifecycle.Stage.PAUSED; import static junit.framework.Assert.assertTrue; -import static org.briarproject.briar.android.test.ViewActions.waitForActivity; -import static org.briarproject.briar.android.test.ViewActions.waitUntilMatches; +import static org.briarproject.briar.android.ViewActions.waitForActivity; +import static org.briarproject.briar.android.ViewActions.waitUntilMatches; import static org.briarproject.briar.android.util.UiUtils.needsDozeWhitelisting; diff --git a/briar-android/src/androidTest/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java similarity index 96% rename from briar-android/src/androidTest/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java rename to briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java index 34621c394..831da5ca1 100644 --- a/briar-android/src/androidTest/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java +++ b/briar-android/src/androidTestScreenshot/java/org/briarproject/briar/android/settings/SettingsActivityScreenshotTest.java @@ -9,7 +9,7 @@ import android.view.Gravity; import org.briarproject.briar.R; import org.briarproject.briar.android.BriarUiTestComponent; import org.briarproject.briar.android.navdrawer.NavDrawerActivity; -import org.briarproject.briar.android.test.ScreenshotTest; +import org.briarproject.briar.android.ScreenshotTest; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; @@ -26,7 +26,7 @@ import static android.support.test.espresso.matcher.ViewMatchers.withChild; import static android.support.test.espresso.matcher.ViewMatchers.withClassName; import static android.support.test.espresso.matcher.ViewMatchers.withId; import static android.support.test.espresso.matcher.ViewMatchers.withText; -import static org.briarproject.briar.android.test.ViewActions.waitUntilMatches; +import static org.briarproject.briar.android.ViewActions.waitUntilMatches; import static org.hamcrest.CoreMatchers.is; @RunWith(AndroidJUnit4.class)