package cz.moneta.test.dsl.ufo.banka.pages.po;

import cz.moneta.test.dsl.ufo.operations.shared.SharedElements;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.po.CIF080_S001_OwnershipStructurePage.PAGE_LABEL;

@Wait(value = PAGE_LABEL, by = Lookup.XPATH)
public interface CIF080_S001_OwnershipStructurePage extends WebFlow<CIF080_S001_OwnershipStructurePage> {

    String PAGE_LABEL = "//div[text()='CIF080_S001']";
    String ADD_OWNER_BUTTON = "CIF080_S001_B004";
    String OWNER_FIRST_NAME_INPUT = "CIF080_S001_E001";
    String OWNER_LAST_NAME_INPUT = "CIF080_S001_E002";
    String OWNER_DATE_OF_BIRTH_INPUT = "CIF080_S001_E004";
    String OWNER_NATIONALITY_CZ_BUTTON = "CIF080_S001_B016";
    String OWNER_PERMANENT_CZ_BUTTON = "CIF080_S001_B030";
    String OWNER_TYPE_SELECT = "CIF080_S001_C004";
    String OWNER_SAVE_BUTTON = "CIF080_S001_B027";
    String OWNER_SHARE_INPUT = "CIF080_S001_E003";
    String DATA_SAME_AS_ESM_YES_RADIO = "CIF080_S001_R001_1";
    String CONTINUE_BUTTON = "CIF080_S001_B009";

    @Click(ADD_OWNER_BUTTON)
    CIF080_S001_OwnershipStructurePage clickAddOwner();

    @TypeInto(OWNER_FIRST_NAME_INPUT)
    CIF080_S001_OwnershipStructurePage fillFirstName(String firstName);

    @TypeInto(OWNER_LAST_NAME_INPUT)
    CIF080_S001_OwnershipStructurePage fillLastName(String lastName);

    @TypeInto(OWNER_DATE_OF_BIRTH_INPUT)
    CIF080_S001_OwnershipStructurePage fillOwnerDateOfBirth(String ownerDateOfBirth);

    @Click(OWNER_NATIONALITY_CZ_BUTTON)
    CIF080_S001_OwnershipStructurePage clickOwnerNationalityCz();

    @Click(OWNER_PERMANENT_CZ_BUTTON)
    CIF080_S001_OwnershipStructurePage clickOwnerPermanentCz();

    @Select(value = OWNER_TYPE_SELECT, andWait = @Wait(OWNER_SHARE_INPUT))
    CIF080_S001_OwnershipStructurePage selectOwnerType(String ownerType);

    @TypeInto(OWNER_SHARE_INPUT)
    @KeyPress(Key.TAB)
    CIF080_S001_OwnershipStructurePage fillOwnerShare(String ownerShare);

    @Click(value = OWNER_SAVE_BUTTON, andWait = @Wait(value = SharedElements.LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    CIF080_S001_OwnershipStructurePage clickOwnerSave();

    @Click(value = DATA_SAME_AS_ESM_YES_RADIO, jsClick = true)
    CIF080_S001_OwnershipStructurePage clickDataSameAsEsmYes();

    @Click(CONTINUE_BUTTON)
    CIF081_S001_OtherPersonInOwnershipPage clickContinue();

}