Search in sources :

Example 1 with TargetsPage

use of org.activityinfo.test.pageobject.web.design.TargetsPage in project activityinfo by bedatadriven.

the class TargetsUiTest method statefulTree.

@Test
public void statefulTree() throws Exception {
    background();
    ApplicationPage app = driver.getApplicationPage();
    TargetsPage targets = app.navigateToDesignTab().selectDatabase(driver.alias(DATABASE)).targets();
    targets.select("Target1");
    // expand tree only one time for Target1, then it should be stateful and keep it expanded
    targets.expandTree("nb. kits");
    targets.valueGrid().findCell("1000");
    targets.select("Target2");
    targets.valueGrid().findCell("2000");
    // back to Target1 without expand, tree must be already expanded
    targets.select("Target1");
    targets.valueGrid().findCell("1000");
}
Also used : TargetsPage(org.activityinfo.test.pageobject.web.design.TargetsPage) ApplicationPage(org.activityinfo.test.pageobject.web.ApplicationPage) Test(org.junit.Test)

Example 2 with TargetsPage

use of org.activityinfo.test.pageobject.web.design.TargetsPage in project activityinfo by bedatadriven.

the class TargetsUiTest method targetEdit.

@Test
public void targetEdit() throws Exception {
    background();
    TargetsPage targets = driver.getApplicationPage().navigateToDesignTab().selectDatabase(driver.alias(DATABASE)).targets();
    targets.editTarget("Target1", driver.alias("ARC"), driver.alias("FY2014"));
    targets.targetGrid().findCell(driver.alias("ARC"));
    targets.targetGrid().findCell(driver.alias("FY2014"));
    targets.editTarget("Target1", I18N.CONSTANTS.none(), I18N.CONSTANTS.none());
    assertFalse(targets.targetGrid().findCellOptional(driver.alias("ARC")).isPresent());
}
Also used : TargetsPage(org.activityinfo.test.pageobject.web.design.TargetsPage) Test(org.junit.Test)

Example 3 with TargetsPage

use of org.activityinfo.test.pageobject.web.design.TargetsPage in project activityinfo by bedatadriven.

the class TargetsUiTest method treeEditorStateOnSelectionChange.

@Test
public void treeEditorStateOnSelectionChange() throws Exception {
    background();
    driver.setTargetValues("Target1", Lists.newArrayList(new FieldValue("nb. kits", "1000")));
    TargetsPage targetPage = driver.targetsPage();
    targetPage.select(driver.alias("Target2"));
    // switch back and check whether value is in tree
    targetPage.select(driver.alias("Target1"));
    // value must be present in tree
    assertNotNull(targetPage.valueGrid().findCell("1000"));
}
Also used : TargetsPage(org.activityinfo.test.pageobject.web.design.TargetsPage) FieldValue(org.activityinfo.test.driver.FieldValue) Test(org.junit.Test)

Aggregations

TargetsPage (org.activityinfo.test.pageobject.web.design.TargetsPage)3 Test (org.junit.Test)3 FieldValue (org.activityinfo.test.driver.FieldValue)1 ApplicationPage (org.activityinfo.test.pageobject.web.ApplicationPage)1