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

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

import static cz.moneta.test.dsl.forte.pages.contracts.ListPaymentsPage.PAGE_TITLE;
import static cz.moneta.test.dsl.forte.pages.contracts.ListPaymentsPage.FIRST_PAYMENT_DETAIL_BUTTON;

@Wait({PAGE_TITLE, FIRST_PAYMENT_DETAIL_BUTTON})
public interface ListPaymentsPage extends FortePageFlow<ListPaymentsPage>, ContractsMenu {
    String PAGE_TITLE = CONTENT_DIV + "//h3[text()='Přehled všech plateb za období']";
    String CURRENT_MONTH_BUTTON = "//div[@class='controlContainer']//input[@name='nowBtn']";

    String RESULT_FORM = CONTENT_DIV + "//form[@id='frm-grid-form']";
    String FIRST_PAYMENT_DETAIL_BUTTON = RESULT_FORM + "//span[@class='ge-icon fa icon icon-view ge-color-blue']";

    @Click(value = CURRENT_MONTH_BUTTON, andWait = @Wait(value = SPINNER, until = Until.GONE, by = Lookup.ID))
    ListPaymentsPage clickCurrentMonth();

    @Click(FIRST_PAYMENT_DETAIL_BUTTON)
    PaymentDetailPage clickFirstPaymentDetail();

}