package cz.moneta.test.dsl.ufo.banka.pages.main.components;

import cz.moneta.test.dsl.ufo.banka.pages.fon.CIF003_OBR001_NoCopyConfirmationPage;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.ufo.UfoEndpoint;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.banka.pages.main.components.CIF003_S001_EditCifPage.CIF003_S001_PAGE_LABEL_XPATH;
import static cz.moneta.test.dsl.ufo.banka.pages.main.components.CIF003_S001_EditCifPage.CONTINUE_BUTTON;

@Wait(value = CIF003_S001_PAGE_LABEL_XPATH, by = Lookup.XPATH)
@Wait(CONTINUE_BUTTON)
public interface CIF003_S001_EditCifPage extends WebFlow<CIF003_S001_EditCifPage>, StoreAccessor {
    String CIF003_S001_PAGE_LABEL_XPATH = "//div[text()='CIF003_S001']";
    String CONTINUE_BUTTON = "CIF003_S001_B002";
    String PHONE_NUMBER_INPUT = "CIF003_S002_U016";
    String ID_CARD_INPUT = "CIF003_S002_U021";
    String ID_VALID_INPUT = "CIF003_S002_E005";

    @CustomAction
    default CIF003_S001_EditCifPage dismissVerifyIdCardAlert() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        endpoint.dismissAlert(20);
        return null;
    }

    @Click(CONTINUE_BUTTON)
    CIF003_OBR001_NoCopyConfirmationPage clickConfirmationPage();

    @TypeInto(value = PHONE_NUMBER_INPUT, clear = true)
    CIF003_S001_EditCifPage fillPhoneNumber(String phoneNumber);

    @TypeInto(value = ID_CARD_INPUT, clear = true)
    CIF003_S001_EditCifPage fillIdCard(String idCard);

    @TypeInto(value = ID_VALID_INPUT, clear = true)
    CIF003_S001_EditCifPage fillIdValid(String idValid);

    @Click(CONTINUE_BUTTON)
    CIF011_S001_EditFoWhenEditingFopPage continueToEditFoWhenEditingFopPage();
}