private String handle(JTextArea textField, CommandRequest command) { JTextComponentFixture tFixture = new JTextComponentFixture(FestRobotInstance.getRobot(), textField); switch (command.action) { case SET: tFixture.setText(command.value); break; case GET: return tFixture.text(); case CLICK: FestRobotInstance.getRobot().click(textField); break; case CLEAR: tFixture.setText(command.value); default: throw new IllegalArgumentException("Unsupported command for JTextArea: " + command.action.name()); } return null; }
private void tstChromoNav(String chromoText) throws Exception { JTextComponentFixture searchFixture = frame.textBox("searchTextField"); searchFixture.deleteText(); this.enterText = chromoText; //Make sure search box has focus searchFixture.focus(); searchFixture.requireFocused(); searchFixture.requireEmpty(); searchFixture.enterText(chromoText); frame.button("goButton").click(); }
/** * Works in same way as the 'set text' method * * @param value */ @Override @PublicAtsApi public void appendValue( String value ) { new SwingElementState(this).waitToBecomeExisting(); ((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value); }
/** * Get text area value * * @throws VerificationException if the text area element doesn't exist */ @Override @PublicAtsApi public String getValue() { new SwingElementState(this).waitToBecomeExisting(); return ((JTextComponentFixture) SwingElementLocator.findFixture(this)).text(); }
} else if (componentClass.equals(JTextComponent.class)) { return (ComponentFixture<? extends Component>) new JTextComponentFixture(containerFixture.robot, (JTextComponent) findElement(uiElement)); } else if (componentClass.equals(JMenuItem.class)) {
@Test @Ignore(value = "Issue in maven compilation :(") public void displaySimpleJob() throws Exception { createDialog(JOB_WITH_GOOD_PARAMS); // assertEquals("This build requires parameters", uispecDialog.getTitle()); dialogFixture.checkBox("integrationTest").requireSelected(); String[] contents = dialogFixture.comboBox() .requireItemCount(4) .requireSelection("development") .contents(); assertTrue(Arrays.equals(new String[]{"development", "integration", "acceptance", "production"}, contents)); dialogFixture.textBox(JTextComponentMatcher.any()).requireText(""); dialogFixture.button(JButtonMatcher.withText("OK")).requireEnabled(); }
/** * Set text area value * * @param value the value to set * @throws VerificationException if the element doesn't exist */ @Override @PublicAtsApi public void setValue( String value ) { new SwingElementState(this).waitToBecomeExisting(); ((JTextComponentFixture) SwingElementLocator.findFixture(this)).setText(value); }
/** * Get the value of the 'File Name' text field * * @return the text value of the 'File Name' text field */ @Override @PublicAtsApi public String getValue() { new SwingElementState(this).waitToBecomeExisting(); return ((JFileChooserFixture) SwingElementLocator.findFixture(this)).fileNameTextBox().text(); }
/** * Set value in the 'File Name' text field * * @param value the text value to set */ @Override @PublicAtsApi public void setValue( String value ) { new SwingElementState(this).waitToBecomeExisting(); ((JFileChooserFixture) SwingElementLocator.findFixture(this)).fileNameTextBox().setText(value); }
/** * Getting the text of the Text field * * @return the text of the Text field */ @PublicAtsApi public String getText() { new SwingElementState(this).waitToBecomeExisting(); try { return ((JOptionPaneFixture) SwingElementLocator.findFixture(this)).textBox().text(); } catch (ComponentLookupException cle) { throw new ElementNotFoundException(cle.getMessage()); } }
/** * Setting text in the Text field * * @param text the text to set */ @PublicAtsApi public void setText( String text ) { new SwingElementState(this).waitToBecomeExisting(); try { ((JOptionPaneFixture) SwingElementLocator.findFixture(this)).textBox().setText(text); } catch (ComponentLookupException cle) { throw new ElementNotFoundException(cle.getMessage()); } }