bernard
authored
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package pl.labno.bernard.htmlunified;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.junit.Assert;
import org.junit.Test;
import java.io.IOException;
public class SandboxTest {
@Test
public void test() throws IOException {
final WebClient client = new WebClient(BrowserVersion.FIREFOX_3_6);
client.setAjaxController(new NicelyResynchronizingAjaxController());
HtmlPage page = (HtmlPage) client.getPage("file:./target/test-classes/sandbox.html");
Assert.assertEquals("elementToHide", page.getElementById("elementToHide").asText());
page.getElementById("close").click();
Assert.assertEquals("", page.getElementById("elementToHide").asText());
}
}
|