Skip to content
Permalink
Browse files

test Forward/Reverse buttons

  • Loading branch information...
pabender committed Sep 25, 2018
1 parent 985c360 commit fd79cad074996284fa1587ab2eaa9bd2bcf5f227
@@ -300,6 +300,47 @@ public void testSliderMinimumSpeed() {
JUnitUtil.disposeFrame(Bundle.getMessage("ThrottleListFrameTile"), true, true);
}

@Test
public void testForwardButtonPress() {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
ThrottleWindow frame = new ThrottleWindow();
ThrottleFrame panel = new ThrottleFrame(frame);
frame.setExtendedState( frame.getExtendedState()|java.awt.Frame.MAXIMIZED_BOTH );
panel.toFront();

ThrottleOperator to = new ThrottleOperator(Bundle.getMessage("ThrottleTitle"));

to.setAddressValue(new DccLocoAddress(42,false));

to.pushForwardButton(); // need to verify this took effect.

to.pushReleaseButton();
to.requestClose();
// the throttle list frame gets created above, but needs to be shown to be disposed
InstanceManager.getDefault(ThrottleFrameManager.class).showThrottlesList();
}

@Test
public void testReverseButtonPress() {
Assume.assumeFalse(GraphicsEnvironment.isHeadless());
ThrottleWindow frame = new ThrottleWindow();
ThrottleFrame panel = new ThrottleFrame(frame);
frame.setExtendedState( frame.getExtendedState()|java.awt.Frame.MAXIMIZED_BOTH );
panel.toFront();

ThrottleOperator to = new ThrottleOperator(Bundle.getMessage("ThrottleTitle"));

to.setAddressValue(new DccLocoAddress(42,false));

to.pushReverseButton(); // need to verify this took effect.

to.pushReleaseButton();
to.requestClose();
// the throttle list frame gets created above, but needs to be shown to be disposed
InstanceManager.getDefault(ThrottleFrameManager.class).showThrottlesList();
}


@Before
public void setUp() {
JUnitUtil.setUp();
@@ -217,6 +217,16 @@ public void pushEStopButton(){
Bundle.getMessage("ButtonStop")).push();
}

public void pushForwardButton(){
new JRadioButtonOperator(getControlPanelOperator(),
Bundle.getMessage("ButtonForward")).push();
}

public void pushReverseButton(){
new JRadioButtonOperator(getControlPanelOperator(),
Bundle.getMessage("ButtonReverse")).push();
}

public int getSpeedSliderValue(){
return new JSliderOperator(getControlPanelOperator()).getValue();
}

0 comments on commit fd79cad

Please sign in to comment.
You can’t perform that action at this time.