1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-04 15:24:12 +01:00
Arduino/app/test/processing/app/ReplacingTextGeneratesTwoUndoActionsTest.java
Federico Fissore af1828a00a GUI tests:
- refactored to execute GUI code in swing thread
- added failing test the check escape keypress behaviour con save/close modal dialog see #1279
2013-02-27 11:42:16 +01:00

40 lines
1.1 KiB
Java

package processing.app;
import org.fest.swing.fixture.JMenuItemFixture;
import org.junit.Test;
import processing.app.helpers.JEditTextAreaFixture;
import processing.app.syntax.JEditTextArea;
import static org.junit.Assert.assertEquals;
public class ReplacingTextGeneratesTwoUndoActionsTest extends AbstractGUITest {
@Test
public void shouldUndoAndRedo() throws Exception {
JMenuItemFixture menuEditUndo = window.menuItem("menuEditUndo");
menuEditUndo.requireDisabled();
JMenuItemFixture menuEditRedo = window.menuItem("menuEditRedo");
menuEditRedo.requireDisabled();
JEditTextAreaFixture jEditTextArea = window.jEditTextArea("editor");
jEditTextArea.setText("fake text");
menuEditUndo.requireEnabled();
menuEditUndo.click();
assertEquals("", jEditTextArea.getText());
menuEditRedo.requireEnabled();
menuEditRedo.click();
//assertEquals("fake text", jEditTextArea.getText());
menuEditUndo.requireEnabled();
menuEditUndo.click();
menuEditUndo.click();
menuEditUndo.requireDisabled();
menuEditRedo.requireEnabled();
}
}