package cz.moneta.test.dsl.forte.pages.appointments;

import cz.moneta.test.dsl.forte.FortePageFlow;
import cz.moneta.test.dsl.forte.components.AppointmentsMenu;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.forte.pages.appointments.NotSignedAppointments.PAGE_TITLE;

@Wait(PAGE_TITLE)
public interface NotSignedAppointments extends FortePageFlow<NotSignedAppointments>, AppointmentsMenu {
    String PAGE_TITLE = CONTENT_DIV + "//h3[text()='Schůzky bez přiděleného bankéře']";
    String APPOINTMENTS_TABLE = CONTENT_DIV + "//form[@action='/appointments/notassigned/']";

    String CLIENT_FILTER_INPUT = "//input[@name='filters[client]']";
    String NOTE_FILTER_INPUT = "//input[@name='filters[note]']";
    String SUBMIT_FILTER_BUTTON = "//label[./*[@id='filter-grid']]";
    String FIRST_APPOINTMENT_DETAIL_BUTTON = "(//a[@title='Detail schůzky']/span)[1]";

    @CheckElementPresent(APPOINTMENTS_TABLE)
    NotSignedAppointments checkTablePresents();

    @TypeInto(CLIENT_FILTER_INPUT)
    NotSignedAppointments fillClientFilter(String clientName);

    @TypeInto(NOTE_FILTER_INPUT)
    NotSignedAppointments fillNoteFilter(String note);

    @Click(value = SUBMIT_FILTER_BUTTON)
    NotSignedAppointments clickSubmitFilter();

    @Click(value = FIRST_APPOINTMENT_DETAIL_BUTTON)
    AppointmentDetail clickFirstAppointmentDetail();
}