package cz.moneta.test.dsl.ib.authentication;

import cz.moneta.test.dsl.ib.IbPageFlow;
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 static cz.moneta.test.dsl.ib.authentication.LoginPage.*;

@Wait(value = {USERNAME_INPUT, PASSWORD_INPUT, CONFIRM_BUTTON})
public interface LoginPage extends IbPageFlow<LoginPage> {

    String USERNAME_INPUT = "//input[@tabindex='1' and @type='text']";
    String PASSWORD_INPUT = "//input[@tabindex='2' and @type='password']";
    String CONFIRM_BUTTON = "//button[@type='submit']";

    @TypeInto(USERNAME_INPUT)
    LoginPage typeUsername(String username);

    @TypeInto(PASSWORD_INPUT)
    LoginPage typePassword(String password);

    @Click(CONFIRM_BUTTON)
    LoginPageTransitions clickLogin();
}
