Exemplo n.º 1
0
  private static void createPlainQuestion(JPanelFixture panel, AnswerType type, boolean alterPair) {
    createQuestionTitleQuestionCitation(panel, alterPair);
    JComboBoxFixture answerType =
        new JComboBoxFixture(
            panel.robot,
            (JComboBox)
                panel
                    .robot
                    .finder()
                    .find(panel.component(), new NameMatcher("question_answer_type_menu")));
    answerType.selectItem(type.ordinal());

    if (!alterPair && type.equals(AnswerType.CATEGORICAL)) {
      panel.button(withText("Selections")).click();
      fillInCategoricalQuestions(panel.robot);
    } else if (alterPair) {
      panel.button(withText("Selections")).click();

      DialogFixture dialog =
          WindowFinder.findDialog("Category Options").withTimeout(10000).using(panel.robot);
      JComboBoxFixture cmbF = dialog.comboBox();
      cmbF.selectItem(2);

      dialog.list().selectItem(0);
      dialog.button(withText("Mark selected item adjacent")).click();

      dialog.button(withText("OK")).click();
    }
  }
Exemplo n.º 2
0
  @Test
  public void testCenario2() throws SQLException, ClienteException {

    dialog.button("Excluir").click();
    dialog.optionPane().requireMessage("Selecione uma linha!");
    sleep();
    dialog.optionPane().okButton().click();
  }
Exemplo n.º 3
0
  @Test
  public void fullStudyDesign() throws Exception {
    Assert.assertTrue("Location must exist: " + location, new File(location).exists());

    window.menuItemWithPath("File", "New Study").click();
    JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser().using(window.robot);
    fileChooser.fileNameTextBox().enterText(location + "/" + studyName);
    fileChooser.approve();

    window.textBox("study_num_alters_field").deleteText().enterText("15");
    window.radioButton("btnAlterModelRandomSubset").click();
    window.textBox("txtAlterModelRandomSubset").deleteText().enterText("5");

    JTabbedPaneFixture tabs = window.tabbedPane();

    // ego questions
    tabs.selectTab("Ego");
    window.robot.waitForIdle(); // there's some funky creation going on here
    AuthoringQuestionPanel egoPanel0 = findQPanel(window.robot.finder(), QuestionType.EGO);
    JPanelFixture egoPanel = new JPanelFixture(window.robot, egoPanel0);

    createPlainQuestion(egoPanel, AnswerType.CATEGORICAL);
    createPlainQuestion(egoPanel, AnswerType.NUMERICAL);
    createPlainQuestion(egoPanel, AnswerType.TEXT);

    // alter prompt
    tabs.selectTab("Alter Prompt");
    PromptPanel alterpromptPanel0 = findPromptPanel(window.robot.finder());
    JPanelFixture altrerpromptPanel = new JPanelFixture(window.robot, alterpromptPanel0);

    createQuestionTitleQuestionCitation(altrerpromptPanel);

    // alter
    tabs.selectTab("Alter");
    AuthoringQuestionPanel alterPanel0 = findQPanel(window.robot.finder(), QuestionType.ALTER);
    JPanelFixture alterPanel = new JPanelFixture(window.robot, alterPanel0);

    createPlainQuestion(alterPanel, AnswerType.CATEGORICAL);
    createPlainQuestion(alterPanel, AnswerType.NUMERICAL);
    createPlainQuestion(alterPanel, AnswerType.TEXT);

    // alter pair
    tabs.selectTab("Alter Pair");
    window.robot.waitForIdle(); // there's some funky creation going on here
    AuthoringQuestionPanel alterPairPanel0 =
        findQPanel(window.robot.finder(), QuestionType.ALTER_PAIR);
    JPanelFixture alterPairPanel = new JPanelFixture(window.robot, alterPairPanel0);

    createPlainQuestion(alterPairPanel, AnswerType.CATEGORICAL, true);

    window.menuItemWithPath("File", "Quit").click();
    DialogFixture dialog =
        WindowFinder.findDialog(DialogByTitleMatcher.withTitle("Save Study Changes"))
            .withTimeout(5000)
            .using(window.robot);
    dialog.button(withText("Yes")).click();
  }
