Skip to content

PageObject start page Expample

VolodymyrRomanyshyn edited this page Aug 12, 2019 · 2 revisions

Start Page

public class LoginPage : BasePage, ILoad
    {
        [Id("UserName")] public TextInputField UserName;
        [Id("Password")] public TextInputField Password;
        [Id("btnLogin")] public Button Login;

        public LoginPage() : base(new BaseDriver(Settings.PageSettings), "http://yourlink.here")
        {
        }

        public bool IsLoaded() =>
            UserName.IsVisible &&
            Password.IsVisible &&
            Login.IsVisible;

        public IBasePage CorrectLogin(User user)
        {
            UserName.SendString(user.UserName);
            Password.SendString(user.Password);
            Login.Click();
            return Page<HomePage>();
        }

    }
Clone this wiki locally