package cz.moneta.test.dsl.ufo.operations.ufoOperations;

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

import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;
import static cz.moneta.test.dsl.ufo.operations.ufoOperations.ZKU704_S001_ChangeContactData.PAGE_TITLE;

@Wait(PAGE_TITLE)
public interface ZKU704_S001_ChangeContactData extends WebFlow<ZKU704_S001_ChangeContactData> {

    String PAGE_TITLE = "ZKU704_S001_L013";
    String ADDRESS = "ZKU704_S001_L011-1";
    String USE_ADDRESS_BUTTON = "ZKU704_S001_P002-1";
    String SAVE_ADDRESS_BUTTON = "ZKU704_S001_B001";
    String PART_ADDRESS_EDIT = "IPP702_S001_E001";
    String SEARCH_ADDRESS_BUTTON = "IPP702_S001_P002";
    String CHOOSE_ADDRESS_BUTTON = "IPP702_S001_G001-0";
    String WARNING_LABEL = "IPP702_S001_L005";
    String CLOSE_SEARCH_ADDRESS = "IPP702_S001_P001";
    String CHECK_DATA_BUTTON = "ZKU704_S001_B004";
    String USE_PRODUCT_SECOND_PLACE = "ZKU704_S001_P002-2";
    String STREET_TEXTBOX = "ZKU704_S001_E001";
    String DESCRIPTION_NUMBER_TEXTBOX = "ZKU704_S001_E002";
    String ORIENTATION_NUMBER_TEXTBOX = "ZKU704_S001_E003";
    String POSTAL_CODE_TEXTBOX = "ZKU704_S001_E004";
    String DISTRICT_NUMBER_TEXTBOX = "ZKU704_S001_E010";
    String CITY_TEXTBOX = "ZKU704_S001_E005";
    String COUNTRY_COMBOBOX = "ZKU704_S001_C001";
    String EMAIL_TEXTBOX = "ZKU704_S001_E008";
    String SAVE_EMAIL_BUTTON = "ZKU704_S001_B003";
    String CHANGE_ON_ALL_PRODUCTS_EMAIL = "ZKU704_S001_R003_1";
    String CHANGE_ON_SELECTED_PRODUCTS_EMAIL = "ZKU704_S001_R003_2";
    String EMAIL_PRODUCTS_FIRST_ROW = "ufo-et-ZKU704_S001_F003_row_1_sel";
    String EMAIL_DIV_1 = "ZKU704_S001_L046-1";
    String EMAIL_DIV_2 = "ZKU704_S001_L046-2";
    String ADDRESS_DIV_2 = "ZKU704_S001_X001-2";
    String CHANGE_ON_ALL_PRODUCTS_TELEPHONE = "ZKU704_S001_R002_1";
    String CHANGE_ON_SELECTED_PRODUCTS_TELEPHONE = "ZKU704_S001_R002_2";
    String SAVE_TELEPHONE_BUTTON = "ZKU704_S001_B002";
    String TEL_PREFIX_TEXTBOX = "ZKU704_S001_E006";
    String TELEPHONE_NUMBER_TEXTBOX = "ZKU704_S001_E007";
    String TELEPHONE_PRODUCTS_SECOND_ROW_CHECKBOX = "ufo-et-ZKU704_S001_F002_row_2_sel";
    String TELEPHONE_PRODUCTS_THIRD_ROW_CHECKBOX = "ufo-et-ZKU704_S001_F002_row_3_sel";
    String TELEPHONE_PRODUCTS_FIRST_ROW_DIV = "ZKU704_S001_L035-1";
    String TELEPHONE_PRODUCTS_SECOND_ROW_DIV = "ZKU704_S001_L035-2";
    String TELEPHONE_PRODUCTS_THIRD_ROW_DIV = "ZKU704_S001_L035-3";
    String TELEPHONE_PRODUCTS_FOURTH_ROW_DIV = "ZKU704_S001_L035-4";

