use of org.activityinfo.test.driver.model.IndicatorLink in project activityinfo by bedatadriven.
the class UiApplicationDriver method createLinkIndicators.
@Override
public void createLinkIndicators(List<IndicatorLink> linkedIndicatorRows) {
LinkIndicatorsPage linkIndicatorsPage = getLinkIndicatorPage();
linkIndicatorsPage.getSourceDb().waitUntilAtLeastOneRowIsLoaded();
linkIndicatorsPage.getTargetDb().waitUntilAtLeastOneRowIsLoaded();
for (IndicatorLink row : linkedIndicatorRows) {
linkIndicatorsPage.getSourceDb().clickCell(aliasTable.getAlias(row.getSourceDb()));
linkIndicatorsPage.getTargetDb().clickCell(aliasTable.getAlias(row.getDestDb()));
// sometimes it's too fast and we have to give time show "Loading" and only then wait for rows
Tester.sleepSeconds(1);
GxtGrid sourceIndicator = linkIndicatorsPage.getSourceIndicator().waitUntilAtLeastOneRowIsLoaded();
GxtGrid targetIndicator = linkIndicatorsPage.getTargetIndicator().waitUntilAtLeastOneRowIsLoaded();
sourceIndicator.clickCell(aliasTable.getAlias(row.getSourceIndicator()));
targetIndicator.clickCell(aliasTable.getAlias(row.getDestIndicator()));
linkIndicatorsPage.linkSelection();
}
}
use of org.activityinfo.test.driver.model.IndicatorLink in project activityinfo by bedatadriven.
the class UiApplicationDriver method assertLinkedIndicatorsMarked.
public void assertLinkedIndicatorsMarked(List<IndicatorLink> linkedIndicatorRows, boolean marked) {
LinkIndicatorsPage linkIndicatorsPage = getLinkIndicatorPage();
linkIndicatorsPage.getSourceDb().waitUntilAtLeastOneRowIsLoaded();
linkIndicatorsPage.getTargetDb().waitUntilAtLeastOneRowIsLoaded();
for (IndicatorLink row : linkedIndicatorRows) {
Preconditions.checkState(linkIndicatorsPage.getSourceDb().findCell(aliasTable.getAlias(row.getSourceDb())).hasIcon(), marked);
Preconditions.checkState(linkIndicatorsPage.getTargetDb().findCell(aliasTable.getAlias(row.getDestDb())).hasIcon(), marked);
linkIndicatorsPage.getSourceDb().clickCell(aliasTable.getAlias(row.getSourceDb()));
linkIndicatorsPage.getTargetDb().clickCell(aliasTable.getAlias(row.getDestDb()));
GxtGrid sourceIndicator = linkIndicatorsPage.getSourceIndicator().waitUntilAtLeastOneRowIsLoaded();
GxtGrid targetIndicator = linkIndicatorsPage.getTargetIndicator().waitUntilAtLeastOneRowIsLoaded();
Preconditions.checkState(sourceIndicator.findCell(aliasTable.getAlias(row.getSourceIndicator())).hasIcon(), marked);
Preconditions.checkState(targetIndicator.findCell(aliasTable.getAlias(row.getDestIndicator())).hasIcon(), marked);
}
}
Aggregations