faruktoptas / espresso-robot-pattern-sample

Espresso Robot Pattern Sample with Spoon Integration

Home Page:https://medium.com/android-bits/espresso-robot-pattern-in-kotlin-fc820ce250f7

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Espresso Robot Pattern Sample with Spoon Integration

A showcase project for Espresso Robot pattern written in Kotlin. See the medium posts for more details:

!gif

@Test
fun loginMissingEmailPassword() {
    login {
        clickLogin()
        matchErrorText(string(R.string.missing_fields))
    }
}

@Test
fun loginMissingPassword() {
    login {
        setEmail("mail@example.com")
        clickLogin()
        matchErrorText(string(R.string.missing_fields))
    }
}

@Test
fun loginWrongPassword() {
    login {
        setEmail("mail@example.com")
        setPassword("wrong")
        clickLogin()
        matchErrorText(string(R.string.login_fail))
    }

}

@Test
fun loginSuccess() {
    login {
        setEmail("mail@example.com")
        setPassword("pass")
        clickLogin()
        matchText(R.id.tvName, string(R.string.name_surname))
    }
}

@Test
fun loginProfileAndSettings() {
    login {
        setEmail("mail@example.com")
        setPassword("pass")
        clickLogin()
    }
    profile {
        clickSettings()
        toggleNotifications()
        toggleNightMode()
    }
}

About

Espresso Robot Pattern Sample with Spoon Integration

https://medium.com/android-bits/espresso-robot-pattern-in-kotlin-fc820ce250f7

License:Apache License 2.0


Languages

Language:Kotlin 87.7%Language:Java 12.3%