Compare commits
1 Commits
hotfix_cov
...
master
Author | SHA1 | Date | |
---|---|---|---|
5d1571f5ff |
@ -24,10 +24,6 @@ android {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
|
||||
debug {
|
||||
testCoverageEnabled = true
|
||||
}
|
||||
}
|
||||
packagingOptions {
|
||||
exclude 'META-INF/atomicfu.kotlin_module'
|
||||
|
@ -1,11 +1,13 @@
|
||||
package it.unisannio.ding.ids.wedroid.app.view
|
||||
|
||||
import androidx.test.espresso.Espresso.closeSoftKeyboard
|
||||
import androidx.test.espresso.Espresso.onView
|
||||
import androidx.test.espresso.action.ViewActions.*
|
||||
import androidx.test.espresso.action.ViewActions.click
|
||||
import androidx.test.espresso.action.ViewActions.swipeDown
|
||||
import androidx.test.espresso.action.ViewActions.swipeLeft
|
||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||
import androidx.test.espresso.contrib.RecyclerViewActions
|
||||
import androidx.test.espresso.matcher.ViewMatchers.*
|
||||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
|
||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import androidx.test.rule.ActivityTestRule
|
||||
@ -22,80 +24,19 @@ class BoardsListsActivityTest {
|
||||
@get:Rule
|
||||
val activityRule = ActivityTestRule(BoardsListsActivity::class.java)
|
||||
|
||||
@Test
|
||||
fun openBoard() {
|
||||
fun swipeLeftToDelete() {
|
||||
onView(withId(R.id.boardList))
|
||||
.perform(
|
||||
RecyclerViewActions.actionOnItemAtPosition<BoardsListAdapter.BoardViewHolder>(
|
||||
0, click()
|
||||
0, swipeLeft()
|
||||
)
|
||||
)
|
||||
|
||||
onView(withId(R.id.getLists))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun openBoardLists() {
|
||||
onView(withId(R.id.boardList))
|
||||
.perform(
|
||||
RecyclerViewActions.actionOnItemAtPosition<BoardsListAdapter.BoardViewHolder>(
|
||||
0, click()
|
||||
)
|
||||
)
|
||||
|
||||
onView(withId(R.id.getLists))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.synchronize))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun addNewCard() {
|
||||
onView(withId(R.id.boardList))
|
||||
.perform(
|
||||
RecyclerViewActions.actionOnItemAtPosition<BoardsListAdapter.BoardViewHolder>(
|
||||
0, click()
|
||||
)
|
||||
)
|
||||
|
||||
onView(withId(R.id.getLists))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.buttonAddCard))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.edittext))
|
||||
.perform(typeText("card test"))
|
||||
closeSoftKeyboard()
|
||||
onView(withText("OK"))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.synchronize))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun synchronizeBoard() {
|
||||
onView(withId(R.id.boardList))
|
||||
.perform(
|
||||
RecyclerViewActions.actionOnItemAtPosition<BoardsListAdapter.BoardViewHolder>(
|
||||
1, click()
|
||||
)
|
||||
)
|
||||
|
||||
onView(withId(R.id.getLists))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.synchronize))
|
||||
.perform(click())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun pullToRefresh() {
|
||||
onView(withId(R.id.pullToRefresh))
|
||||
.perform(swipeDown())
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -107,45 +48,5 @@ class BoardsListsActivityTest {
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun newPrivateBoard() {
|
||||
onView(withId(R.id.fab))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.newBoardName))
|
||||
.perform(typeText("test private-board"))
|
||||
closeSoftKeyboard()
|
||||
onView(withId(R.id.newBoardDone))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.fab))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun newPublicBoard() {
|
||||
onView(withId(R.id.fab))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.newBoardName))
|
||||
.perform(typeText("test public-board"))
|
||||
closeSoftKeyboard()
|
||||
onView(withId(R.id.newBoardPermission))
|
||||
.perform(click())
|
||||
onView(withId(R.id.newBoardDone))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.fab))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun cancelNewBoard() {
|
||||
onView(withId(R.id.fab))
|
||||
.perform(click())
|
||||
|
||||
onView(withId(R.id.newBoardCancel))
|
||||
.perform()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,17 +84,4 @@ class LoginActivityTest {
|
||||
.inRoot(withDecorView(not(activityRule.activity.window.decorView)))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun loginWithWrongInstance(){
|
||||
onView(withId(R.id.instanceServer))
|
||||
.perform(typeText("https://duckduckgo.com"))
|
||||
onView(withId(R.id.username))
|
||||
.perform(typeText("username"))
|
||||
onView(withId(R.id.password))
|
||||
.perform(typeText("password"))
|
||||
closeSoftKeyboard()
|
||||
onView(withId(R.id.button))
|
||||
.perform(click())
|
||||
}
|
||||
}
|
@ -32,5 +32,6 @@ class NewBoardActivityTest {
|
||||
.inRoot(withDecorView(not(activityRule.activity.window.decorView)))
|
||||
.check(matches(isDisplayed()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user