package cz.moneta.test.dsl.newib.messages;

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.harness.support.web.CheckElementPresent;
import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.Wait;

import static cz.moneta.test.dsl.newib.messages.MessageDetailPage.BIN_BTN_XPATH;
import static cz.moneta.test.dsl.newib.messages.MessageDetailPage.PRINT_BTN_XPATH;

@Wait(value = {BIN_BTN_XPATH, PRINT_BTN_XPATH}, waitSecondsForElement = 30)
public interface MessageDetailPage extends NewIbPageFlow<MessageDetailPage> {

    String BIN_BTN_XPATH = "//span[@class='c-icon c-icon--bin']";
    String PRINT_BTN_XPATH = "//span[@class='c-icon c-icon--print']";
    String CONFIRM_BTN_XPATH = "//button[@data-testid='confirm-button']";
    String CONFIRMATION_DELETE_TXT_XPATH = "//h2[@class='t-title t-title--h3 c-modal__title'][text()='Zpráva je smazaná']";

    @Click(BIN_BTN_XPATH)
    MessageDetailPage deleteMessage();

    @Click(CONFIRM_BTN_XPATH)
    MessageDetailPage confirm();

    @CheckElementPresent(CONFIRMATION_DELETE_TXT_XPATH)
    MessageDetailPage checkConfirmationDeleteTextPresent();
}
