Search in sources :

Example 1 with HandsOnTable

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForPropogateMany.

@Test
public void testRemoveLibraryVolumeForPropogateMany() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForPropagate(getDriver(), getBaseUrl(), Sets.newHashSet(802L, 803L));
    HandsOnTable table = page.getTable();
    Map<String, String> row0 = Maps.newLinkedHashMap();
    row0.put(LibraryAliquotColumns.VOLUME_USED, "12.34");
    row0.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    Map<String, String> row1 = Maps.newLinkedHashMap();
    row1.put(LibraryAliquotColumns.VOLUME_USED, "110.2");
    row1.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, row0);
    fillRow(table, 1, row1);
    assertColumnValues(table, 0, row0, "pre-save row 0");
    assertColumnValues(table, 1, row1, "pre-save row 1");
    assertTrue(page.save(true));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, row0, "post-save row 0");
    assertColumnValues(savedTable, 1, row1, "post-save row 1");
    Long newId0 = getSavedId(savedTable, 0);
    LibraryAliquot saved0 = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId0);
    assertLibraryAliquotAttributes(row0, saved0);
    Long newId1 = getSavedId(savedTable, 1);
    LibraryAliquot saved1 = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId1);
    assertLibraryAliquotAttributes(row1, saved1);
    LibraryImpl savedLib0 = (LibraryImpl) getSession().get(LibraryImpl.class, saved0.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 87.66, savedLib0.getVolume()), compareDoubles(savedLib0.getVolume(), "87.66"));
    LibraryImpl savedLib1 = (LibraryImpl) getSession().get(LibraryImpl.class, saved1.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", -10.2, savedLib1.getVolume()), compareDoubles(savedLib1.getVolume(), "-10.2"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 2 with HandsOnTable

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testVolumeUsedNoWarning.

@Test
public void testVolumeUsedNoWarning() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForPropagate(getDriver(), getBaseUrl(), Sets.newHashSet(701L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "99.99");
    attrs.put(LibraryAliquotColumns.QC_STATUS, "Not Ready");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue("Expected library volume to be positive, received negative value", savedLib.getVolume().compareTo(BigDecimal.ZERO) > 0);
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 3 with HandsOnTable

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testRepropagateSetup.

@Test
public void testRepropagateSetup() throws Exception {
    // Goal: ensure all expected fields are present and no extra
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForRepropagate(getDriver(), getBaseUrl(), Sets.newHashSet(304L));
    Set<String> expectedColumns = Sets.newHashSet();
    expectedColumns.addAll(commonColumns);
    expectedColumns.addAll(propagateColumns);
    HandsontableUtils.testTableSetup(page, expectedColumns, 1);
    HandsOnTable table = page.getTable();
    assertEquals("DILT_0001_nn_n_PE_304_WG", table.getText(LibraryAliquotColumns.PARENT_ALIAS, 0));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) Test(org.junit.Test)

Example 4 with HandsOnTable

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForEditFromNullVolUsed.

@Test
public void testRemoveLibraryVolumeForEditFromNullVolUsed() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(1002L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "32.4");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 67.6, savedLib.getVolume()), compareDoubles(savedLib.getVolume(), "67.6"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Example 5 with HandsOnTable

use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable in project miso-lims by miso-lims.

the class BulkLibraryAliquotIT method testRemoveLibraryVolumeForEdit.

@Test
public void testRemoveLibraryVolumeForEdit() {
    BulkLibraryAliquotPage page = BulkLibraryAliquotPage.getForEdit(getDriver(), getBaseUrl(), Sets.newHashSet(1001L));
    HandsOnTable table = page.getTable();
    Map<String, String> attrs = Maps.newLinkedHashMap();
    attrs.put(LibraryAliquotColumns.VOLUME_USED, "50.2");
    fillRow(table, 0, attrs);
    assertColumnValues(table, 0, attrs, "pre-save");
    assertTrue(page.save(false));
    HandsOnTable savedTable = page.getTable();
    assertColumnValues(savedTable, 0, attrs, "post-save");
    Long newId = getSavedId(savedTable, 0);
    LibraryAliquot saved = (LibraryAliquot) getSession().get(LibraryAliquot.class, newId);
    assertLibraryAliquotAttributes(attrs, saved);
    LibraryImpl savedLib = (LibraryImpl) getSession().get(LibraryImpl.class, saved.getLibrary().getId());
    assertTrue(String.format("Expected library volume to be %f, actual library volume was %f", 49.8, savedLib.getVolume()), compareDoubles(savedLib.getVolume(), "49.8"));
}
Also used : BulkLibraryAliquotPage(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage) HandsOnTable(uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable) LibraryImpl(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl) LibraryAliquot(uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot) Test(org.junit.Test)

Aggregations

HandsOnTable (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.element.HandsOnTable)126 Test (org.junit.Test)123 BulkSamplePage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkSamplePage)48 LinkedHashMap (java.util.LinkedHashMap)34 LibraryImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryImpl)22 BulkLibraryPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryPage)22 BulkQCPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkQCPage)18 BulkLibraryAliquotPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkLibraryAliquotPage)17 BulkPoolPage (uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.BulkPoolPage)16 Pool (uk.ac.bbsrc.tgac.miso.core.data.Pool)14 PoolImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.PoolImpl)14 DetailedLibrary (uk.ac.bbsrc.tgac.miso.core.data.DetailedLibrary)12 LibraryAliquot (uk.ac.bbsrc.tgac.miso.core.data.impl.LibraryAliquot)12 HashMap (java.util.HashMap)10 Project (uk.ac.bbsrc.tgac.miso.core.data.Project)8 ProjectImpl (uk.ac.bbsrc.tgac.miso.core.data.impl.ProjectImpl)8 BigDecimal (java.math.BigDecimal)6 LibraryQC (uk.ac.bbsrc.tgac.miso.core.data.qc.LibraryQC)4 PoolQC (uk.ac.bbsrc.tgac.miso.core.data.qc.PoolQC)4 SampleQC (uk.ac.bbsrc.tgac.miso.core.data.qc.SampleQC)3