forked from playframework/play-java-starter-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowserTest.java
More file actions
30 lines (24 loc) · 811 Bytes
/
BrowserTest.java
File metadata and controls
30 lines (24 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import org.junit.Test;
import play.Application;
import play.test.Helpers;
import play.test.TestBrowser;
import play.test.WithBrowser;
import static org.junit.Assert.assertTrue;
import static play.test.Helpers.*;
public class BrowserTest extends WithBrowser {
protected Application provideApplication() {
return fakeApplication(inMemoryDatabase());
}
protected TestBrowser provideBrowser(int port) {
return Helpers.testBrowser(port);
}
/**
* add your integration test here
* in this example we just check if the welcome page is being shown
*/
@Test
public void test() {
browser.goTo("http://localhost:" + play.api.test.Helpers.testServerPort());
assertTrue(browser.pageSource().contains("Your new application is ready."));
}
}