Exemplo n.º 4
0
  private static void fillInCategoricalQuestions(Robot robot) {
    DialogFixture dialog =
        WindowFinder.findDialog("Category Options").withTimeout(10000).using(robot);
    JComboBoxFixture cmbF = dialog.comboBox();
    String[] poss = cmbF.contents();

    int sel = (int) (Math.random() * poss.length);
    cmbF.selectItem(sel);
    dialog.button(withText("OK")).click();
  }
Exemplo n.º 5
0
  private static void enterProjectNameAndWsdlUrlAndClickOk(Robot robot) {
    DialogFixture newProjectDialog =
        FestMatchers.dialogWithTitle(NEW_SOAP_PROJECT_DIALOG_NAME)
            .withTimeout(NEW_PROJECT_TIMEOUT)
            .using(robot);

    newProjectDialog.textBox(WSDL_FIELD_NAME).setText(TEST_WSDL);

    JButtonFixture buttonOK = newProjectDialog.button(FestMatchers.buttonWithText(OK_BUTTON_NAME));
    buttonOK.click();
  }
Exemplo n.º 6
0
  @Test
  public void testCenario1() throws SQLException, ClienteException {
    dialog.table("tabelaPatrimonio").selectRows(index);
    dialog.button("Excluir").click();
    dialog.optionPane().requireMessage("Deseja mesmo excluir Sala: " + sala.getDescricao() + "?");
    sleep();
    dialog.optionPane().yesButton().click();
    sleep();
    dialog.optionPane().requireMessage("Sala excluida com sucesso");

    sala = null;
  }
Exemplo n.º 7
0
 @Test
 public void testBug70() throws FileNotFoundException, CDKException {
   JPanelFixture jcppanel = applet.panel("appletframe");
   JChemPaintPanel panel = (JChemPaintPanel) jcppanel.target;
   applet.button("hexagon").click();
   applet.click();
   Point2d point = getAtomPoint(panel, 0);
   applet
       .panel("renderpanel")
       .robot
       .click(
           applet.panel("renderpanel").component(),
           new Point((int) point.x, (int) point.y),
           MouseButton.RIGHT_BUTTON,
           1);
   applet
       .panel("renderpanel")
       .robot
       .click(
           applet.panel("renderpanel").component(),
           new Point((int) point.x, (int) point.y),
           MouseButton.RIGHT_BUTTON,
           1);
   applet.menuItem("showACProperties").click();
   DialogFixture dialog = applet.dialog();
   JTextComponent textfield = dialog.robot.finder().find(JTextComponentMatcher.withName("Title"));
   textfield.setText("aaa");
   JButtonFixture okbutton =
       new JButtonFixture(
           dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("OK")));
   okbutton.click();
   applet.menuItem("save").click();
   dialog = applet.dialog();
   File file = new File(System.getProperty("java.io.tmpdir") + File.separator + "test.mol");
   if (file.exists()) file.delete();
   JComboBox combobox =
       dialog
           .robot
           .finder()
           .find(new ComboBoxTextComponentMatcher("org.openscience.jchempaint.io.JCPFileFilter"));
   combobox.setSelectedItem(combobox.getItemAt(SAVE_AS_MOL_COMBOBOX_POS));
   JTextComponentFixture text = dialog.textBox();
   text.setText(file.toString());
   JButtonFixture savebutton =
       new JButtonFixture(
           dialog.robot, dialog.robot.finder().find(new ButtonTextComponentMatcher("Save")));
   savebutton.click();
   MDLReader reader = new MDLReader(new FileInputStream(file));
   IAtomContainer mol =
       (IAtomContainer)
           reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
   Assert.assertEquals("aaa", (String) mol.getProperty(CDKConstants.TITLE));
 }
Exemplo n.º 8
0
  @Before
  public void onSetUp() {
    AboutDialog aboutDialog =
        GuiActionRunner.execute(
            new GuiQuery<AboutDialog>() {
              protected AboutDialog executeInEDT() {
                return new AboutDialog(null, false);
              }
            });

    aboutFixture = new DialogFixture(aboutDialog);
    aboutFixture.show();
  }
Exemplo n.º 9
0
 @Test
 public void testDisplays() {
   aboutFixture.requireVisible();
   aboutFixture.button("ok button").click();
   aboutFixture.requireNotVisible();
 }
Exemplo n.º 10
0
 @After
 public void tearDown() {
   aboutFixture.cleanUp();
 }