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

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.GetElementContent;
import cz.moneta.test.harness.support.web.TypeInto;

public interface InvestmentsPurchaseDialog extends NewIbPageFlow<InvestmentsPurchaseDialog> {
    String INDIVIDUAL_AMOUNT_INPUT = "//input[@data-testid='individualAmount']";
    String REGULAR_AMOUNT_INPUT = "//input[@data-testid='regularAmount']";
    String AGREEMENT_CHECK_BOX = "//label[@for='tocAgreement']";
    String SUBMIT_BUTTON = "//button[@data-testid='submitButton'][not (@aria-disabled)]";
    String MOBILE_KEY_INPUT = "//input[@id='mobileKey']";
    String SECOND_FACTOR_SUBMIT_BUTTON = "//button[@data-testid='secondFactorSend'][not (@aria-disabled) or @aria-disabled='false']";
    String FUND_ISIN = "//p[@data-testid='buyFundModalIsin']/small";

    @TypeInto(INDIVIDUAL_AMOUNT_INPUT)
    InvestmentsPurchaseDialog fillIndividualAmount(String individualAmount);

    @TypeInto(REGULAR_AMOUNT_INPUT)
    InvestmentsPurchaseDialog fillRegularAmount(String regularAmount);

    @Click(AGREEMENT_CHECK_BOX)
    InvestmentsPurchaseDialog clickAgreement();

    @Click(SUBMIT_BUTTON)
    InvestmentsFrameworkAgreement clickSubmitAndGoToFrameworkAgreement();

    @Click(SUBMIT_BUTTON)
    InvestmentsPurchaseDialog clickSubmit();

    @TypeInto(MOBILE_KEY_INPUT)
    InvestmentsPurchaseDialog fillMobileKey(String mobileKey);

    @Click(SECOND_FACTOR_SUBMIT_BUTTON)
    InvestmentsPurchaseVictory clickSecondFactorSubmit();

    @GetElementContent(FUND_ISIN)
    String getIsin();
}