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

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

import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.RECAPITULATION_HEADER_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.RECAPITULATION_TITLE_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.RECAPITULATION_CLIENT_CONTRIBUTION_TITLE_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.RECAPITULATION_EMPLOYER_CONTRIBUTION_TITLE_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.CURRENT_CONTRIBUTION_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.NEW_CONTRIBUTION_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.CURRENT_EMPLOYER_CONTRIBUTION_XPATH;
import static cz.moneta.test.dsl.newib.savings.DpsRecapitulationPage.NEW_EMPLOYER_CONTRIBUTION_XPATH;

@Wait({RECAPITULATION_HEADER_XPATH, RECAPITULATION_TITLE_XPATH, RECAPITULATION_CLIENT_CONTRIBUTION_TITLE_XPATH, RECAPITULATION_EMPLOYER_CONTRIBUTION_TITLE_XPATH, CURRENT_CONTRIBUTION_XPATH, NEW_CONTRIBUTION_XPATH, CURRENT_EMPLOYER_CONTRIBUTION_XPATH, NEW_EMPLOYER_CONTRIBUTION_XPATH})
public interface DpsRecapitulationPage extends NewIbPageFlow<DpsRecapitulationPage> {

    String RECAPITULATION_HEADER_XPATH = "//h1[@data-testid='dps-recapitulation-header' and text()='Doplňkové penzijní spoření']";
    String RECAPITULATION_TITLE_XPATH = "//h2[@data-testid='dps-recapitulation-title' and text()='Rekapitulace']";
    String RECAPITULATION_CLIENT_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-clienContributionTitle' and text()='Váš měsíční vklad']";
    String RECAPITULATION_EMPLOYER_CONTRIBUTION_TITLE_XPATH = "//h3[@data-testid='dps-recapitulation-employerContributionTitle' and text()='Příspěvek zaměstnavatele']";
    String CURRENT_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentContribution' and normalize-space(.)='Původní']]";
    String NEW_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newContribution' and normalize-space(.)='Nový']]";
    String CURRENT_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-currentEmployerContribution' and normalize-space(string(.))='Původně']]";
    String NEW_EMPLOYER_CONTRIBUTION_XPATH = "//div[.//span[@data-testid='dps-recapitulation-newEmployerContribution' and normalize-space(string(.))='Nově']]";
    String CONTINUE_BUTTON_XPATH = "//button[@data-testid='dps-recapitulation-btn-next' and text()='Pokračovat']";

    @Click(CONTINUE_BUTTON_XPATH)
    AmlQuestionnairePage clickOnContinueButton();
}