示例#1
0
  private static void createQuestionTitleQuestionCitation(JPanelFixture fix, boolean alterPair) {
    fix.button(withText("New")).click();

    NameMatcher titleFieldMatcher = new NameMatcher("question_title_field");
    NameMatcher questionFieldMatcher = new NameMatcher("question_question_field");
    NameMatcher citationFieldMatcher = new NameMatcher("question_citation_field");

    JTextComponentFixture titleText =
        new JTextComponentFixture(
            fix.robot, (JTextField) fix.robot.finder().find(fix.component(), titleFieldMatcher));
    titleText.enterText("Question about " + randomString());

    JTextComponentFixture questionText =
        new JTextComponentFixture(
            fix.robot, (JTextArea) fix.robot.finder().find(fix.component(), questionFieldMatcher));
    if (alterPair) questionText.enterText("question - does $$1 " + randomString() + " with $$2?");
    else questionText.enterText("question - does " + randomString() + "?");

    JTextComponentFixture citationText =
        new JTextComponentFixture(
            fix.robot, (JTextArea) fix.robot.finder().find(fix.component(), citationFieldMatcher));
    citationText.enterText(randomString(10));
  }
  public void findEntryBoxAndEnterValue(String name, double value) {
    JPanelFixture entryBoxArrayPanel = focusedWindow.panel("EntryBoxArrayPanel");
    JPanelFixture enumEntryBox = entryBoxArrayPanel.panel(name + "_YoEntryBox");
    JTextComponentFixture textBox = enumEntryBox.textBox();

    // For some reason deleting, and then entering doesn't seem to work. It only deletes part of the
    // text!?
    // Instead here we have to call setText.
    // textBox.deleteText();
    // textBox.enterText(Double.toString(value) + "\n");

    textBox.setText(Double.toString(value));
    textBox.enterText("\n");
    ThreadTools.sleep(500);
  }
 public void enterSearchText(String text) {
   JPanelFixture searchPanel = focusedWindow.panel("SearchPanel");
   JTextComponentFixture searchTextField = searchPanel.textBox("SearchTextField");
   searchTextField.enterText(text);
 }