Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JTableFixture


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

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

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

    }
    assertEquals(false, orderNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    ((JXTable) tableFixture.target).scrollColumnToVisible(12);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(12)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemSetProcent").click();
View Full Code Here


  public void testSetProcentFinishedSameWeek() {
    dialogFixture.show();
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");

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

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

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

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("30");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

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

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

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

    int row = 0;
    boolean orderNotFound = true;

    Transportable transportable = null;
    ProcentDone procentDone;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);

      if (transportable instanceof Order) {
        // content = tableFixture.cell(row(row).column(12)).contents();
        procentDone = (ProcentDone) tableFixture.target.getValueAt(row,
            12);
        if (procentDone == null || procentDone.getProcent() == 0) {
          orderNotFound = false;
        }

      }

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

    DialogFixture procentdialog = WindowFinder.findDialog(
        "EditProcentDoneView").using(dialogFixture.robot);

    procentdialog.textBox("TextFieldProcent").enterText("30");
    procentdialog.textBox("TextAreaProcentDoneComment").enterText(
        "kommentar");
    procentdialog.button("ButtonOk").click();

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

  @Test
  public void testSetPacklistReadyForOrder() {
    dialogFixture.requireVisible();
    dialogFixture.comboBox("ComboBoxProductAreaGroup").selectItem("Alle");
    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());

    int row = -1;
    boolean orderWithoutPacklistNotFound = true;
    String content;
    Transportable transportable = null;
    while (orderWithoutPacklistNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);
      if (transportable instanceof Order) {
        content = tableFixture.cell(row(row).column(3)).value();
        if (content.equalsIgnoreCase("")) {
          orderWithoutPacklistNotFound = false;
        }
      }
    }
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(3)).click();
    tableFixture.cell(row(row).column(3)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemPacklist").click();

    DialogFixture dateDialog = WindowFinder.findDialog("DateView").using(
        dialogFixture.robot);
    dateDialog.button("ButtonOk").click();

    assertEquals(true, tableFixture.cell(row(row).column(3)).value()
        .length() != 0);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

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

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

    int row = -1;
    boolean orderWithPacklistNotFound = true;
    String content;
    Transportable transportable = null;
    while (orderWithPacklistNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);
      if (transportable instanceof Order) {
        content = tableFixture.cell(row(row).column(3)).value();
        if (!content.equalsIgnoreCase("")) {
          orderWithPacklistNotFound = false;
        }
      }
    }
    assertEquals(false, orderWithPacklistNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(3)).click();
    tableFixture.cell(row(row).column(3)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemPacklist").click();

    assertEquals(true, tableFixture.cell(row(row).column(3)).value()
        .length() == 0);
    dialogFixture.button("ButtonCancel").click();
  }
View Full Code Here

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

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

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

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

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

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

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

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

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

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

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

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

  @Test
  public void testOpenOrder() {
    dialogFixture.requireVisible();

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

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

    Order selectedOrder = productionOverviewViewHandler.getSelectedObject()
        .getOrder();

    final PreventiveActionViewHandler preventiveActionViewHandler = new PreventiveActionViewHandler(
        login, managerRepository);
    DeviationViewHandler deviationViewHandler = new DeviationViewHandler(
        login, managerRepository, preventiveActionViewHandler,
        selectedOrder, true, false, true, null, true);
    when(
        deviationViewHandlerFactory.create(selectedOrder, true, true,
            false, null, false)).thenReturn(deviationViewHandler);

    DeviationOverviewView deviationOverviewView = new DeviationOverviewView(
        preventiveActionViewHandler, deviationViewHandler, false,
        selectedOrder, true, false, true, null, true);
    when(
        deviationOverviewViewFactory.create(deviationViewHandler,
            false, selectedOrder, true, true, false, null, false))
        .thenReturn(deviationOverviewView);

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

  @Test
  public void testShowMissingForOrder() {
    dialogFixture.requireVisible();

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

    int row = -1;
    boolean orderNotFound = true;

    Transportable transportable = null;
    while (orderNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);
      if (transportable instanceof Order) {
        orderNotFound = false;
      }
    }
    assertEquals(false, orderNotFound);
    ((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("MenuItemShowMissing").click();
View Full Code Here

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

    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("MenuItemShowMissing").click();
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.