我正在尝试通过浓缩咖啡测试登录屏幕UI功能
我如何模拟活动,因为它需要在测试之前启动活动。
我正在活动中初始化aws
override fun onCreate(savedInstanceState: Bundle?) {
(application as App).getAwsSessionComponent().inject(this)
}
我在上述行中遇到错误,在进行浓缩咖啡测试时,如何跳过实际的aws会话创建
我试着编写如下测试用例
@Rule
@JvmField
var mActivityScenarioRule = ActivityScenarioRule(LoginActivity::class.java)
@Test
fun testLoginSuccess() {
onView(ViewMatchers.withId(R.id.edittext_login_email))
.perform(typeText("xyz@email.com"))
onView(ViewMatchers.withId(R.id.edittext_login_password))
.perform(typeText("pwd123"))
onView(ViewMatchers.withId(R.id.button_login))
.perform(click())
}
软件功能测试表