function testField (textfield, value) {
        describe(textfield + ' textfield ', function () {
            it(textfield + ' textfield is editable', function () {
                ST.textField('register [name=' + textfield +']')
                    .type(value)
                    .and(function (textfield) {
                        // check if textfield contains expected value/string
                        expect(textfield.getValue()).toBe(value);
                    });
            });

            it(textfield + ' textfield is invalid', function () {
                ST.textField('register [name=' + textfield +']')
                    .and(function (textfield) {
                        textfield.setValue('');
                        // check if textfield is invalid
                        expect(textfield.isValid()).toBeFalsy();
                    });
            });

            it(textfield + ' textfield is valid', function () {
                ST.textField('register [name=' + textfield +']')
                    .type(value)
                    .and(function (textfield) {
                        // check if textfield is valid
                        expect(textfield.isValid()).toBeTruthy();
                    });
            });
        });
    }
// common function for testing text field
common function for testing text field
common function for testing text field
function testField (textfield, value) {
        describe(textfield + ' textfield ', function () {
            it(textfield + ' textfield is editable', function () {
                ST.textField('register [name=' + textfield +']')
                    .type(value)
                    .and(function (textfield) {
                        expect(textfield.getValue()).toBe(value);
                    });
            });
            it(textfield + ' textfield is invalid', function () {
                ST.textField('register [name=' + textfield +']')
                    .and(function (textfield) {
                        textfield.setValue('');
                        expect(textfield.isValid()).toBeFalsy();
                    });
            });
            it(textfield + ' textfield is valid', function () {
                ST.textField('register [name=' + textfield +']')
                    .type(value)
                    .and(function (textfield) {
                        expect(textfield.isValid()).toBeTruthy();
                    });
            });
        });
    }
function testField ( textfield , value ) { describe ( textfield + ' textfield ' , function ( ) { it ( textfield + ' textfield is editable' , function ( ) { ST . textField ( 'register [name=' + textfield + ']' ) . type ( value ) . and ( function ( textfield ) { expect ( textfield . getValue ( ) ) . toBe ( value ) ; } ) ; } ) ; it ( textfield + ' textfield is invalid' , function ( ) { ST . textField ( 'register [name=' + textfield + ']' ) . and ( function ( textfield ) { textfield . setValue ( '' ) ; expect ( textfield . isValid ( ) ) . toBeFalsy ( ) ; } ) ; } ) ; it ( textfield + ' textfield is valid' , function ( ) { ST . textField ( 'register [name=' + textfield + ']' ) . type ( value ) . and ( function ( textfield ) { expect ( textfield . isValid ( ) ) . toBeTruthy ( ) ; } ) ; } ) ; } ) ; }
common function for testing text field
common function for testing text field
// check if textfield contains expected value/string // check if textfield is invalid // check if textfield is valid