package cz.moneta.test.dsl.ufo.banka.pages.menu.vertical;

import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.ufo.UfoEndpoint;
import cz.moneta.test.harness.support.web.Builder;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.CustomAction;
import cz.moneta.test.harness.support.web.Lookup;

public interface VerticalMenu extends Builder, StoreAccessor {

    String SIGNATURE_TEMPLATES_BUTTON = "HLO001_S001_S002";
    String WALKIN_BUTTON = "HLO001_S001_I005";
    String EVO_BUTTON = "HLO001_S001_I030";
    String DISPOSITIONS_CLOSE_BUTTON = "HLO001_S001_X043";

    /*
     * On smaller screens disposition window hide elements in vertical menu
     */
    @CustomAction
    default VerticalMenu closeDispositionWindowIfVisible() {
        UfoEndpoint endpoint = getEndpoint(UfoEndpoint.class);
        if (endpoint.isElementVisible(2, DISPOSITIONS_CLOSE_BUTTON, Lookup.ID)) {
            endpoint.jsClick(() -> DISPOSITIONS_CLOSE_BUTTON);
        }
        return null;
    }

    @Click(value = SIGNATURE_TEMPLATES_BUTTON, jsClick = true)
    PVX043_S001_SignatureTemplatesPage clickSignatureTemplates();
}
