package cz.moneta.test.dsl.ufo.banka.pages.menu.vertical;

import cz.moneta.test.dsl.ufo.banka.pages.search.HLO001_S001_ClientSearchPage;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.menu.vertical.PVX043_S001_SignatureTemplatesPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = PVX043_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH)
@Wait({TURN_SIGNPAD_OFF_REASON_TEXT_AREA, TURN_SIGNPAD_OFF_REASON_BUTTON, RETURN_BUTTON})
public interface PVX043_S001_SignatureTemplatesPage extends WebFlow<PVX043_S001_SignatureTemplatesPage> {
    String PVX043_S001_PAGE_LABEL_XPATH = "//div[text()='PVX043_S001']";
    String TURN_SIGNPAD_OFF_REASON_TEXT_AREA = "PVX043_S001_M001";
    String TURN_SIGNPAD_OFF_REASON_BUTTON = "PVX043_S001_B007";
    String TURN_SIGNPAD_ON_REASON_BUTTON = "PVX043_S001_B007";
    String TURN_SIGNPAD_ON_REASON_XPATH = "//*[@id='PVX043_S001_B007' and contains(text(),'Zapnout')]";
    String RETURN_BUTTON = "PVX043_S001_B006";

    @TypeInto(TURN_SIGNPAD_OFF_REASON_TEXT_AREA)
    @Click(value = TURN_SIGNPAD_OFF_REASON_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, explicitWaitSeconds = 1))
    @Click(value = RETURN_BUTTON, andWait = @Wait(HLO001_S001_ClientSearchPage.SEARCH_TERM_INPUT))
    HLO001_S001_ClientSearchPage turnSignpadOffWithReason(String reason);

    @Click(value = TURN_SIGNPAD_ON_REASON_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    @Click(value = RETURN_BUTTON, andWait = @Wait(HLO001_S001_ClientSearchPage.SEARCH_TERM_INPUT))
    HLO001_S001_ClientSearchPage turnSignpadOn();

}
