I am writing an Integration Test with Play! Framework, JUnit and Selenium. My client side web has AngularJS to fullfill the page content. I want to test the content but I cannot get how to do it. Here is my sample code:
HTML view:
...
<ul name="quequeEntityList">
<li class="list-group-item" ng-click="turnClick($index)" ng-repeat="turn in turns"> {{turn.value}}</li>
</ul>
...
JUnit with Selenium test:
@Test
public void loginToControlPanelTest()
{
running(testServer(9000, fakeApplication()),
HTMLUNIT,
new Callback<TestBrowser>()
{
public void invoke(TestBrowser browser)
{
browser.goTo("http://localhost:9000/panel");
browser.await();
System.out.println(browser.find("ul[name='queueEntityList'] > li"));
}
});
}
With this simple test I could get the ul but I want to navigate through the lis and see the generated content, how can I do it?