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

import cz.moneta.test.dsl.newib.NewIbPageFlow;
import cz.moneta.test.dsl.newib.accounts.CurrentAccountPage;
import cz.moneta.test.dsl.newib.components.HorizontalMainMenu;
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.payments.MobileOperatorsPaymentVictoryPage.*;

@Wait(value = {TRANSACTION_OVERVIEW_BUTTON_XPATH, NEXT_CREDIT_PAYMENT_BUTTON_XPATH}, waitSecondsForElement = 30)
public interface MobileOperatorsPaymentVictoryPage extends NewIbPageFlow<MobileOperatorsPaymentVictoryPage>, HorizontalMainMenu, VerticalMainMenu {

    String VICTORY_CREDIT_TITLE_SUMMARY_PAGE_XPATH = "//h1[text()='Kredit byl úspěšně dobit']";
    String VICTORY_INVOICE_TITLE_SUMMARY_PAGE_XPATH = "//h1[text()='Faktura byla zaplacena']";
    String TRANSACTION_OVERVIEW_BUTTON_XPATH = "//button[@data-testid='submit']";
    String NEXT_CREDIT_PAYMENT_BUTTON_XPATH = "//button[@data-testid='back']";

    @Click(TRANSACTION_OVERVIEW_BUTTON_XPATH)
    CurrentAccountPage clickOnTransactionOverview();

    @CheckElementPresent(VICTORY_CREDIT_TITLE_SUMMARY_PAGE_XPATH)
    MobileOperatorsPaymentVictoryPage checkCreditPaymentVictoryText();

    @CheckElementPresent(VICTORY_INVOICE_TITLE_SUMMARY_PAGE_XPATH)
    MobileOperatorsPaymentVictoryPage checkInvoicePaymentVictoryText();
}
