Compare commits

..

1 Commits

Author SHA1 Message Date
5d1571f5ff Merge branch 'release/0.1' of kanban/wedroid into master
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2020-01-18 14:58:59 +00:00
4 changed files with 9 additions and 124 deletions

View File

@ -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'

View File

@ -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()
}
}

View File

@ -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())
}
}

View File

@ -32,5 +32,6 @@ class NewBoardActivityTest {
.inRoot(withDecorView(not(activityRule.activity.window.decorView)))
.check(matches(isDisplayed()))
}
}