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

import cz.moneta.test.harness.support.web.Click;
import cz.moneta.test.harness.support.web.TypeInto;
import cz.moneta.test.harness.support.web.Wait;
import cz.moneta.test.harness.support.web.WebFlow;

import static cz.moneta.test.dsl.ufo.common.authentication.UfoLoginPage.CONFIRM_BUTTON;
import static cz.moneta.test.dsl.ufo.common.authentication.UfoLoginPage.PASSWORD_INPUT;
import static cz.moneta.test.dsl.ufo.common.authentication.UfoLoginPage.USERNAME_INPUT;

@Wait({USERNAME_INPUT, PASSWORD_INPUT, CONFIRM_BUTTON})
@Wait(explicitWaitSeconds = 3)
public interface UfoLoginPage extends WebFlow<UfoLoginPage> {

    String USERNAME_INPUT = "LOG001_S001_E001";
    String PASSWORD_INPUT = "LOG001_S001_E002";
    String CONFIRM_BUTTON = "LOG001_S001_B003";

    @TypeInto(value = USERNAME_INPUT, andWait = @Wait(explicitWaitSeconds = 1))
    @TypeInto(PASSWORD_INPUT)
    @Click(CONFIRM_BUTTON)
    UfoLoginPageTransitions typeUserNameAndPasswordAndClickLogin(String username, String password);
}
