mirror of
https://github.com/imcarlost/Friendlists.git
synced 2026-04-10 02:46:54 -04:00
implement testing and create a simple test for Userlist
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply from: '../core.gradle'
|
||||
apply from: 'versions.gradle'
|
||||
|
||||
dependencies {
|
||||
implementation project(':base')
|
||||
api deps.testing.junit
|
||||
api deps.testing.koin
|
||||
api deps.testing.core
|
||||
api deps.testing.rules
|
||||
api deps.testing.runner
|
||||
api deps.testing.ext
|
||||
api deps.testing.espresso
|
||||
api deps.testing.fragments
|
||||
}
|
||||
10
testing/src/main/java/com/hako/testing/TestingExtensions.kt
Normal file
10
testing/src/main/java/com/hako/testing/TestingExtensions.kt
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.hako.testing
|
||||
|
||||
import androidx.annotation.RestrictTo
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.matcher.ViewMatchers
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withText
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
|
||||
@RestrictTo(RestrictTo.Scope.TESTS)
|
||||
fun String.isTextDisplayed() = onView(withText(this)).check(matches(ViewMatchers.isDisplayed()))
|
||||
24
testing/versions.gradle
Normal file
24
testing/versions.gradle
Normal file
@@ -0,0 +1,24 @@
|
||||
ext.deps = [:]
|
||||
|
||||
def versions = [:]
|
||||
versions.koin = "2.0.1"
|
||||
versions.junit = "4.13"
|
||||
versions.test = "1.2.0"
|
||||
versions.test_ext = "1.1.1"
|
||||
versions.espresso = "3.2.0"
|
||||
versions.fragments = "1.2.0"
|
||||
|
||||
def deps = [:]
|
||||
|
||||
def testing = [:]
|
||||
testing.junit = "junit:junit:$versions.junit"
|
||||
testing.core = "androidx.test:core:$versions.test"
|
||||
testing.rules = "androidx.test:rules:$versions.test"
|
||||
testing.runner = "androidx.test:runner:$versions.test"
|
||||
testing.ext = "androidx.test.ext:junit:$versions.test_ext"
|
||||
testing.koin = "org.koin:koin-test:$versions.koin"
|
||||
testing.espresso = "androidx.test.espresso:espresso-core:$versions.espresso"
|
||||
testing.fragments = "androidx.fragment:fragment-testing:$versions.fragments"
|
||||
deps.testing = testing
|
||||
|
||||
ext.deps = deps
|
||||
Reference in New Issue
Block a user