- mid commit

Took 4 hours 2 minutes
This commit is contained in:
2023-05-12 16:26:15 +01:00
parent 243a20a9c4
commit 068bd2068e
19 changed files with 199 additions and 13 deletions

View File

@@ -1,5 +1,8 @@
package h_mal.appttude.com.driver.robots
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.matcher.ViewMatchers.withId
import h_mal.appttude.com.driver.BaseTestRobot
import h_mal.appttude.com.driver.R
@@ -8,4 +11,20 @@ class HomeRobot : BaseTestRobot() {
fun checkTitleExists(title: String) = matchText(R.id.prova_title_tv, title)
fun openDrawer() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
}
fun closeDrawer() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.close())
}
fun updateProfile() {
openDrawer()
clickButton(R.id.nav_user_settings)
}
fun openDriverProfile() = clickButton(R.id.driver)
fun openVehicleProfile() = clickButton(R.id.car)
}

View File

@@ -1,24 +0,0 @@
package h_mal.appttude.com.driver.robots
import h_mal.appttude.com.driver.BaseTestRobot
import h_mal.appttude.com.driver.R
fun login(func: LoginRobot.() -> Unit) = LoginRobot().apply { func() }
class LoginRobot : BaseTestRobot() {
fun setEmail(email: String?) = fillEditText(R.id.email, email)
fun setPassword(pass: String) = fillEditText(R.id.password, pass)
fun clickLogin() = clickButton(R.id.email_sign_in_button)
fun clickRegister() = clickButton(R.id.register_button)
fun clickForgotPassword() = clickButton(R.id.forgot)
fun checkEmailError(err: String) = checkErrorOnTextEntry(R.id.email, err)
fun checkPasswordError(err: String) = checkErrorOnTextEntry(R.id.password, err)
}

View File

@@ -1,27 +0,0 @@
package h_mal.appttude.com.driver.robots
import h_mal.appttude.com.driver.BaseTestRobot
import h_mal.appttude.com.driver.R
fun register(func: RegisterRobot.() -> Unit) = RegisterRobot().apply { func() }
class RegisterRobot : BaseTestRobot() {
fun setName(name: String) = fillEditText(R.id.name_register, name)
fun setEmail(email: String) = fillEditText(R.id.email_register, email)
fun setPassword(pass: String) = fillEditText(R.id.password_top, pass)
fun setPasswordConfirm(pass: String) = fillEditText(R.id.password_bottom, pass)
fun clickLogin() = clickButton(R.id.email_sign_up)
fun checkNameError(err: String) = checkErrorOnTextEntry(R.id.name_register, err)
fun checkEmailError(err: String) = checkErrorOnTextEntry(R.id.email_register, err)
fun checkPasswordError(err: String) = checkErrorOnTextEntry(R.id.password_top, err)
fun checkPasswordConfirmError(err: String) = checkErrorOnTextEntry(R.id.password_bottom, err)
}

View File

@@ -0,0 +1,17 @@
package h_mal.appttude.com.driver.robots
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.matcher.ViewMatchers.withId
import h_mal.appttude.com.driver.BaseTestRobot
import h_mal.appttude.com.driver.R
fun update(func: UpdateRobot.() -> Unit) = UpdateRobot().apply { func() }
class UpdateRobot : BaseTestRobot() {
fun updateEmail() = clickButton(R.id.update_email_button)
fun updatePassword() = clickButton(R.id.update_password_button)
fun updateProfile() = clickButton(R.id.update_profile_button)
fun deleteProfile() = clickButton(R.id.delete_profile)
}

View File

@@ -33,7 +33,10 @@ class UserAuthenticationActivityTest : FirebaseTest<LoginActivity>(LoginActivity
}
home {
checkTitleExists(getResourceString(R.string.welcome_title))
updateProfile()
}
// TODO: update user details
}
}