package cz.moneta.test.dsl.util.task.auto.smartauto.setman.verification;

import cz.moneta.test.dsl.Harness;
import cz.moneta.test.dsl.auto.smartauto.setman.DealersDetailPage;
import cz.moneta.test.dsl.auto.smartauto.setman.DealersPage;
import cz.moneta.test.dsl.auto.smartauto.setman.MainPage;
import cz.moneta.test.dsl.auto.smartauto.setman.NewDealersPage;

import java.util.function.Function;

public class VerificationTasks {

    private final Harness harness;

    public VerificationTasks(Harness harness) {
        this.harness = harness;
    }

    public Function<MainPage, MainPage> checkMenu() {
        return start -> start.checkMenuPartners()
                .checkMenuProducts()
                .checkMenuInsurance()
                .checkMenuDocuments()
                .checkMenuOthers();
    }

    public Function<NewDealersPage, NewDealersPage> checkNewDealersPage() {
        return NewDealersPage::checkHeadingNewDealers;
    }

    public Function<DealersPage, DealersPage> checkDealersPage() {
        return start -> start.checkHeadingDealers()
                .checkTable();
    }

    public Function<DealersDetailPage, DealersDetailPage> checkDealersDetailPage() {
        return start -> start.checkHeadingDealersDetail()
                .checkSaveButton()
                .checkTable()
                .checkGeneralSection()
                .checkDealersGroupsSection()
                .checkGeneralSectionIdLabel()
                .checkGeneralSectionActiveLabel()
                .checkGeneralSectionAuthorizedLabel()
                .checkGeneralSectionCnbLabel()
                .checkGeneralSectionPartnerLabel()
                .checkGeneralSectionTitleLabel()
                .checkGeneralSectionSignatureDateSosLabel()
                .checkGeneralSectionCenterLabel()
                .checkGeneralSectionColoredChannelLabel()
                .checkGeneralSectionPatronLabel()
                .checkGeneralSectionColoredAcquisitionPlaceLabel()
                .checkGeneralSectionAcquisitionPlaceLabel()
                .checkGeneralSectionNoteLabel()
                .checkGeneralSectionSetPatronButton()
                .checkGeneralSectionGoToPatronButton()
                .checkGeneralSectionSetAcquisitionPlaceButton()
                .checkGeneralSectionGoToAcquisitionPlaceButton()
                .checkGeneralSectionSetColoredAcquisitionPlaceButton()
                .checkGeneralSectionGoToColoredAcquisitionPlaceButton();
    }
}