use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage in project miso-lims by miso-lims.
the class BulkPoolIT method testMergeSetup.
@Test
public void testMergeSetup() throws Exception {
BulkPoolPage page = BulkPoolPage.getForMerge(getDriver(), getBaseUrl(), Lists.newArrayList(200001L, 200002L), Lists.newArrayList(1, 2));
HandsOnTable table = page.getTable();
List<String> headings = table.getColumnHeadings();
assertEquals(commonColumns.size(), headings.size());
for (String col : commonColumns) {
assertTrue("Check for column: '" + col + "'", headings.contains(col));
}
assertEquals(1, table.getRowCount());
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage in project miso-lims by miso-lims.
the class BulkPoolIT method testAutoCalculateVolumePoolTogether.
@Test
public void testAutoCalculateVolumePoolTogether() {
BulkPoolPage page = BulkPoolPage.getForPoolTogether(getDriver(), getBaseUrl(), Sets.newHashSet(901L, 902L));
HandsOnTable table = page.getTable();
// test default volume
Map<String, String> attrs = Maps.newLinkedHashMap();
attrs.put(Columns.VOLUME, "36.0");
assertColumnValues(table, 0, attrs, "initial volume calculation");
// test auto-calculation when volume is null
attrs.put(Columns.ALIAS, "auto_calculate_pool_together");
attrs.put(Columns.BARCODE, "autocalculatepooltogether");
attrs.put(Columns.VOLUME, null);
fillRow(table, 0, attrs);
assertTrue(page.save(false));
HandsOnTable savedTable = page.getTable();
String savedName = assertAndGetSavedName(savedTable, 0);
attrs.put(Columns.NAME, savedName);
Long savedId = Long.valueOf(savedName.substring(3, savedName.length()));
Pool saved = (Pool) getSession().get(PoolImpl.class, savedId);
attrs.put(Columns.VOLUME, "36.0");
assertPoolAttributes(attrs, saved);
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage in project miso-lims by miso-lims.
the class BulkPoolIT method testOverwriteVolumePoolSeparately.
@Test
public void testOverwriteVolumePoolSeparately() {
// test overwriting auto-calculated volume
BulkPoolPage page = BulkPoolPage.getForPoolSeparately(getDriver(), getBaseUrl(), Sets.newHashSet(901L, 902L));
HandsOnTable table = page.getTable();
Map<String, String> row0 = Maps.newLinkedHashMap();
row0.put(Columns.ALIAS, "no_auto_calculate_pool_together_1");
row0.put(Columns.BARCODE, "noautocalculatepooltogether1");
row0.put(Columns.VOLUME, "10.0");
fillRow(table, 0, row0);
Map<String, String> row1 = Maps.newLinkedHashMap();
row1.put(Columns.ALIAS, "no_auto_calculate_pool_together_2");
row1.put(Columns.BARCODE, "noautocalculatepooltogether2");
row1.put(Columns.VOLUME, "10.0");
fillRow(table, 1, row1);
assertTrue(page.save(false));
HandsOnTable savedTable = page.getTable();
String savedName0 = assertAndGetSavedName(savedTable, 0);
String savedName1 = assertAndGetSavedName(savedTable, 1);
row0.put(Columns.NAME, savedName0);
row1.put(Columns.NAME, savedName1);
Long savedId0 = Long.valueOf(savedName0.substring(3, savedName0.length()));
Long savedId1 = Long.valueOf(savedName1.substring(3, savedName1.length()));
Pool saved0 = (Pool) getSession().get(PoolImpl.class, savedId0);
assertPoolAttributes(row0, saved0);
Pool saved1 = (Pool) getSession().get(PoolImpl.class, savedId1);
assertPoolAttributes(row1, saved1);
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage in project miso-lims by miso-lims.
the class BulkPoolIT method testEditRemoveValues.
@Test
public void testEditRemoveValues() throws Exception {
BulkPoolPage page = BulkPoolPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(200003L));
HandsOnTable table = page.getTable();
// test initial values
Map<String, String> attrs = Maps.newLinkedHashMap();
attrs.put(Columns.NAME, "IPO200003");
attrs.put(Columns.ALIAS, "IPOT_POOL_3");
attrs.put(Columns.BARCODE, "ipobar200003");
attrs.put(Columns.CREATE_DATE, "2017-08-15");
attrs.put(Columns.CONCENTRATION, "6.5");
attrs.put(Columns.VOLUME, "7.92");
attrs.put(Columns.QC_STATUS, "Ready");
assertColumnValues(table, 0, attrs, "loaded");
// make changes
Map<String, String> changes = Maps.newLinkedHashMap();
changes.put(Columns.BARCODE, null);
changes.put(Columns.VOLUME, null);
changes.put(Columns.QC_STATUS, "Not Ready");
fillRow(table, 0, changes);
// unchanged
changes.put(Columns.NAME, attrs.get(Columns.NAME));
changes.put(Columns.ALIAS, attrs.get(Columns.ALIAS));
changes.put(Columns.CREATE_DATE, attrs.get(Columns.CREATE_DATE));
changes.put(Columns.CONCENTRATION, attrs.get(Columns.CONCENTRATION));
assertColumnValues(table, 0, changes, "changes pre-save");
assertTrue(page.save(false));
HandsOnTable savedTable = page.getTable();
assertColumnValues(savedTable, 0, changes, "post-save");
Pool saved = (Pool) getSession().get(PoolImpl.class, 200003L);
assertPoolAttributes(changes, saved);
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage in project miso-lims by miso-lims.
the class BulkPoolIT method testPoolTogetherSetup.
@Test
public void testPoolTogetherSetup() throws Exception {
BulkPoolPage page = BulkPoolPage.getForPoolTogether(getDriver(), getBaseUrl(), Sets.newHashSet(200001L, 200002L));
assertExpectedColumnsAndRows(page.getTable(), commonColumns, 1);
}
Aggregations