package cz.moneta.test.dsl.forte.pages.contracts;

import cz.moneta.test.dsl.forte.FortePageFlow;
import cz.moneta.test.dsl.forte.components.BrnControlsMenu;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.forte.pages.contracts.ReportControlsOnOm.PAGE_TITLE;

@Wait(PAGE_TITLE)
public interface ReportControlsOnOm extends FortePageFlow<ReportControlsOnOm>, BrnControlsMenu {
    String PAGE_TITLE = CONTENT_DIV + "//h3[text()='Report kontrol na OM']";

    String QUARTER_SELECT = CONTENT_DIV + "//select[@id='frmfindForm-quarter']";

    String SUBMIT_BUTTON = CONTENT_DIV + "//input[@name='search']";

    String RESULT_TABLE_FIRST_ROW = CONTENT_DIV + "//table[@class='datagrid']//tr";

    @Select(QUARTER_SELECT)
    ReportControlsOnOm selectQuarter(String quarter);

    @Select(value = QUARTER_SELECT, selectByOrder = true)
    ReportControlsOnOm selectQuarterByIndex(int index);

    @Click(value = SUBMIT_BUTTON, andWait = @Wait(value = SPINNER, until = Until.GONE, by = Lookup.ID))
    ReportControlsOnOm clickSearch();

    @CheckElementPresent(RESULT_TABLE_FIRST_ROW)
    ReportControlsOnOm checkResultTablePresence();

}