    @Wait(value = USE_ADDRESS_BUTTON, until = Until.VISIBLE)
    @Click(USE_ADDRESS_BUTTON)
    ZKU704_S001_ChangeContactData clickUseAddressButton();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(value = SAVE_ADDRESS_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickSaveAddress();

    @Wait(value = CHOOSE_ADDRESS_BUTTON, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(SAVE_ADDRESS_BUTTON)
    @AcceptAlert(waitSecondsForAlert = 10)
    ZKU704_S001_ChangeContactData clickSaveCheckAddress();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(SEARCH_ADDRESS_BUTTON)
    ZKU704_S001_ChangeContactData clickSearchAddress();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CHOOSE_ADDRESS_BUTTON)
    ZKU704_S001_ChangeContactData clickChooseAddress();

    @CheckElementContent(WARNING_LABEL)
    ZKU704_S001_ChangeContactData assertWarning(String warning);

    @Click(CLOSE_SEARCH_ADDRESS)
    ZKU704_S001_ChangeContactData closeSearchAddress();

    @Wait(value = LOAD_IMG_DIV_CLASS, until = Until.GONE, by = Lookup.CLASSNAME)
    @Click(CHECK_DATA_BUTTON)
    ZKU704_S001_ChangeContactDataTransitions clickCheckData();

    @Wait(value = PART_ADDRESS_EDIT, until = Until.VISIBLE)
    @TypeInto(value = PART_ADDRESS_EDIT, clear = true)
    ZKU704_S001_ChangeContactData typePartAddress(String partAddress);

    @Wait(value = USE_PRODUCT_SECOND_PLACE, until = Until.VISIBLE)
    @Click(value = USE_PRODUCT_SECOND_PLACE, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickUseProductOnSecondPlace();

    @Wait(STREET_TEXTBOX)
    @TypeInto(value = STREET_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillStreet(String street);

    @Wait(DESCRIPTION_NUMBER_TEXTBOX)
    @TypeInto(value = DESCRIPTION_NUMBER_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillDescriptionNumber(String descriptionNumber);

    @Wait(ORIENTATION_NUMBER_TEXTBOX)
    @TypeInto(value = ORIENTATION_NUMBER_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillOrientationNumber(String orientationNumber);

    @Wait(POSTAL_CODE_TEXTBOX)
    @TypeInto(value = POSTAL_CODE_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillPostalCode(String postalCode);

    @Wait(DISTRICT_NUMBER_TEXTBOX)
    @TypeInto(value = DISTRICT_NUMBER_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillDistrictNumber(String districtNumber);

    @Wait(CITY_TEXTBOX)
    @TypeInto(value = CITY_TEXTBOX, clear = true)
    ZKU704_S001_ChangeContactData fillCity(String city);

    @Select(COUNTRY_COMBOBOX)
    ZKU704_S001_ChangeContactData selectCountry(int value);

    @TypeInto(EMAIL_TEXTBOX)
    ZKU704_S001_ChangeContactData fillEmail(String email);

    @Click(value = SAVE_EMAIL_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickSaveEmail();

    @Wait(value = CHANGE_ON_ALL_PRODUCTS_EMAIL, until = Until.VISIBLE)
    @Click(value = CHANGE_ON_ALL_PRODUCTS_EMAIL, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickChangeOnAllProductsEmail();

    @Click(value = CHANGE_ON_SELECTED_PRODUCTS_EMAIL, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickChangeOnSelectedProductsEmail();

    @Click(value = CHANGE_ON_ALL_PRODUCTS_TELEPHONE, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickChangeOnAllProductsTelephone();

    @Click(value = CHANGE_ON_SELECTED_PRODUCTS_TELEPHONE, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickChangeOnSelectedProductsTelephone();

    @Click(EMAIL_PRODUCTS_FIRST_ROW)
    ZKU704_S001_ChangeContactData clickEmailProductsFirstRow();

    @CheckElementContent(EMAIL_DIV_1)
    ZKU704_S001_ChangeContactData checkEmailDiv1(String email);

    @CheckElementContent(EMAIL_DIV_2)
    ZKU704_S001_ChangeContactData checkEmailDiv2(String email);

    @Wait(value = ADDRESS_DIV_2, until = Until.VISIBLE)
    @CheckElementContent(ADDRESS_DIV_2)
    ZKU704_S001_ChangeContactData checkAddressDiv2(String address);

    @Click(value = SAVE_TELEPHONE_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE))
    ZKU704_S001_ChangeContactData clickSaveTelephone();

    @TypeInto(TELEPHONE_NUMBER_TEXTBOX)
    ZKU704_S001_ChangeContactData fillTelephone(String email);

    @TypeInto(TEL_PREFIX_TEXTBOX)
    ZKU704_S001_ChangeContactData fillTelPrefix(String email);

    @Wait(TELEPHONE_PRODUCTS_SECOND_ROW_CHECKBOX)
    @Click(TELEPHONE_PRODUCTS_SECOND_ROW_CHECKBOX)
    ZKU704_S001_ChangeContactData clickTelephoneSecondRowCheckbox();

    @Wait(TELEPHONE_PRODUCTS_THIRD_ROW_CHECKBOX)
    @Click(TELEPHONE_PRODUCTS_THIRD_ROW_CHECKBOX)
    ZKU704_S001_ChangeContactData clickTelephoneThirdRowCheckbox();

    @Wait(value = TELEPHONE_PRODUCTS_FIRST_ROW_DIV, until = Until.VISIBLE)
    @CheckElementContent(TELEPHONE_PRODUCTS_FIRST_ROW_DIV)
    ZKU704_S001_ChangeContactData checkTelephoneProductsFirstRowDiv(String number);

    @Wait(value = TELEPHONE_PRODUCTS_SECOND_ROW_DIV, until = Until.VISIBLE)
    @CheckElementContent(TELEPHONE_PRODUCTS_SECOND_ROW_DIV)
    ZKU704_S001_ChangeContactData checkTelephoneProductsSecondRowDiv(String number);

    @Wait(value = TELEPHONE_PRODUCTS_THIRD_ROW_DIV, until = Until.VISIBLE)
    @CheckElementContent(TELEPHONE_PRODUCTS_THIRD_ROW_DIV)
    ZKU704_S001_ChangeContactData checkTelephoneProductsThirdRowDiv(String number);

    @Wait(value = TELEPHONE_PRODUCTS_FOURTH_ROW_DIV, until = Until.VISIBLE)
    @CheckElementContent(TELEPHONE_PRODUCTS_FOURTH_ROW_DIV)
    ZKU704_S001_ChangeContactData checkTelephoneProductsFourthRowDiv(String number);
}
