protected HtmlButton getButtonByCaption(HtmlForm f, String s) { for (HtmlElement b : f.getHtmlElementsByTagName("button")) { if(b.getTextContent().trim().equals(s)) return (HtmlButton)b; } return null; }
protected HtmlButton getButtonByCaption(HtmlForm f, String s) { for (HtmlElement b : f.getElementsByTagName("button")) { if(b.getTextContent().trim().equals(s)) return (HtmlButton)b; } return null; }
protected HtmlButton getButtonByCaption(HtmlForm f, String s) { for (HtmlElement b : f.getHtmlElementsByTagName("button")) { if(b.getTextContent().trim().equals(s)) return (HtmlButton)b; } return null; }
protected HtmlButton getButtonByCaption(HtmlForm f, String s) { for (HtmlElement b : f.getHtmlElementsByTagName("button")) { if (b.getTextContent().trim().equals(s)) { return (HtmlButton) b; } } return null; }
public HtmlButton getButtonByCaption(HtmlForm f, String s) { for (HtmlElement b : f.getElementsByTagName("button")) { if(b.getTextContent().trim().equals(s)) return (HtmlButton)b; } return null; }
public HtmlButton getButtonByCaption(final String caption) throws ElementNotFoundException { for (HtmlElement b : getHtmlElementsByTagName("button")) { if(b.getTextContent().trim().equals(caption)) return (HtmlButton)b; } throw new ElementNotFoundException("button", "caption", caption); }
public HtmlButton getButtonByCaption(final String caption) throws ElementNotFoundException { for (HtmlElement b : getHtmlElementsByTagName("button")) { if(b.getTextContent().trim().equals(caption)) return (HtmlButton)b; } throw new ElementNotFoundException("button", "caption", caption); }
@Test(groups = { "contexts" }) @SpecAssertion(section = "6.7.5", id = "id") public void testBeanWithDefaultQualifier() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct qualifier: true"); }
@Test(groups = { "contexts" }) @SpecAssertion(section = "6.7.5", id = "ie") public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct name: true"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "id") public void testBeanWithDefaultQualifier() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct qualifier: true"); }
protected String getValue(HtmlPage htmlPage, String id, boolean outputText) { if(outputText) { return htmlPage.getElementById(id).getTextContent(); } return htmlPage.getElementById(id).getAttribute("value"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "ie") public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct name: true"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "l") @SpecAssertion(section = CONVERSATION_CONTEXT_EE, id = "e") public void testTransientConversationHasNullId() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Default conversation has null id: true"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "ib") @SpecAssertion(section = CONVERSATION, id = "iaa") public void testBeanWithRequestScope() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct scope: true"); }
@Test(groups = { "contexts" }) @SpecAssertions({ @SpecAssertion(section = "6.7.5", id = "l"), @SpecAssertion(section = "6.7.4", id = "e") }) public void testTransientConversationHasNullId() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Default conversation has null id: true"); }
@Test(groups = { "contexts" }) @SpecAssertions({ @SpecAssertion(section = "6.7.5", id = "ib"), @SpecAssertion(section = "6.7.5", id = "iaa") }) public void testBeanWithRequestScope() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("builtin.jsf")); assert page.getBody().getTextContent().contains("Correct scope: true"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "m") public void testConversationHasDefaultTimeout() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("cumulus.jsf")); assert !isLongRunning(page); // begin a conversation HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "beginConversationButton"); page = beginConversationButton.click(); assert page.getBody().getTextContent().contains("Stratocumulus"); }
@Test(groups = INTEGRATION) @SpecAssertion(section = CONVERSATION, id = "q") public void testEndTransientConversationThrowsException() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("cumulus.jsf")); assert !isLongRunning(page); // try ending a transient conversation HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationAndSwallowException"); page = endConversationButton.click(); assert page.getBody().getTextContent().contains("Hello world!"); }
@Test(groups = { "contexts" }) @SpecAssertion(section = "6.7.5", id = "q") public void testEndTransientConversationThrowsException() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("cumulus.jsf")); assert !isLongRunning(page); // try ending a transient conversation HtmlSubmitInput endConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "endConversationAndSwallowException"); page = endConversationButton.click(); assert page.getBody().getTextContent().contains("Hello world!"); }
@Test @SpecAssertion(section = "6.7.5", id = "m") public void testConversationHasDefaultTimeout() throws Exception { WebClient client = new WebClient(); HtmlPage page = client.getPage(getPath("cumulus.jsf")); assert !isLongRunning(page); // begin a conversation HtmlSubmitInput beginConversationButton = getFirstMatchingElement(page, HtmlSubmitInput.class, "beginConversationButton"); page = beginConversationButton.click(); assert page.getBody().getTextContent().contains("Stratocumulus"); } }