minor refactor and updt some versions in gradle
This commit is contained in:
parent
c572d60213
commit
095525f701
@ -65,7 +65,7 @@ dependencies {
|
||||
implementation "androidx.browser:browser:1.2.0"
|
||||
implementation 'com.google.android.material:material:1.1.0'
|
||||
|
||||
def room_version = "2.2.4"
|
||||
def room_version = "2.2.5"
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
|
||||
@ -84,6 +84,8 @@ dependencies {
|
||||
|
||||
androidTestImplementation("com.squareup.okhttp3:mockwebserver:4.4.0")
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
|
||||
|
@ -15,7 +15,6 @@ import okhttp3.mockwebserver.Dispatcher
|
||||
import okhttp3.mockwebserver.MockResponse
|
||||
import okhttp3.mockwebserver.MockWebServer
|
||||
import okhttp3.mockwebserver.RecordedRequest
|
||||
import org.hamcrest.CoreMatchers.allOf
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@ -80,6 +79,7 @@ class MockedServerTest {
|
||||
preferences.edit().putString("accessToken", "azerty").apply()
|
||||
preferences.edit().putString("domain", baseUrl.toString()).apply()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testFollowersTextView() {
|
||||
ActivityScenario.launch(MainActivity::class.java).onActivity{
|
||||
@ -90,16 +90,6 @@ class MockedServerTest {
|
||||
onView(withId(R.id.accountNameTextView)).check(matches(withText("deerbard_photo")))
|
||||
}
|
||||
|
||||
// @Test
|
||||
// fun swipingDownOnHomepageShowsMorePosts() {
|
||||
// Thread.sleep(1000)
|
||||
//
|
||||
// val firstDesc = allOf(withId(R.id.description))
|
||||
// onView(withId(R.id.view_pager))
|
||||
// .perform(ViewActions.swipeUp())
|
||||
// .perform(ViewActions.swipeDown())
|
||||
// onView(allOf(withId(R.id.description))).check(matches(firstDesc))
|
||||
// }
|
||||
@Test
|
||||
fun testNotificationsList() {
|
||||
ActivityScenario.launch(MainActivity::class.java).onActivity{
|
||||
|
@ -30,8 +30,6 @@ class SettingsTest {
|
||||
.targetContext.getSharedPreferences("com.h.pixeldroid.pref", Context.MODE_PRIVATE)
|
||||
preferences.edit().putString("accessToken", "azerty").apply()
|
||||
preferences.edit().putString("domain", "http://localhost").apply()
|
||||
ActivityScenario.launch(MainActivity::class.java)
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1,16 +1,23 @@
|
||||
package com.h.pixeldroid
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.action.ViewActions.swipeLeft
|
||||
import androidx.test.espresso.action.ViewActions.swipeRight
|
||||
import androidx.test.espresso.action.ViewActions
|
||||
import androidx.test.espresso.action.ViewActions.*
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.intent.Intents
|
||||
import androidx.test.espresso.intent.matcher.IntentMatchers
|
||||
import androidx.test.espresso.intent.rule.IntentsTestRule
|
||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.ext.junit.rules.ActivityScenarioRule
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import org.hamcrest.CoreMatchers
|
||||
import org.hamcrest.Matcher
|
||||
import org.junit.Before
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@ -27,7 +34,6 @@ class SwipeTest {
|
||||
.targetContext.getSharedPreferences("com.h.pixeldroid.pref", Context.MODE_PRIVATE)
|
||||
preferences.edit().putString("accessToken", "azerty").apply()
|
||||
preferences.edit().putString("domain", "http://localhost").apply()
|
||||
ActivityScenario.launch(MainActivity::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -43,11 +49,10 @@ class SwipeTest {
|
||||
|
||||
@Test
|
||||
fun swipingRightStopsAtHomepage() {
|
||||
ActivityScenario.launch(MainActivity::class.java).onActivity {
|
||||
a -> a.findViewById<TabLayout>(R.id.tabs).getTabAt(4)?.select()
|
||||
} // go to the last tab
|
||||
onView(withId(R.id.main_activity_main_linear_layout))
|
||||
.perform(swipeLeft()) // search
|
||||
.perform(swipeLeft()) // camera
|
||||
.perform(swipeLeft()) // notifications
|
||||
.perform(swipeLeft()) // profile
|
||||
.perform(swipeRight()) // notifications
|
||||
.perform(swipeRight()) // camera
|
||||
.perform(swipeRight()) // search
|
||||
|
Loading…
x
Reference in New Issue
Block a user