package cz.moneta.test.dsl.exevido.pages.inheritance;

import cz.moneta.test.dsl.exevido.ExevidoWebFlow;
import cz.moneta.test.dsl.exevido.components.ExevidoPanels;
import cz.moneta.test.harness.context.StoreAccessor;
import cz.moneta.test.harness.endpoints.exevido.ExevidoEndpoint;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.exevido.pages.inheritance.FoldersPage.PAGE_LABEL_XPATH;


@Wait(value = PAGE_LABEL_XPATH, by = Lookup.XPATH)
public interface FoldersPage extends ExevidoWebFlow<FoldersPage>, StoreAccessor {

    String PAGE_LABEL_XPATH = "//b[contains(text(),'Spisy')]";
    String PRODUCT_OWNER_NAME_INPUT = "text_product_owner_name";
    String FOLDER_MESSAGE_ROW = "folder_0_row";

    @TypeInto(value = PRODUCT_OWNER_NAME_INPUT)
    @KeyPress(value = Key.ENTER, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
    FoldersPage fillProductOwnerName(String name);

    @Click(value = FOLDER_MESSAGE_ROW, andWait = @Wait(value = ExevidoPanels.LOADER_DIV, until = Until.GONE))
    DetailFolderPage clickFolderRow();

}