package cz.moneta.test.dsl.auto.smartauto.setman;

import cz.moneta.test.dsl.auto.smartauto.SmartAutoFlow;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Until;
import cz.moneta.test.harness.support.web.Wait;

public interface MainPage extends SmartAutoFlow<MainPage> {

    String MENU_PARTNERS = "(//li[contains(text(), 'Partneři')])";
    String SUBMENU_ACQUISITION_PLACES = "(//div[contains(text(), 'Pořizovací místa')])";
    String SUBMENU_OPERATORS = "(//div[contains(text(), 'Aktivní operátoři')])";
    String SUBMENU_NEW_OPERATORS = "(//div[contains(text(), 'Noví operátoři')])";
    String SUBMENU_NEW_DEALERS = "(//div[contains(text(), 'Noví prodejci')])";
    String SUBMENU_DEALERS = "(//div[contains(text(), 'Prodejci')])";
    String SUBMENU_EXT_PARTNERS = "(//div[contains(text(), 'Externí partneři')])";
    String MENU_PRODUCTS = "(//li[contains(text(), 'Produkty')])";
    String MENU_INSURANCE = "(//li[contains(text(), 'Pojištění')])";
    String MENU_DOCUMENTS = "(//li[contains(text(), 'Dokladovost')])";
    String MENU_OTHERS = "(//li[contains(text(), 'Ostatní')])";


    @CheckElementPresent(MENU_PARTNERS)
    MainPage checkMenuPartners();

    @CheckElementPresent(MENU_PRODUCTS)
    MainPage checkMenuProducts();

    @CheckElementPresent(MENU_INSURANCE)
    MainPage checkMenuInsurance();

    @CheckElementPresent(MENU_DOCUMENTS)
    MainPage checkMenuDocuments();

    @CheckElementPresent(MENU_OTHERS)
    MainPage checkMenuOthers();

    @Click(value = MENU_PARTNERS, andWait = @Wait(value = {SUBMENU_DEALERS, SUBMENU_NEW_DEALERS, SUBMENU_ACQUISITION_PLACES, SUBMENU_EXT_PARTNERS, SUBMENU_NEW_OPERATORS, SUBMENU_OPERATORS}, until = Until.VISIBLE))
    MainPage clickMenuPartners();

    @Click(value = SUBMENU_NEW_DEALERS, jsClick = true)
    NewDealersPage clickNewDealers();

    @Click(value = SUBMENU_DEALERS, jsClick = true)
    DealersPage clickDealers();
}