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();
procentdialog = WindowFinder.findDialog("EditProcentDoneView").using(
dialogFixture.robot);
procentdialog.comboBox("ComboBoxWeek").selectItem(
Util.getCurrentWeek() + 1);
procentdialog.textBox("TextFieldProcent").deleteText();
procentdialog.textBox("TextFieldProcent").enterText("20");
procentdialog.button("ButtonOk").click();
JOptionPaneFixture optionPane = JOptionPaneFinder.findOptionPane()
.using(dialogFixture.robot);
optionPane.buttonWithText("Ja").click();
procentDone = (ProcentDone) tableFixture.target.getValueAt(row, 12);
assertNotNull(procentDone);
assertEquals(Integer.valueOf(20), procentDone.getProcent());
dialogFixture.button("ButtonCancel").click();
}