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

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.dsl.newib.components.VerticalMainMenu;
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.mainpage.InsurancePage.*;

@Wait(value = {VERTICAL_MENU_XPATH, OVERVIEW_ITEM_XPATH, ACCOUNTS_ITEM_XPATH, SAVINGS_ITEM_XPATH, LOANS_AND_MORTGAGES_ITEM_XPATH, CARDS_ITEM_XPATH, INSURANCE_ITEM_XPATH, INVESTMENTS_ITEM_XPATH, EXCHANGE_ITEM_XPATH}, waitSecondsForElement = 30)
public interface InsurancePage extends NewIbPageFlow<InsurancePage>, VerticalMainMenu {

    String REDIRECTING_TO_OLD_IB_TITLE = "//h2[@class='t-title t-title--h3 c-modal__title'][text()='Přesměrujeme Vás do původní Internet Banky']";
    String INSURANCE_HEADLINE_XPATH = "//h1[@class='t-title t-title--h3 u-mb--0'][text()='Pojištění']";
    String DECLINE_REDIRECT_BTN_XPATH = "//button[@data-testid='decline-redirect-button']";

    @CheckElementPresent(REDIRECTING_TO_OLD_IB_TITLE)
    InsurancePage checkRedirectingToOldIbTitleIsPresent();

    @CheckElementPresent(INSURANCE_HEADLINE_XPATH)
    InsurancePage checkInsuranceHeadlineIsPresent();

    @Click(DECLINE_REDIRECT_BTN_XPATH)
    InsurancePage clickOnCancel();
}
