在我的IntegrationTest.java类中,我有以下测试
@Test
public void testTableIsPopulated() {
running(testServer(3333, fakeApplication(inMemoryDatabase())), HTMLUNIT, browser -> {
browser.goTo("http://localhost:9000");
assertThat(browser.pageSource(), hasKey("key")));
});
}
无法确定是否在
中生成动态表/views/index.scala.html包含id = key。 这有效地测试表是否填充了值,因为表是使用javascript
填充的 .each(data, function(key, value) {
所以没有关键意味着没有价值。
什么应该替换assertThat
行来确定密钥是否存在?
答案 0 :(得分:0)
browser.goTo("http://localhost:3333");
问题不是assertThat()
,我将请求发送到了错误的端口。