mardi 7 juillet 2015

Linking Java Pages If Statement Problems ?

So I think this a easy question but I just cant figure it out. I have two page in java one where everything is defined etc then one where it is called to be used in a test.

The problem I am now having is that when I go to call it inside an if statement it just doesn't work.

Before everything was fine just calling them like so

public TimeSheetPrint addTimeBlockUsingMicroEdit(String date) {
    onEnterTimeCalendarPage().openMicroEditForAllDayAppointment(date);
    enterTimeTasks.onWorkerTimeBlockHoursEditPage();

    .selectTimeType(HOURLY_TIMETYPE)
    .enterQuantity(_2_HOURS)
    .selectNewTimeType(HOURLY_TIMETYPE)
    .enterHour(_2_HOURS)
    .ok();
}

Heres how I am trying to call them

public TimeSheetPrint addTimeBlockUsingMicroEdit(String date) {
        onEnterTimeCalendarPage().openMicroEditForAllDayAppointment(date);
        enterTimeTasks.onWorkerTimeBlockHoursEditPage();

if (featureSet.feature(NONE_AUTHENTICATION_TOGGLE, false).isActive()) {
    .selectTimeType(HOURLY_TIMETYPE)
    .enterQuantity(_2_HOURS)
    .ok();
}
else {
     .selectNewTimeType(HOURLY_TIMETYPE)
     .enterHour(_2_HOURS)
     .ok();
}

}

Heres the Values

public WorkerTimeBlockHoursEditPage selectTimeType(String timeType) {
    regularPromptWithSingleSelection(TIME_TYPE_PROMPT).open()
        .selectByInnerSearch(timeType);
    return this;
}

public WorkerTimeBlockHoursEditPage enterQuantity(String quantityValue) {
    fillNumericText(element(QUANTITY_FIELD), quantityValue + Keys.TAB);
    return this;
}

public WorkerTimeBlockHoursEditPage selectNewTimeType(String newTimeType) {
    regularPromptWithSingleSelection(NEW_TIME_TYPE_PROMPT).open()
        .selectByInnerSearch(newTimeType);
    return this;
}

public WorkerTimeBlockHoursEditPage enterHour(String hoursValue) {
    fillNumericText(element(NEW_HOURS_FIELD), hoursValue + Keys.TAB);
    return this;
}

Aucun commentaire:

Enregistrer un commentaire