package cz.moneta.test.dsl.ufo.common.authentication;

import cz.moneta.test.dsl.ufo.common.landing.ADM162_S001_selectPageTomcatSso;
import cz.moneta.test.harness.support.web.*;

import static cz.moneta.test.dsl.ufo.common.authentication.UfoLoginPageTomcatSso.*;

@Wait(value = {LOGIN_PAGE_TITLE_XPATH, USERNAME_INPUT_XPATH, PASSWORD_INPUT_XPATH, SIGN_IN_BUTTON_XPATH}, waitSecondsForElement = 30, by = Lookup.XPATH)
public interface UfoLoginPageTomcatSso extends WebFlow<UfoLoginPageTomcatSso> {
    String LOGIN_PAGE_TITLE_XPATH = "//title[contains(text(), 'Please sign in')]";
    String USERNAME_INPUT_XPATH = "//input[@id='username']";
    String PASSWORD_INPUT_XPATH = "//input[@id='password']";
    String SIGN_IN_BUTTON_XPATH = "//button[@type='submit']";

    @TypeInto(value = USERNAME_INPUT_XPATH, by = Lookup.XPATH)
    @TypeInto(value = PASSWORD_INPUT_XPATH, by = Lookup.XPATH)
    @Click(value = SIGN_IN_BUTTON_XPATH, by = Lookup.XPATH)
    ADM162_S001_selectPageTomcatSso typeUsernameAndPasswordClickToSignIn();
}
