Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JButtonFixture


@GUITest
public class OraclePluginPreferencesPanelUITest extends AbstractPluginPreferencesUITest
{
  @Test
  public void testSaveData() {
    JButtonFixture saveButton = fixture.button("saveButton");
    JCheckBoxFixture initSessionTimezoneCheckBox = fixture.checkBox("initSessionTimezoneCheckBox");
   
    initSessionTimezoneCheckBox.uncheck();
   
    saveButton.click();
    ((OraclePluginPreferencesPanel)classUnderTest).loadData();
    initSessionTimezoneCheckBox.requireNotSelected();
   
    initSessionTimezoneCheckBox.check();
    saveButton.click();
    ((OraclePluginPreferencesPanel)classUnderTest).loadData();
    initSessionTimezoneCheckBox.requireSelected();
  }
View Full Code Here


  @Test
  public void should_auto_scroll_to_JButton() {
    JButton button = window.button;
    Scrolling.scrollToVisible(robot, button);
    new JButtonFixture(robot, button).click();
  }
View Full Code Here

    JDateChooser productionDate = (JDateChooser) dialogFixture.robot
        .finder().findByName("DateChooserProduction");

    productionDate.setDate(Calendar.getInstance().getTime());

    JButtonFixture addCostButton = editDialog.button("ButtonAddCost");
    addCostButton.click();
    DialogFixture kostnadDialog = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName(
            "OrderCostView"));

    kostnadDialog.comboBox("ComboBoxCostType").selectItem("Egenproduksjon");
    kostnadDialog.comboBox("ComboBoxCostUnit").selectItem("Kunde");
    kostnadDialog.textBox("TextFieldAmount").enterText("100");
    kostnadDialog.button("OkOrderCost").click();

    addCostButton.click();
    kostnadDialog = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName(
            "OrderCostView"));

    kostnadDialog.comboBox("ComboBoxCostType").selectItem("Frakt");
    kostnadDialog.comboBox("ComboBoxCostUnit").selectItem("Kunde");
    kostnadDialog.textBox("TextFieldAmount").enterText("200");
    kostnadDialog.button("OkOrderCost").click();

    addCostButton.click();
    kostnadDialog = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName(
            "OrderCostView"));

    kostnadDialog.comboBox("ComboBoxCostType").selectItem("Montering");
View Full Code Here

    JDateChooser productionDate = (JDateChooser) dialogFixture.robot
        .finder().findByName("DateChooserProduction");

    productionDate.setDate(Calendar.getInstance().getTime());

    JButtonFixture addCostButton = editDialog.button("ButtonAddCost");
    addCostButton.click();
    DialogFixture kostnadDialog = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName(
            "OrderCostView"));

    kostnadDialog.comboBox("ComboBoxCostType").selectItem("Egenproduksjon");
    kostnadDialog.comboBox("ComboBoxCostUnit").selectItem("Kunde");
    kostnadDialog.textBox("TextFieldAmount").enterText("100");
    kostnadDialog.button("OkOrderCost").click();

    addCostButton.click();
    kostnadDialog = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName(
            "OrderCostView"));

    kostnadDialog.comboBox("ComboBoxCostType").selectItem("Frakt");
View Full Code Here

        assertTrue(Math.abs(frame.getCurrentRange().getEnd() - end) < limit);


        FrameFixture frameFixture = new FrameFixture(IGV.getMainFrame());
        //Make sure frame has focus, or else homeButton won't work
        JButtonFixture homeButton = frameFixture.button("homeButton");

        homeButton.focus();
        homeButton.click();

        homeButton.focus();
        homeButton.click();

        igv.waitForNotify(500);

        Assert.assertEquals(Globals.CHR_ALL, frame.getChrName());
View Full Code Here

     * @param buttonText button text
     *
     * @return the button fixture
     */
    protected JButtonFixture getButton(final String buttonText) {
        JButtonFixture button = windowFixture.button(new GenericTypeMatcher<JButton>(JButton.class) {
            @Override
            protected boolean isMatching(JButton component) {
                return buttonText.equals(component.getText());
            }
        });
View Full Code Here

    @Test
    public void cancellingDialogReturnsNull() throws Exception {
        Future<CoordinateReferenceSystem> future = showDialog();

        JButtonFixture button = getButton("Cancel");
        button.click();

        CoordinateReferenceSystem crs = retrieveCRS(future);
        assertNull(crs);
    }
View Full Code Here

    }

    @Test
    public void okButtonStateWithListSize() throws Exception {
        showDialog();
        JButtonFixture button = getButton("OK");

        // Filter to a single item - button should be enabled
        JTextComponentFixture textBox = windowFixture.textBox();
        textBox.enterText(UNIQUE_FILTER_STRING);
        windowFixture.robot.waitForIdle();
        button.requireEnabled();

        // Remove filter (no list selection) - button should be disabled
        textBox.deleteText();
        windowFixture.robot.waitForIdle();
        windowFixture.list().requireNoSelection();
        button.requireDisabled();
    }
View Full Code Here

    @Test
    public void toolbarButton_Reset() throws Exception {
        showWithStaticMethod(mapContent);
        mapContent.getViewport().setBounds(SMALL_WORLD);
       
        JButtonFixture button = windowFixture.toolBar().button(JMapFrame.TOOLBAR_RESET_BUTTON_NAME);
       
        button.click();
        windowFixture.robot.waitForIdle();
       
        assertTrue(mapContent.getViewport().getBounds().covers(WORLD));
    }
View Full Code Here

    private void assertToolbarButtonLoadsCorrectTool(String btnName,
            Class<? extends CursorTool> expectedToolClass) throws Exception {
       
        showWithStaticMethod(mapContent);
       
        JButtonFixture button = windowFixture.toolBar().button(btnName);
       
        button.click();
        windowFixture.robot.waitForIdle();
       
        CursorTool cursorTool = ((JMapFrame) windowFixture.component()).getMapPane().getCursorTool();
        if (expectedToolClass == null) {
            assertNull(cursorTool);  
View Full Code Here

TOP

Related Classes of org.fest.swing.fixture.JButtonFixture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.