File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/main/kotlin/org/wordpress/aztec/demo Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ android {
1111 targetSdkVersion 25
1212 versionCode 1
1313 versionName " 1.0"
14+ testInstrumentationRunner ' android.support.test.runner.AndroidJUnitRunner'
1415 }
1516
1617 buildTypes {
@@ -38,4 +39,7 @@ dependencies {
3839 compile " com.android.support:appcompat-v7:25.3.1"
3940 compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
4041 compile " org.wordpress:utils:1.14.0"
42+ androidTestCompile ' com.android.support.test.espresso:espresso-core:2.2.2' , {
43+ exclude group : ' com.android.support' , module : ' support-annotations'
44+ }
4145}
Original file line number Diff line number Diff line change @@ -119,6 +119,15 @@ class MainActivity : AppCompatActivity(),
119119 UNKNOWN +
120120 EMOJI +
121121 LONG_TEXT
122+
123+ private val isRunningTest : Boolean by lazy {
124+ try {
125+ Class .forName(" android.support.test.espresso.Espresso" )
126+ true
127+ } catch (e: ClassNotFoundException ) {
128+ false
129+ }
130+ }
122131 }
123132
124133 private val MEDIA_CAMERA_PHOTO_PERMISSION_REQUEST_CODE : Int = 1001
@@ -256,7 +265,9 @@ class MainActivity : AppCompatActivity(),
256265 aztec.setToolbar(formattingToolbar)
257266
258267 // initialize the text & HTML
259- source.displayStyledAndFormattedHtml(EXAMPLE )
268+ if (! isRunningTest) {
269+ source.displayStyledAndFormattedHtml(EXAMPLE )
270+ }
260271
261272 if (savedInstanceState == null ) {
262273 aztec.fromHtml(source.getPureHtml())
You can’t perform that action at this time.
0 commit comments