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