@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();
}