/** * @see Component */ @Override public String toString() { return super.toString() + ", text:" + text() + ", reference:" + reference(); } }
@Test public void test_link_reference() { Link link = new Link(evaluator, id); when(evaluator.reference(link)).thenReturn("http://linkReference"); assertThat(link.reference(), is("http://linkReference")); }
/** * @see org.testatoo.core.Evaluator */ @Override public void click(Component component, Click which) { try { setFocus(component); if (which == Click.right) { evaljQuery("$('#" + component.id() + "').simulate('rightclick')"); } else { // If component is link we need to open the expected target // Not sure but some Browser seems have a security check to not open page on js event if (component instanceof Link && !((Link) component).reference().equals("#")) { selenium.click(component.id()); } else { evaljQuery("$('#" + component.id() + "').simulate('click')"); } } } catch (Exception e) { // Continue... if the click change page } }