use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.ListTabbedPage in project miso-lims by miso-lims.
the class ListTablesIT method testTabbedColumnsSort.
private void testTabbedColumnsSort(String listTarget, boolean skipLogin) {
// note that this sorts in a single tab only, as different tabs should not have different columns.
if (!skipLogin) {
login();
}
ListTabbedPage page = getTabbedList(listTarget);
DataTable table = page.getTable();
sortColumns(table, page);
page.clickTab(sortOnTab.get(listTarget));
Set<String> tabHeadings = page.getTabHeadings();
tabHeadings.forEach(tabHeading -> {
page.clickTab(tabHeading);
assertTrue("clicked tab without errors", isStringEmptyOrNull(page.getErrors().getText()));
});
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.ListTabbedPage in project miso-lims by miso-lims.
the class ListTablesIT method testWarningTabbed.
private void testWarningTabbed(String target, String query, String warning, String column) {
ListTabbedPage page = getTabbedList(target);
DataTable table = page.getTable();
table.searchFor(query);
assertTrue(String.format("'%s' column does not contain '%s' warning", column, warning), table.doesColumnContainTooltip(column, warning));
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.ListTabbedPage in project miso-lims by miso-lims.
the class ContainerPageIT method testCreateContainerDialog.
@Test
public void testCreateContainerDialog() {
// goal: ensure clicking to create new MiSeq container goes to the page with the
// correct container model
ListTabbedPage listContainers = ListTabbedPage.getTabbedListPage(getDriver(), getBaseUrl(), ListTarget.CONTAINERS);
String containerName = PlatformType.get("Illumina").getContainerName();
InstrumentModel miseq = (InstrumentModel) getSession().get(InstrumentModel.class, 2L);
SequencingContainerModel model = (SequencingContainerModel) getSession().get(SequencingContainerModel.class, 3L);
String newUrl = listContainers.clickButtonAndGetUrl(ButtonText.ADD + " " + containerName, Lists.newArrayList(miseq.getAlias(), model.getAlias()));
assertTrue(newUrl.matches(".*/miso/container/new/" + model.getId()));
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.ListTabbedPage in project miso-lims by miso-lims.
the class DeleteIT method doTestDelete.
private void doTestDelete(String listTarget, String tab, String search, String selectByColumn, String columnValue, Class<?> clazz, Long id) {
assertNotNull("Couldn't find item in the database", getSession().get(clazz, id));
AbstractListPage page = null;
if (tab == null) {
page = ListPage.getListPage(getDriver(), getBaseUrl(), listTarget);
} else {
ListTabbedPage tabbedPage = ListTabbedPage.getTabbedListPage(getDriver(), getBaseUrl(), listTarget);
tabbedPage.clickTab(tab);
page = tabbedPage;
}
DataTable table = page.getTable();
if (search != null) {
if (table.hasAdvancedSearch() && search.equals(columnValue)) {
table.searchFor("\"" + search + "\"");
} else {
table.searchFor(search);
}
}
List<String> values = table.getColumnValues(selectByColumn);
assertFalse("No values found in column", values.isEmpty());
boolean found = false;
for (int i = 0; i < values.size(); i++) {
if (values.get(i).equals(columnValue)) {
table.checkBoxForRow(i);
found = true;
break;
}
}
assertTrue("Couldn't find item in the list table", found);
AbstractListPage page2 = page.deleteSelected();
assertNotNull("Error deleting item", page2);
DataTable table2 = page2.getTable();
if (search != null) {
table2.searchFor(search);
}
assertFalse("Found item in list table after delete attempt", table2.getColumnValues(selectByColumn).contains(search));
assertNull("Found item in database after delete attempt", getSession().get(clazz, id));
}
use of uk.ac.bbsrc.tgac.miso.webapp.integrationtest.page.ListTabbedPage in project miso-lims by miso-lims.
the class ListTablesIT method testTabbedPageSetup.
private void testTabbedPageSetup(String listTarget, Set<String> targetColumns) {
// Goal: confirm that all expected tabs and columns are present
login();
ListTabbedPage page = getTabbedList(listTarget);
DataTable table = page.getTable();
// confirm expected number of tabs
Set<String> tabs = tabsForTarget.get(listTarget);
Set<String> foundTabs = page.getTabHeadings();
for (String tab : tabs) {
assertTrue("Check for tab '" + tab + "': ", foundTabs.contains(tab));
}
List<String> headings = table.getColumnHeadings();
assertEquals("number of columns", targetColumns.size(), headings.size());
for (String col : targetColumns) {
assertTrue("Check for column: '" + col + "'", headings.contains(col));
}
}
Aggregations