@BeforeMethod
 public void setUp() {
   robot = robotWithNewAwtHierarchy();
   driver = new JFileChooserDriver(robot);
   window = MyWindow.createNew();
   fileChooser = window.fileChooser;
   robot.showWindow(window);
 }
  @Before
  public void setUp() throws PatrimonioException, SQLException {
    robot = BasicRobot.robotWithNewAwtHierarchy();
    robot.settings().delayBetweenEvents(5);

    window = new FrameFixture(robot, new Main2());
    window.show(new Dimension(900, 500)); // shows the frame to test

    sala = new Sala("code", "Sala para testes de aceitacao", "123");
    SalaDAO.getInstance().incluir(sala);

    index = SalaDAO.getInstance().buscarTodos().size() - 1;

    window.button("Sala").click();
    dialog = window.dialog("SalaView");
  }
 @AfterMethod
 public void tearDown() {
   robot.cleanUp();
 }
 @RunsInEDT
 private void hideWindow() {
   hide(window);
   robot.waitForIdle();
 }
 @RunsInEDT
 private void disableFileChooser() {
   disable(fileChooser);
   robot.waitForIdle();
 }
 private void setFileSelectionMode(int filesOnly) {
   setFileSelectionMode(fileChooser, filesOnly);
   robot.waitForIdle();
 }
 private void enableMultipleSelection() {
   setMultipleSelectionEnabled(fileChooser, true);
   robot.waitForIdle();
 }
 private void setFileChooserToSelectFilesAndDirectories() {
   setFileSelectionMode(fileChooser, FILES_AND_DIRECTORIES);
   robot.waitForIdle();
 }
 @Test
 public void should_return_settings_from_Robot() {
   Settings settings = new Settings();
   when(robot.settings()).thenReturn(settings);
   assertThat(driver.settings()).isSameAs(settings);
 }