package cz.moneta.test.dsl.fortelight.components;

import cz.moneta.test.dsl.fortelight.pages.ForteLightHomePage;
import cz.moneta.test.dsl.fortelight.pages.MyPage;
import cz.moneta.test.dsl.fortelight.pages.attendance.TimesheetPage;
import cz.moneta.test.dsl.fortelight.pages.intermediary.IntermediaryPage;
import cz.moneta.test.dsl.fortelight.pages.portal.PortalPage;
import cz.moneta.test.harness.support.web.Builder;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.fortelight.components.PageHeader.HOME_PAGE_LINK;
import static cz.moneta.test.dsl.fortelight.components.PageHeader.NAVIGATION_DIV;

@Wait({HOME_PAGE_LINK, NAVIGATION_DIV})
public interface PageHeader extends Builder {
    String HEADER_DIV = "//div[@class='header']";
    String HOME_PAGE_LINK = HEADER_DIV + "//a[@href='/portal/home/']";

    String NAVIGATION_DIV = HEADER_DIV + "//div[@class='navigation']";
    String NAVIGATION_BUTTON = NAVIGATION_DIV + "//div[@id='navigation-button']";
    String ATTENDANCE_LINK = NAVIGATION_DIV + "//a[@href='/attendance/']";
    String INTERMEDIARY_LINK = NAVIGATION_DIV + "//a[@href='/intermediary/']";
    String PORTAL_LINK = HEADER_DIV + "//a[@href='/portal/home/']//img";

    String IDENTITY_DIV = HEADER_DIV + "//div[@class='identity']";
    String MY_PROFILE_LINK = IDENTITY_DIV + "//a[@href='/portal/my/']";

    @Click(HOME_PAGE_LINK)
    ForteLightHomePage clickHomePage();

    @Click(ATTENDANCE_LINK)
    TimesheetPage clickAttendance();

    @Click(MY_PROFILE_LINK)
    MyPage clickMyProfileIcon();

    @Click(NAVIGATION_BUTTON)
    PageHeader clickNavigationButton();

    @Click(INTERMEDIARY_LINK)
    IntermediaryPage clickIntermediaryMenu();

    @Click(PORTAL_LINK)
    PortalPage clickPortalMenu();
}