Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JTableFixture


    boolean postShipmentFound = false;
    while (!postShipmentFound && tableCount < 10) {

      tableCount++;

      JTableFixture table = dialogFixture
          .table(TableEnum.TABLETRANSPORTORDERS.getTableName() + "1");
      int rowCount = table.target.getRowCount();
      for (int j = 0; j < rowCount; j++) {
        tableRow = j;
        Transportable transportable = ((TransportOrderTableModel) table.target
View Full Code Here


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

    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(
            "MenuItemShowDeviation"));
    menuItem.click();
View Full Code Here

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

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

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

      content = tableFixture.cell(row(row).column(7)).value();
      if (content.indexOf("eX") != -1) {
        withTakstolNotFound = false;
      }

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

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

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

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

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

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

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

    DialogFixture productionUnitDialog = WindowFinder.findDialog(
        "Velg produksjonsenhet").using(dialogFixture.robot);
    productionUnitDialog.comboBox().selectItem("Jig 1");
    productionUnitDialog.button("ButtonOk").click();
   
    DialogFixture articleView = WindowFinder.findDialog(
        "ArticlePackageView").withTimeout(30000).using(
        dialogFixture.robot);
    articleView.button("ButtonOk").click();

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

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

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

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

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

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

    DialogFixture productionUnitDialog = WindowFinder.findDialog(
        "Velg produksjonsenhet").using(dialogFixture.robot);
    productionUnitDialog.comboBox().selectItem("Jig 1");
    productionUnitDialog.button("ButtonOk").click();

    assertEquals(true, tableFixture.cell(row(row).column(7)).value()
        .indexOf("Jig 1") != -1);
    dialogFixture.button("ButtonCancel").click();

  }
View Full Code Here

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

    int row = 0;
    boolean withoutTakstolPackNotFound = true;
    String content;
    Transportable transportable = null;
    while (withoutTakstolPackNotFound) {
      row++;
      transportable = ((ProductionOverviewTableModel) tableFixture.target
          .getModel()).getObjectAtRow(row);
      if (transportable instanceof Order
          && transportable.getTransportString().indexOf(
              "Tilleggsordre") == -1) {

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

    }
    assertEquals(false, withoutTakstolPackNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(7)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemPakkingTakstol").click();
   
    DialogFixture articleView = WindowFinder.findDialog(
        "ArticlePackageView").using(dialogFixture.robot);
    JTableFixture tableFixtureArticles =articleView.table("TableArticles");
    int rows=tableFixtureArticles.rowCount();
    for (int i = 0; i < rows; i++) {
      String test=tableFixtureArticles.cell(row(i).column(1)).value();
      if("false".equalsIgnoreCase(test)){
        tableFixtureArticles.cell(row(i).column(1)).click();
      }
    }
   
    articleView.button("ButtonOk").click();
View Full Code Here

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

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

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

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

    }
    assertEquals(false, withTakstolPackNotFound);
    ((JXTable) tableFixture.target).scrollRowToVisible(row);
    tableFixture.cell(row(row).column(2)).click();
    tableFixture.cell(row(row).column(7)).rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuProduction"));
    popupMenuFixture.menuItem("MenuItemPakkingTakstol").click();
   
    DialogFixture articleView = WindowFinder.findDialog(
        "ArticlePackageView").withTimeout(30000).using(dialogFixture.robot);
    JTableFixture tableFixtureArticles =articleView.table("TableArticles");
    int rows=tableFixtureArticles.rowCount();
    for (int i = 0; i < rows; i++) {
      String test=tableFixtureArticles.cell(row(i).column(1)).value();
      if("true".equalsIgnoreCase(test)){
        tableFixtureArticles.cell(row(i).column(1)).click();
      }
    }

    articleView.button("ButtonOk").click();
    assertEquals(true, tableFixture.cell(row(row).column(7)).value()
View Full Code Here

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

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());
    assertEquals("Prod.dato", tableFixture.target.getColumnName(2));
  }
View Full Code Here

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

    JTableFixture tableFixture = dialogFixture
        .table(TableEnum.TABLEPRODUCTIONOVERVIEW.getTableName());
    assertEquals("Rest", tableFixture.target.getColumnName(11));
  }
View Full Code Here

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

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

    int row = -1;
    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(12)).click();
    procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
    assertNotNull(procentDone);
    assertEquals(Integer.valueOf(30), procentDone.getProcent());
    dialogFixture.button("ButtonCancel").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.