Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JTableFixture


  public void testShowContentForPostShipment() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");
    // dialogFixture.checkBox("CheckBoxFilter").uncheck();

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = -1;
    boolean postShipmentNotFound = true;

    Transportable transportable = null;
    int maxRow = tableFixture.target.getRowCount();
    while (postShipmentNotFound && row < maxRow - 1) {

      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);
      if (transportable instanceof PostShipment) {
        postShipmentNotFound = false;
      }
    }
    assertEquals(false, postShipmentNotFound);
    if (!postShipmentNotFound) {
      ((JXTable) tableFixture.target).scrollRowToVisible(row);

      tableFixture.cell(row(row).column(2)).click();
      tableFixture.cell(row(row).column(2)).rightClick();
      JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
          dialogFixture.robot, (JPopupMenu) dialogFixture.robot
              .finder().findByName("PopupMenuProduction"));
      popupMenuFixture.menuItem("MenuItemShowContent").click();
View Full Code Here


  @Test
  public void testSetFrontProducedForOrder() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = 0;
    boolean orderWithoutFrontNotFound = true;
    String content;
    Transportable transportable = null;
    while (orderWithoutFrontNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {

        content = tableFixture.cell(row(row).column(5)).value();
        if (content.indexOf("e") != -1 && content.indexOf("X") == -1) {
          orderWithoutFrontNotFound = false;
        }
      }

    }
    assertEquals(false, orderWithoutFrontNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(5)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemFront").click();

    assertEquals(true, tableFixture.cell(row(row).column(5)).value()
        .indexOf("X") != -1);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

  @Test
  public void testSetFrontNotProducedForOrder() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = -1;
    boolean orderWithFrontNotFound = true;
    String content;
    while (orderWithFrontNotFound) {
      row++;

      content = tableFixture.cell(row(row).column(5)).value();
      if (content.indexOf("X") != -1) {
        orderWithFrontNotFound = false;
      }

    }
    assertEquals(false, orderWithFrontNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(5)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemFront").click();

    assertEquals(true, tableFixture.cell(row(row).column(5)).value()
        .indexOf("X") == -1);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

  @Test
  public void testSetGavlProduced() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = 0;
    boolean withoutGavlNotFound = true;
    String content;
    Transportable transportable = null;
    while (withoutGavlNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order
          && transportable.getProductAreaGroup()
              .getProductAreaGroupName()
              .equalsIgnoreCase("Garasje")
          && transportable.getTransportString().indexOf(
              "Tilleggsordre") == -1) {

        content = tableFixture.cell(row(row).column(6)).value();

        if (content.length()>1&&content.indexOf("X") == -1) {
          withoutGavlNotFound = false;
        }
      }

    }
    assertEquals(false, withoutGavlNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(6)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemGavl").click();

    assertEquals(true, tableFixture.cell(row(row).column(6)).value()
        .indexOf("X") != -1);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

  @Test
  public void testSetGavlNotProduced() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = -1;
    boolean withGavlNotFound = true;
    String content;
    while (withGavlNotFound) {
      row++;

      content = tableFixture.cell(row(row).column(6)).value();
      if (content.indexOf("X") != -1) {
        withGavlNotFound = false;
      }

    }
    assertEquals(false, withGavlNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(6)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemGavl").click();

    assertEquals(true, tableFixture.cell(row(row).column(6)).value()
        .indexOf("X") == -1);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

  @Test
  public void testSetApplied() {
    dialogFixture.checkBox("CheckBoxFilter").uncheck();

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPACKLIST.getTableName());

    tableFixture.cell(row(0).column(1)).click();

    dialogFixture.button("ButtonApply").requireEnabled();
    dialogFixture.button("ButtonUnapply").requireDisabled();

    dialogFixture.button("ButtonApply").click();

    DialogFixture dateView = new DialogFixture(dialogFixture.robot,
        (JDialog) dialogFixture.robot.finder().findByName("DateView"));
    dateView.button("ButtonOk").click();

    tableFixture.cell(row(0).column(1)).click();

    // dialogFixture.button("ButtonApply").requireDisabled();
    // dialogFixture.button("ButtonUnapply").requireEnabled();
  }
View Full Code Here

          new JYearChooserFinder("YearChooserTransport")).setYear(2010);
      dialogFixture.comboBox("ComboBoxWeeks").target
          .setSelectedIndex(Util.getCurrentWeek() - 2);
      Pause.pause(PAUSE);
    }
    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLETRANSPORTORDERS.getTableName() + "1");
    tableFixture.cell(row(0).column(0)).select();
    tableFixture.cell(row(0).column(0)).doubleClick();

    WindowFinder.findDialog("EditOrderView").withTimeout(10000)
        .using(dialogFixture.robot);
  }
