Beispiel #1
0
        // Check mandatory validation and field length validation
        void checkMandatory(ClientCreateValiHelper helper, ExecutionLog log)
        {
            goToFP(helper, log);
            clearAllChoice(helper, log);
            log.Log("ClientCreateVali", "check mandatory");
            helper.ClickElement("Mandatory");
            log.Log("ClientCreateVali", "check field length");
            helper.ClickElement("FieldLength");
            helper.TypeText("LengthMin", "5");
            helper.TypeText("LengthMax", "10");
            log.Log("ClientCreateVali", "save validation");
            helper.ClickElement("SaveVali");
            log.Log("ClientCreateVali", "go to client");
            goToClient(helper);
            log.Log("ClientCreateVali", "mandatory check:no input");
            helper.ClearText("LegalNameInput");
            helper.ClickElement("Save");
            helper.WaitForWorkAround(500);
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "mandatory no input pass");
            log.Log("ClientCreateVali", "field length: check short input");

            helper.ClearText("LegalNameInput");
            helper.TypeText("LegalNameInput", "55");
            helper.ClickElement("Save");

            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "short input pass");
            log.Log("ClientCreateVali", "field length: check long input");

            helper.ClearText("LegalNameInput");
            helper.TypeText("LegalNameInput", "jjiiawethfjiwe");
            helper.ClickElement("Save");
            string nameinput = helper.GetTextContent("LegalNameInput");

            Assert.IsTrue(nameinput.Length == 10);
            log.Log("ClientCreateVali", "field length: long input pass");
        }
Beispiel #2
0
        //check data type and data format
        void checkDataTypeandFormat(ClientCreateValiHelper helper, ExecutionLog log)
        {
            log.Log("ClientCreateVali", "check datatype:Numeric");
            changeDataType(helper, "numeric", log);
            log.Log("ClientCreateVali", "check datatype:Numeric data range");

            helper.TypeText("LengthMin", "5");
            helper.TypeText("LengthMax", "10");
            helper.ClickElement("SaveVali");
            log.Log("ClientCreateVali", "check datatype:Numeric go to client");
            goToClient(helper);
            log.Log("ClientCreateVali", "check datatype:Numeric clear legal name text box");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Numeric illegal input string");
            helper.TypeText("LegalNameInput", "fdsf");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Numeric illegal input string pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Numeric small input");
            helper.TypeText("LegalNameInput", "1");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Numeric small input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Numeric large input");
            helper.TypeText("LegalNameInput", "12");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Numeric large input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Numeric illegal input decimal");
            helper.TypeText("LegalNameInput", "6.5");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Numeric illegal input decimal pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Numeric legal input");
            helper.TypeText("LegalNameInput", "6");
            helper.ClickElement("Save");
            string nameinput = helper.GetTextContent("LegalNameInput");

            Assert.IsTrue(nameinput == "6");
            log.Log("ClientCreateVali", "check datatype:Numeric legal input pass");


            log.Log("ClientCreateVali", "check datatype:Decimal");
            changeDataType(helper, "decimal", log);
            log.Log("ClientCreateVali", "check datatype:Decimal range");
            helper.TypeText("LengthMin", "5");
            helper.TypeText("LengthMax", "10");
            helper.ClickElement("SaveVali");
            log.Log("ClientCreateVali", "check datatype:Decimal go to client");
            goToClient(helper);
            log.Log("ClientCreateVali", "check datatype:Decimal clear legal name text box");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Decimal illegal input string");
            helper.TypeText("LegalNameInput", "fdsf");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Decimal illegal input string pass");
            log.Log("ClientCreateVali", "check datatype:Decimal clear input box");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Decimal small input");
            helper.TypeText("LegalNameInput", "1.5");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Decimal small input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Decimal large input");
            helper.TypeText("LegalNameInput", "12.5");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check datatype:Decimal large input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check datatype:Decimal legal input");
            helper.TypeText("LegalNameInput", "6.5");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput == "6.5");
            log.Log("ClientCreateVali", "check datatype:Decimal legal input pass");


            log.Log("ClientCreateVali", "check format:Email");
            changeDataFormat(helper, "email", log);
            log.Log("ClientCreateVali", "check format:Email go to client");
            goToClient(helper);
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:Email illegal input");
            helper.TypeText("LegalNameInput", "gg");
            helper.ClickElement("Save");
            helper.verifyElementPresent("ErrorMes");
            log.Log("ClientCreateVali", "check format:Email illegal input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:Email legal input");
            helper.TypeText("LegalNameInput", "*****@*****.**");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput == "*****@*****.**");
            log.Log("ClientCreateVali", "check format:Email legal input pass");


            log.Log("ClientCreateVali", "check format:ssn");
            changeDataFormat(helper, "ssn", log);
            log.Log("ClientCreateVali", "check format:ssn go to client");
            goToClient(helper);
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:ssn illegal input string");
            helper.TypeText("LegalNameInput", "gg");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:ssn illegal input string pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:ssn short input");
            helper.TypeText("LegalNameInput", "44");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:ssn short input pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:ssn long input");
            helper.TypeText("LegalNameInput", "543737345245273762");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 11);
            log.Log("ClientCreateVali", "check format:ssn long input pass");

            log.Log("ClientCreateVali", "check format:Phone");
            changeDataFormat(helper, "phone", log);
            log.Log("ClientCreateVali", "check format:Phone go to client");
            goToClient(helper);
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:Phone inllegal input string");
            helper.TypeText("LegalNameInput", "gg");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:Phone illegal input string pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:Phone short");
            helper.TypeText("LegalNameInput", "44");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:Phone short pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:Phone long");
            helper.TypeText("LegalNameInput", "543737345245273762");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 14);
            log.Log("ClientCreateVali", "check format:Phone long pass");


            log.Log("ClientCreateVali", "check format:TaxID");
            changeDataFormat(helper, "taxid", log);
            goToClient(helper);
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:TaxID illegal input string");
            helper.TypeText("LegalNameInput", "gg");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:TaxID illegal input string pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:TaxID short");
            helper.TypeText("LegalNameInput", "44");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 0);
            log.Log("ClientCreateVali", "check format:TaxID short pass");
            helper.ClearText("LegalNameInput");
            log.Log("ClientCreateVali", "check format:TaxID long");
            helper.TypeText("LegalNameInput", "543737345245273762");
            helper.ClickElement("Save");
            nameinput = helper.GetTextContent("LegalNameInput");
            Assert.IsTrue(nameinput.Length == 10);
            log.Log("ClientCreateVali", "check format:TaxID long pass");
        }