Example #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();
    }
  }