use of elemental2.dom.Document in project gwtproject by treblereel.
the class RichTextAreaImplStandard method queryCommandValueAssumingFocus.
String queryCommandValueAssumingFocus(String cmd) {
HTMLIFrameElement iframe = Js.uncheckedCast(elem);
Document document = Js.uncheckedCast(Js.asPropertyMap(iframe.contentWindow).get("document"));
return ((QueryCommandValue) Js.uncheckedCast(Js.asPropertyMap(document).get("queryCommandValue"))).onInvoke(cmd);
}
use of elemental2.dom.Document in project tapestry-5 by apache.
the class TemplateInContextTest method template_in_web_context.
@Test
public void template_in_web_context() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME, "src/test/app2");
Document doc = tester.renderPage("TestPageForTemplateInContext");
assertTrue(doc.toString().contains("How are you?"));
}
use of elemental2.dom.Document in project tapestry-5 by apache.
the class UnlessTest method render.
@Test
public void render() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForUnless");
assertNotNull(doc.getElementById("2"));
assertNotNull(doc.getElementById("4"));
assertNotNull(doc.getElementById("6"));
assertNotNull(doc.getElementById("7"));
assertNull(doc.getElementById("1"));
assertNull(doc.getElementById("3"));
assertNull(doc.getElementById("5"));
assertNull(doc.getElementById("8"));
}
use of elemental2.dom.Document in project tapestry-5 by apache.
the class PageTesterTest method on_activate_chain_is_followed.
@Test(dataProvider = "testers")
public void on_activate_chain_is_followed(PageTester tester) {
Document launchDoc = tester.renderPage("Launch");
Map<String, String> parameters = Collections.emptyMap();
// Submit the form, which will then skip through Intermediate and
// arrive at Final.
Document finalDoc = tester.submitForm(launchDoc.getElementById("form"), parameters);
assertEquals(finalDoc.getElementById("page-name").getChildMarkup(), "Final");
}
use of elemental2.dom.Document in project tapestry-5 by apache.
the class DTDTest method verify_correct_dtds.
@Test(dataProvider = "dtd_page_provider")
public void verify_correct_dtds(String pageName, String expectedDTD, String checkText) {
PageTester tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage(pageName);
String txt = doc.toString();
// use startsWith to make sure the DTD is getting into the right spot.
assertTrue(txt.startsWith(expectedDTD));
// we should also make sure that the other DTD's don't appear anywhere else...
checkOtherDTD(txt, expectedDTD);
// spot check the body of the pages to make sure they correctly rendered...
// they should have, based on the unit tests for template rendering, but...
assertTrue(txt.contains(checkText));
}
Aggregations