View Full Code Here

      dialogFixture.comboBox("ComboBoxWeeks").target
          .setSelectedIndex(Util.getCurrentWeek() - 2);
      Pause.pause(PAUSE);
    }

    JTableFixture tableFixture = dialogFixture.table("TableOrders");
    tableFixture.cell(row(0).column(0)).select();
    tableFixture.cell(row(0).column(0)).rightClick();

    JMenuItemFixture menuItem = new JMenuItemFixture(dialogFixture.robot,
        (JMenuItem) dialogFixture.robot.finder().findByName(
            "MenuItemSetTransportOrder"));
    menuItem.click();
View Full Code Here

          .setSelectedIndex(Util.getCurrentWeek() - 2);
      Pause.pause(PAUSE);
      oldWeek = true;
    }

    JTableFixture tableFixture = dialogFixture.table("TablePostShipments");
    tableFixture.cell(row(0).column(0)).select();
    tableFixture.cell(row(0).column(0)).rightClick();

    JMenuItemFixture menuItem = new JMenuItemFixture(dialogFixture.robot,
        (JMenuItem) dialogFixture.robot.finder().findByName(
            "MenuItemSetTransportPostShipment"));
    menuItem.click();
View Full Code Here

      dialogFixture.comboBox("ComboBoxWeeks").target
          .setSelectedIndex(Util.getCurrentWeek() - 2);
      Pause.pause(PAUSE);
    }

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLETRANSPORTORDERS.getTableName() + "1");
    String gulvspon = tableFixture.cell(row(0).column(5)).value();
    tableFixture.cell(row(0).column(0)).doubleClick();

    DialogFixture editOrder = WindowFinder.findDialog("EditOrderView")
        .withTimeout(10000).using(dialogFixture.robot);

    editOrder.checkBox("CheckBoxLock").uncheck();
    JTabbedPaneFixture tabbedPane = editOrder
        .tabbedPane("TabbedPaneDeviationArticle");
    tabbedPane.selectTab(1);
    editOrder.button("ButtonEditAll").click();
    DialogFixture editAllDialog = WindowFinder.findDialog(
        "UpdateOrderLineView").using(dialogFixture.robot);
    JScrollBarFixture scrollBar = editAllDialog.scrollPane()
        .verticalScrollBar();
    scrollBar.target.setValue(scrollBar.target.getMaximum());

    JCheckBoxFixture checkBoxGulvspon = editAllDialog
        .checkBox("CheckBoxHar gulvspon");

    if (checkBoxGulvspon.target.isSelected()) {
      checkBoxGulvspon.uncheck();
    } else {
      checkBoxGulvspon.check();
    }

    editAllDialog.button("ButtonOk").click();

    editOrder.button("SaveOrder").click();
    editOrder.button("EditCancelOrder").click();

    dialogFixture.button("ButtonRefresh").click();

    tableFixture = dialogFixture.table(TableEnum.TABLETRANSPORTORDERS
        .getTableName() + "1");
    String gulvspon2 = tableFixture.cell(row(0).column(5)).value();

    assertEquals(true, !gulvspon.equalsIgnoreCase(gulvspon2));

  }
View Full Code Here

TOP

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

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.