use of org.netbeans.jemmy.operators.JCheckBoxOperator in project JMRI by JMRI.
the class OperationsSetupFrameTest method testDirectionCheckBoxes.
@Test
public void testDirectionCheckBoxes() {
// it may be possible to make this a headless test by only initializing the panel, not the frame
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
OperationsSetupFrame f = new OperationsSetupFrame();
// entire panel must be visible for tests to work properly
f.setLocation(0, 0);
f.initComponents();
JFrameOperator jfo = new JFrameOperator(Bundle.getMessage("TitleOperationsSetup"));
// first confirm that setup has all directions selected
Assert.assertEquals("All directions selected", Setup.EAST + Setup.WEST + Setup.NORTH + Setup.SOUTH, Setup.getTrainDirection());
JCheckBoxOperator northCheckBoxOperator = new JCheckBoxOperator(jfo, Bundle.getMessage("northsouth"));
JCheckBoxOperator eastCheckBoxOperator = new JCheckBoxOperator(jfo, Bundle.getMessage("eastwest"));
// both east/west and north/south checkboxes should be set
Assert.assertTrue("North selected", northCheckBoxOperator.isSelected());
Assert.assertTrue("East selected", eastCheckBoxOperator.isSelected());
northCheckBoxOperator.push();
Assert.assertFalse("North deselected", northCheckBoxOperator.isSelected());
Assert.assertTrue("East selected", eastCheckBoxOperator.isSelected());
eastCheckBoxOperator.push();
Assert.assertTrue("North selected", northCheckBoxOperator.isSelected());
Assert.assertFalse("East deselected", eastCheckBoxOperator.isSelected());
eastCheckBoxOperator.push();
Assert.assertTrue("North selected", northCheckBoxOperator.isSelected());
Assert.assertTrue("East selected", eastCheckBoxOperator.isSelected());
// done
f.dispose();
}
use of org.netbeans.jemmy.operators.JCheckBoxOperator in project JMRI by JMRI.
the class OperationsSwingTestCase method enterClickAndLeave.
protected void enterClickAndLeave(JCheckBox comp) {
JCheckBoxOperator jbo = new JCheckBoxOperator(comp);
jbo.doClick();
}
Aggregations