package cz.moneta.test.dsl.ufo.banka.pages.products.sme;

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

import static cz.moneta.test.dsl.ufo.banka.pages.products.sme.KUL052_S002_ManuallyAddedCommitmentsPage.*;
import static cz.moneta.test.dsl.ufo.operations.shared.SharedElements.LOAD_IMG_DIV_CLASS;

@Wait(value = KUL052_S002_PAGE_LABEL_XPATH, by = Lookup.XPATH, waitSecondsForElement = 60)
public interface KUL052_S002_ManuallyAddedCommitmentsPage extends WebFlow<KUL052_S002_ManuallyAddedCommitmentsPage> {
    String KUL052_S002_PAGE_LABEL_XPATH = "//div[text()='KUL052_S002']";

    String ADD_BUTTON = "KUL052_S002_B001";
    String CONTINUE_BUTTON = "KUL052_S002_B005";

    String COMPANY_NAME_SELECT = "KUL052_S002_C001";
    String COMMITMENT_TYPE_SELECT = "KUL052_S002_C002";

    String CURRENT_PRINCIPAL_AMOUNT_INPUT = "KUL052_S002_E002";

    @Select(value = COMMITMENT_TYPE_SELECT, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL052_S002_ManuallyAddedCommitmentsPage selectCommitmentType(String commitmentType);

    @Select(COMPANY_NAME_SELECT)
    KUL052_S002_ManuallyAddedCommitmentsPage selectCompany(String company);

    @TypeInto(CURRENT_PRINCIPAL_AMOUNT_INPUT)
    KUL052_S002_ManuallyAddedCommitmentsPage fillCurrentPrincipalAmount(String currentPrincipalAmount);

    @Click(value = ADD_BUTTON, andWait = @Wait(value = LOAD_IMG_DIV_CLASS, by = Lookup.CLASSNAME, until = Until.GONE, waitSecondsForElement = 60))
    KUL052_S002_ManuallyAddedCommitmentsPage addCommitment();

    @Click(CONTINUE_BUTTON)
    KUL052_S001_ConsolidationCommitmentsPage clickContinueToPreliminaryEvaluationPage();
}
