我在测试我的应用程序时遇到了问题。我创建了一个 Espresso 测试,该测试应该失败,因为每当我在模拟器中启动我的应用程序时,我都会得到预期的行为。以下是我的测试:
onView(withText("wrong answer")).perform(click());
onView(withId(R.id.nextQuestionButton)).check(matches(isEnabled()));
启动测试时没有任何报告,但是当单击文本为“错误答案”的单选按钮时,不应启用nextQuestionButton。
matches(isEnabled())
,它说我们需要viewAssertion但找到了布尔值!!!!我正在使用Kotlin。 - milad salimimatches(isNotEnabled())
- undefined