package cz.moneta.test.dsl.hypos.pages.tasklist;

import cz.moneta.test.dsl.hypos.pages.HyposPageFlow;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Select;
import cz.moneta.test.harness.support.web.Until;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.hypos.pages.tasklist.TaskListPage.FILTER_MODE_SELECT;

@Wait(FILTER_MODE_SELECT)
public interface TaskListPage extends HyposPageFlow<TaskListPage>, StoreAccessor {
    String FILTER_MODE_SELECT = "//select[@id='filter-mode']";
    String FILTER_TYPE_SELECT = "//select[@id='filter-type']";
    String FILTER_SEARCH_BUTTON = "//button[text()='Vyhledat']";
    String TASK_DETAIL = "(//a[contains(@href,'complaint.detail')])[1]";

    @Click(value = FILTER_SEARCH_BUTTON, andWait = @Wait(value = TASK_DETAIL, until = Until.CLICKABLE))
    TaskListPage clickSearchButton();

    @Click(TASK_DETAIL)
    TaskDetailPage clickTaskDetail();

    @Select(FILTER_MODE_SELECT)
    TaskListPage selectFilterMode(String mode);

    @Select(FILTER_TYPE_SELECT)
    TaskListPage selectFilterType(String type);
}