@Test public void getSecondInVerticalSplitPanel() throws Exception { VerticalSplitPanelElement sp = $(VerticalSplitPanelElement.class).first(); LabelElement label = sp.getSecondComponent(LabelElement.class); String labelText = label.getText(); assertTrue( "The second component of the split panel should be a label" + " containing the text 'Label 2.2'. Actual text: " + labelText, "Label 2.2".equals(labelText)); }
@Test public void getSecondInSplitPanelWithFirstComponent() throws Exception { // This test is for regression checking - getSecond should not return a // non-null element in a tab sheet with only the second component. VerticalSplitPanelElement sp = $(VerticalSplitPanelElement.class).get(1); ButtonElement button = null; // There is no second component, so allow an exception. try { button = sp.getSecondComponent(ButtonElement.class); } catch (Exception e) { } String buttonText = button == null ? "" : button.getText(); assertTrue( "The split panel should not have a second component. Found a button with" + " text " + buttonText, button == null); }