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
package <your_package>; | |
import android.support.test.espresso.intent.rule.IntentsTestRule; | |
import android.support.test.runner.AndroidJUnit4; | |
import android.test.suitebuilder.annotation.LargeTest; | |
import org.junit.After; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; |
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
package com.facebook; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
public class AccessTokenCreator { | |
public static AccessToken createToken(Collection<String> grantedPermissions) { | |
return new AccessToken("token", "appId", "userId", grantedPermissions, | |
new ArrayList<String>(), AccessTokenSource.WEB_VIEW, null, null); |
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
class EspressoTextInputLayoutUtils{ | |
/* | |
* Use this method to find the EditText within the TextInputLayout. Useful for typing into the TextInputLayout | |
*/ | |
public static ViewInteraction onEditTextWithinTilWithId(@IdRes int textInputLayoutId) { | |
//Note, if you have specified an ID for the EditText that you place inside | |
//the TextInputLayout, use that instead - i.e, onView(withId(R.id.my_edit_text)); | |
return onView(allOf(isDescendantOfA(withId(textInputLayoutId)), isAssignableFrom(EditText.class))); | |
} | |
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
task bvtTest(dependsOn: 'connectedAvodDebugAndroidTest') { | |
group = 'Verification' | |
description = 'Runs the tests for debug on connected devices' | |
android.defaultConfig.testInstrumentationRunnerArguments.package = 'com.package.bvt' | |
} | |
// Requried for Continous Integration | |
// The gradle process will always pass even with test failures | |
// inspect test results app/build/outputs/androidTest-results/connected/ | |
project.gradle.taskGraph.whenReady { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- This file should be outside of release manifest (in this case app/src/mock/Manifest.xml --> | |
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.tests"> | |
<!-- For espresso testing purposes, this is removed in live builds, but not in dev builds --> | |
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE" /> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> |
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
package com.collectiveidea.example; | |
import android.content.Intent; | |
import android.support.test.espresso.intent.Intents; | |
import android.support.test.rule.ActivityTestRule; | |
import android.support.test.runner.AndroidJUnit4; | |
import com.collectiveidea.example.ui.LoginActivity; | |
import com.collectiveidea.example.ui.MainActivity; | |
import com.collectiveidea.example.util.AccountUtility; |
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
import android.app.Activity; | |
import android.app.Instrumentation; | |
import android.app.KeyguardManager; | |
import android.app.KeyguardManager.KeyguardLock; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.IBinder; | |
import android.os.PowerManager; | |
import android.os.PowerManager.WakeLock; | |
import android.support.test.InstrumentationRegistry; |
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
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 - Nathan Barraille | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
NewerOlder