package cz.moneta.test.dsl.ufo.banka.tasks.insurance;

import cz.moneta.test.dsl.ufo.banka.pages.insurance.FLO011_S001_EditExpresInsurancePage;
import cz.moneta.test.dsl.ufo.banka.pages.main.HPO011_S001_ExpresDetailPage;

import java.util.function.Function;

public class InsurancePpiTasks {

    public Function<FLO011_S001_EditExpresInsurancePage, HPO011_S001_ExpresDetailPage> createAndCancelInsurance() {
        return start -> start.clickChangeExpresInsurance("Pojištění schopnosti splácet")
                .clickNoInvalidButton()
                .clickConfirmInvalid()
                .clickConfirmInsuranceChange()
                .clickContinue()
                .onAppendixSignedPage()
                .clickAppendixConfigButton()
                .clickInsuranceChangeVictoryButton()
                .clickCancelInsurance()
                .clickChangeCancelExpresInsurance("Bez pojištění")
                .clickConfirmInsuranceCancel()
                .clickAppendixConfigButton()
                .clickInsuranceCancelVictoryButton();
    }
}
