package cz.moneta.test.dsl.brokerportal.contract.shortapplication;

import cz.moneta.test.dsl.brokerportal.enums.Client;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.brokerportal.contract.shortapplication.ShortApplicationSummaryPage.SUMMARY_APPLICANTS_CONFIRM_BUTTON;

@Wait(value = SUMMARY_APPLICANTS_CONFIRM_BUTTON, waitSecondsForElement = 30)
public interface ShortApplicationSummaryPage extends WebFlow<ShortApplicationSummaryPage>, StoreAccessor {
    String SUMMARY_APPLICANTS_CONFIRM_BUTTON = "//button[@id='applicationSummaryApplicantsConfirm']";
    String AGREEMENTS_CONFIRM_BUTTON = "//button[@id='applicationSummaryAgreementsConfirm']";
    String REGISTER_CHECK_BUTTON = "//button[@id='applicationSummaryRegisterCheck']";
    String AGREEMENT_COMMUNICATION_CHECKBOX = "//label[@id='communication[%s].selected']";
    String AGREEMENT_MARKETING_CHECKBOX = "//label[@id='marketing[%s].selected']";
    String AGREEMENT_TRUE_DATA_CHECKBOX = "//label[@id='agreeTrueData']";
    String AGREEMENT_REGISTER_CHECK_CHECKBOX = "//label[@id='agreeRegisterCheck']";

    @Click(value = AGREEMENT_COMMUNICATION_CHECKBOX, jsClick = true)
    ShortApplicationSummaryPage clickAgreementCommunicationCheckbox(Client client);

    @Click(value = AGREEMENT_MARKETING_CHECKBOX, jsClick = true)
    ShortApplicationSummaryPage clickAgreementMarketingCheckbox(Client client);

    @Click(SUMMARY_APPLICANTS_CONFIRM_BUTTON)
    ShortApplicationSummaryPage clickSummaryApplicantsConfirmButton();

    @Click(AGREEMENTS_CONFIRM_BUTTON)
    ShortApplicationSummaryPage clickApplicantsAgreementsConfirmButton();

    @Click(REGISTER_CHECK_BUTTON)
    ShortApplicationSignPage clickCreateApplicationButton();

    @Click(value = AGREEMENT_TRUE_DATA_CHECKBOX, jsClick = true)
    ShortApplicationSummaryPage clickAgreementTruDataCheckbox();

    @Click(value = AGREEMENT_REGISTER_CHECK_CHECKBOX, jsClick = true)
    ShortApplicationSummaryPage clickAgreementRegisterCheckCheckbox();
}