package cz.moneta.test.dsl.ufo.banka.pages.cards.debit;

import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.cards.debit.MBC005_S001_IdCardDataPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = MBC005_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 120)
public interface MBC005_S001_IdCardDataPage extends WebFlow<MBC005_S001_IdCardDataPage> {
    String MBC005_S001_PAGE_LABEL_XPATH = "//div[text()='MBC005_S001']";

    String CONTINUE_BUTTON = "MBC005_S001_B001";
    String CZECH_BIRTH_COUNTRY_BUTTON = "MBC005_S001_B006";
    String UNIFIED_ADDRESS_LOOKUP_BUTTON = "MBC005_S001_B007";
    String CZECH_PERMANENT_RESIDENCY_BUTTON = "MBC005_S001_B008";
    String ADDRESS_LOOKUP_FLOAT_BUTTON = "MBC005_S001_B011";
    String FOUND_ADDRESS_SELECT_BUTTON = "MBC005_S001_B012";

    String SECOND_OTHER_ID_SELECT = "MBC005_S001_C003";

    String FIRST_NAME_INPUT = "MBC005_S001_E001";
    String BIRTH_DATE_INPUT = "MBC005_S001_E002";
    String BIRTH_PLACE_INPUT = "MBC005_S001_E003";
    String ID_VALID_TILL_INPUT = "MBC005_S001_E007";
    String ID_CONTROL_NUMBER_INPUT = "MBC005_S001_E009";
    String ID_NUMBER_INPUT = "MBC005_S001_E011";
    String LAST_NAME_INPUT = "MBC005_S001_E012";
    String BIRTH_NUMBER_INPUT = "MBC005_S001_E015";
    String SEARCH_ADDRESS_INPUT = "MBC005_S001_E018";

    String FIRST_FOUND_ADDRESS_RADIO = "MBC005_S001_G001-0";

    String MALE_GENDER_RADIO = "MBC005_S001_R001_1";

    @TypeInto(value = FIRST_NAME_INPUT, clear = true)
    MBC005_S001_IdCardDataPage fillFirstName(String firstName);

    @TypeInto(value = LAST_NAME_INPUT, clear = true)
    MBC005_S001_IdCardDataPage fillLastName(String lastName);

    @TypeInto(BIRTH_DATE_INPUT)
    MBC005_S001_IdCardDataPage fillBirthDate(String birthDate);

    @TypeInto(BIRTH_PLACE_INPUT)
    MBC005_S001_IdCardDataPage fillBirthPlace(String birthPlace);

    @TypeInto(ID_VALID_TILL_INPUT)
    MBC005_S001_IdCardDataPage fillIdValidTill(String idValidTill);

    @TypeInto(ID_NUMBER_INPUT)
    MBC005_S001_IdCardDataPage fillIdNumber(String idNumber);

    @TypeInto(BIRTH_NUMBER_INPUT)
    MBC005_S001_IdCardDataPage fillBirthNumber(String birthNumber);

    @TypeInto(ID_CONTROL_NUMBER_INPUT)
    MBC005_S001_IdCardDataPage fillIdControlNumber(String idControlNumber);

    @Click(UNIFIED_ADDRESS_LOOKUP_BUTTON)
    MBC005_S001_IdCardDataPage clickMagnifyingGlass();

    @Wait(explicitWaitSeconds = 2)
    @TypeInto(value = SEARCH_ADDRESS_INPUT, clear = true)
    MBC005_S001_IdCardDataPage typeAddress(String searchAddress);

    @Click(value = ADDRESS_LOOKUP_FLOAT_BUTTON, andWait = @Wait(value = FIRST_FOUND_ADDRESS_RADIO, until = Until.VISIBLE))
    MBC005_S001_IdCardDataPage clickSearchForAddress();

    @Click(FIRST_FOUND_ADDRESS_RADIO)
    @Click(value = FOUND_ADDRESS_SELECT_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    MBC005_S001_IdCardDataPage clickFirstFoundAddressAndConfirm();

    @Click(CZECH_PERMANENT_RESIDENCY_BUTTON)
    MBC005_S001_IdCardDataPage clickCzechFlagPermanentResidency();

    @Click(value = MALE_GENDER_RADIO, jsClick = true)
    MBC005_S001_IdCardDataPage clickMaleGender();

    @Click(CZECH_BIRTH_COUNTRY_BUTTON)
    MBC005_S001_IdCardDataPage clickCzechBirthCountry();

    @Click(CONTINUE_BUTTON)
    MBC006_S001_PersonalContactDataPage continueToPersonalAndContactDataPage();
}
