public void WhenEnterInputValueToTheFieldNameToTheFormAndPressEnterKey(string inputStr, string fieldName)
        {
            switch (fieldName)
            {
            case "email":
                registerPage.EmailEnter(inputStr);
                break;

            case "username":
                registerPage.UsernameEnter(inputStr);
                break;

            case "password":
                registerPage.PasswordEnter(inputStr);
                break;

            case "captchaCode":
                registerPage.CaptchaCodeEnter(inputStr);
                break;

            case "userterm":
                registerPage.UserTermsSelect(inputStr);
                break;
            }
        }
Exemplo n.º 2
0
        public void ThenInputValueToTheFieldNameAsBelowAndShouldGetMsg(Table table)
        {
            string inputString = "";
            string expectMsg   = "";
            string fieldName   = "";

            foreach (var row in table.Rows)
            {
                inputString = row["inputValue"].ToString();
                expectMsg   = row["msg"].ToString();
                fieldName   = row["fieldName"].ToString();

                switch (fieldName)
                {
                case "email":
                    registerPage.EmailEnter(inputString);
                    registerPage.LoginErrMsgDisplayed(expectMsg, fieldName);
                    break;

                case "username":
                    registerPage.UsernameEnter(inputString);
                    registerPage.LoginErrMsgDisplayed(expectMsg, fieldName);
                    break;

                case "password":
                    registerPage.PasswordEnter(inputString);
                    registerPage.LoginErrMsgDisplayed(expectMsg, fieldName);
                    break;

                case "captchaCode":
                    registerPage.CaptchaCodeEnter(inputString);
                    registerPage.LoginErrMsgDisplayed(expectMsg, fieldName);
                    break;

                case "userterm":
                    registerPage.UserTermsSelect(inputString);
                    registerPage.RegisterBtnClick();
                    registerPage.LoginErrMsgDisplayed(expectMsg, fieldName);
                    break;
                }
            }
        }