package cz.moneta.test.dsl.newib.savings;

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.newib.savings.PersonalDetailAddressPage.TITLE_PERSONAL_DETAIL_ADDRESS_XPATH;

@Wait(value = {TITLE_PERSONAL_DETAIL_ADDRESS_XPATH}, waitSecondsForElement = 30)
public interface PersonalDetailAddressPage extends NewIbPageFlow<PersonalDetailAddressPage> {

    String TITLE_PERSONAL_DETAIL_ADDRESS_XPATH = "//h1[@class='t-title t-title--h4'][text()='Máme správně Váš trvalý pobyt?']";
    String TITLE_BUILDING_SAVINGS_XPATH = "//h1[@class='t-title t-title--h3 u-mb--xLarge'][text()='Stavební spoření']";
    String PERMANENT_ADDRESS_FORM_STREET_LABEL_XPATH = "//label[@id='permanentAddressForm.street_label'][text()='Ulice']";
    String PERMANENT_ADDRESS_FORM_DESCRIPTIVE_NUMBER_LABEL_XPATH = "//label[@id='permanentAddressForm.descriptiveNumber_label'][text()='Č. popisné']";
    String PERMANENT_ADDRESS_FORM_ORIENTATION_NUMBER_LABEL_XPATH = "//label[@id='permanentAddressForm.orientationNumber_label'][text()='Č. orientační']";
    String PERMANENT_ADDRESS_FORM_TOWN_LABEL_XPATH = "//label[@id='permanentAddressForm.town_label'][text()='Město']";
    String PERMANENT_ADDRESS_FORM_ZIP_LABEL_XPATH = "//label[@id='permanentAddressForm.zip_label'][text()='PSČ']";
    String PERMANENT_ADDRESS_FORM_COUNTRY_LABEL_XPATH = "//label[@id='permanentAddressForm.country_label'][text()='Země']";
    String CHECKBOX_CONTACT_AND_PERMANENT_ADDRESS_XPATH = "//span[@id='text-contactSameAsPermanent'][text()='Kontaktní adresa je stejná jako trvalá']";
    String CHECKBOX_CONTACT_SAME_AS_PERMANENT_XPATH = "//label[@for='contactSameAsPermanent']";
    String TITLE_CONTACT_ADDRESS_XPATH = "//h3[@class='t-title t-title--h5 u-mt--0'][text()='Kontaktní adresa']";
    String BACK_BUTTON_XPATH = "//button[@data-testid='Button'][text()='Zpět']";
    String SUBMIT_BUTTON_XPATH = "//button[@data-testid='submit'][text()='Pokračovat']";

    @CheckElementPresent(TITLE_PERSONAL_DETAIL_ADDRESS_XPATH)
    PersonalDetailAddressPage checkTitlePersonalDetailAddress();

    @CheckElementPresent(TITLE_BUILDING_SAVINGS_XPATH)
    PersonalDetailAddressPage checkTitleBuildingSavings();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_STREET_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormStreetLabel();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_DESCRIPTIVE_NUMBER_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormDescriptiveNumberLabel();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_ORIENTATION_NUMBER_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormOrientationNumberLabel();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_TOWN_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormTownLabel();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_ZIP_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormZipLabel();

    @CheckElementPresent(PERMANENT_ADDRESS_FORM_COUNTRY_LABEL_XPATH)
    PersonalDetailAddressPage checkPermanentAddressFormCountryLabel();

    @CheckElementPresent(CHECKBOX_CONTACT_AND_PERMANENT_ADDRESS_XPATH)
    PersonalDetailAddressPage checkCheckboxContactAndPermanentAddress();

    @Click(CHECKBOX_CONTACT_SAME_AS_PERMANENT_XPATH)
    PersonalDetailAddressPage clickOnCheckboxContactSameAsPermanent();

    @CheckElementPresent(TITLE_CONTACT_ADDRESS_XPATH)
    PersonalDetailAddressPage checkTitleContactAddress();

    @CheckElementPresent(BACK_BUTTON_XPATH)
    PersonalDetailAddressPage checkBackButton();

    @Click(SUBMIT_BUTTON_XPATH)
    AmlQuestionnairePage clickOnSubmit();
}