package cz.moneta.test.dsl.ib.settings.ib.contactInformation;

import cz.moneta.test.dsl.ib.IbPageFlow;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.CheckElementContent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Lookup;
import cz.moneta.test.harness.support.web.SwitchToFrame;
import cz.moneta.test.harness.support.web.Wait;

public interface IbContactInformationPage extends IbPageFlow<IbContactInformationPage>, StoreAccessor {
    String PERMANENT_ADDRESS_INFORMATION_TABLE = "KIN801_S001_X002";
    String FRAME = "UFO";

    //Kontaktni adresa
    String CONTACT_ADDRESS_INFORMATION_TABLE = "KIN801_S001_X003";
    String FIRST_NAME = "KIN801_S001_L023";
    String SECOND_NAME = "KIN801_S001_L044";
    String STREET = "KIN801_S001_L024";
    String POSTAL_CODE = "KIN801_S001_L025";
    String TOWN = "KIN801_S001_L042";
    String COUNTRY_CODE = "KIN801_S001_L026";
    String MOBILE_NUMBER = "KIN801_S001_L031";
    String EMAIL = "KIN801_S001_L032";
    String CHANGE_CONTACTS_BUTTON = "KIN801_S001_P005";

    String CHANGED_DATA_TEXT = "KIN801_S001_L040";

    @SwitchToFrame(value = FRAME, by = Lookup.ID)
    @Wait(value = {PERMANENT_ADDRESS_INFORMATION_TABLE, CONTACT_ADDRESS_INFORMATION_TABLE}, by = Lookup.ID)
    IbContactInformationPage switchToFrame();

    @Wait(value = FIRST_NAME, by = Lookup.ID)
    @CheckElementContent(value = FIRST_NAME, by = Lookup.ID)
    IbContactInformationPage checkFirstName(String firstName);

    @Wait(value = SECOND_NAME, by = Lookup.ID)
    @CheckElementContent(value = SECOND_NAME, by = Lookup.ID)
    IbContactInformationPage checkSecondName(String secondName);

    @Wait(value = STREET, by = Lookup.ID)
    @CheckElementContent(value = STREET, by = Lookup.ID)
    IbContactInformationPage checkStreet(String street);

    @Wait(value = POSTAL_CODE, by = Lookup.ID)
    @CheckElementContent(value = POSTAL_CODE, by = Lookup.ID)
    IbContactInformationPage checkPostalCode(String postalCode);

    @Wait(value = TOWN, by = Lookup.ID)
    @CheckElementContent(value = TOWN, by = Lookup.ID)
    IbContactInformationPage checkTown(String town);

    @Wait(value = COUNTRY_CODE, by = Lookup.ID)
    @CheckElementContent(value = COUNTRY_CODE, by = Lookup.ID)
    IbContactInformationPage checkCountryCode(String countryCode);

    @Wait(value = MOBILE_NUMBER, by = Lookup.ID)
    @CheckElementContent(value = MOBILE_NUMBER, by = Lookup.ID)
    IbContactInformationPage checkMobileNumber(String mobileNumber);

    @Wait(value = EMAIL, by = Lookup.ID)
    @CheckElementContent(value = EMAIL, by = Lookup.ID)
    IbContactInformationPage checkEmail(String email);

    @Wait(value = CHANGE_CONTACTS_BUTTON, by = Lookup.ID)
    @Click(value = CHANGE_CONTACTS_BUTTON,jsClick = true, by = Lookup.ID)
    IbChangeContactDataPage changeContactData();

    @Wait(value = CHANGED_DATA_TEXT, by = Lookup.ID)
    @CheckElementContent(value = CHANGED_DATA_TEXT, by = Lookup.ID)
    IbContactInformationPage checkChangedDataText(String message);

}
