Skip to content

faruktoptas/espresso-robot-pattern-sample

Repository files navigation

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("[email protected]")
        clickLogin()
        matchErrorText(string(R.string.missing_fields))
    }
}

@Test
fun loginWrongPassword() {
    login {
        setEmail("[email protected]")
        setPassword("wrong")
        clickLogin()
        matchErrorText(string(R.string.login_fail))
    }

}

@Test
fun loginSuccess() {
    login {
        setEmail("[email protected]")
        setPassword("pass")
        clickLogin()
        matchText(R.id.tvName, string(R.string.name_surname))
    }
}

@Test
fun loginProfileAndSettings() {
    login {
        setEmail("[email protected]")
        setPassword("pass")
        clickLogin()
    }
    profile {
        clickSettings()
        toggleNotifications()
        toggleNightMode()
    }
}