function createEventViaButton (calendar, title, startDate, endDate, allDay, description, check) {
        describe ("Event is created - " + title, function() {
            it ("Add form is opened", function(){
                if(ST.os.is.Desktop) {
                    Button.common("Create").click();
                } else {
                    Button.phone("onCreateTap").click();
                }
            });
            if (calendar !== "") {
                it (calendar + " type is selected", function(){
                    selectCalendar(calendar);
                });
            }
            it (title + " title is entered", function(){
                enterText("title", title);
            });
            if (allDay !== "") {
                it ("All day is configured to " + allDay, function(){
                    setAllDay(allDay);
                });
            }
            if (startDate !== "") {
                it ("Start date is entered " + dateForForm(startDate), function(){
                    setDate("startDate",startDate,0);
                });
            }
            if (endDate !== "") {
                it ("End date is entered " + dateForForm(endDate), function(){
                    setDate("endDate",endDate,1);
                });
            }
            if (description !== "") {
                it (description + " description is entered", function(){
                    enterText("description", description);
                });
            }
            it ("Event is created", function(){
                Lib.ghostClick("calendar-form-add button[_text='Save']",true);
            });
        });
        if (check) {
            describe("Event is checked - " + title, function() {
                // TODO can be removed when ORION-1669 is fixed
                afterAll(function () {
                    EditForm.form().and(function (form) {
                        form.onCancelTap();
                    });
                });
                checkEvent(calendar, title, allDay, startDate, endDate, description);
            });
        }
    }
// if you want create and also check event => check=true
if you want create and also check event => check=true
if you want create and also check event = > check = true
function createEventViaButton (calendar, title, startDate, endDate, allDay, description, check) {
        describe ("Event is created - " + title, function() {
            it ("Add form is opened", function(){
                if(ST.os.is.Desktop) {
                    Button.common("Create").click();
                } else {
                    Button.phone("onCreateTap").click();
                }
            });
            if (calendar !== "") {
                it (calendar + " type is selected", function(){
                    selectCalendar(calendar);
                });
            }
            it (title + " title is entered", function(){
                enterText("title", title);
            });
            if (allDay !== "") {
                it ("All day is configured to " + allDay, function(){
                    setAllDay(allDay);
                });
            }
            if (startDate !== "") {
                it ("Start date is entered " + dateForForm(startDate), function(){
                    setDate("startDate",startDate,0);
                });
            }
            if (endDate !== "") {
                it ("End date is entered " + dateForForm(endDate), function(){
                    setDate("endDate",endDate,1);
                });
            }
            if (description !== "") {
                it (description + " description is entered", function(){
                    enterText("description", description);
                });
            }
            it ("Event is created", function(){
                Lib.ghostClick("calendar-form-add button[_text='Save']",true);
            });
        });
        if (check) {
            describe("Event is checked - " + title, function() {
                afterAll(function () {
                    EditForm.form().and(function (form) {
                        form.onCancelTap();
                    });
                });
                checkEvent(calendar, title, allDay, startDate, endDate, description);
            });
        }
    }
function createEventViaButton ( calendar , title , startDate , endDate , allDay , description , check ) { describe ( "Event is created - " + title , function ( ) { it ( "Add form is opened" , function ( ) { if ( ST . os . is . Desktop ) { Button . common ( "Create" ) . click ( ) ; } else { Button . phone ( "onCreateTap" ) . click ( ) ; } } ) ; if ( calendar !== "" ) { it ( calendar + " type is selected" , function ( ) { selectCalendar ( calendar ) ; } ) ; } it ( title + " title is entered" , function ( ) { enterText ( "title" , title ) ; } ) ; if ( allDay !== "" ) { it ( "All day is configured to " + allDay , function ( ) { setAllDay ( allDay ) ; } ) ; } if ( startDate !== "" ) { it ( "Start date is entered " + dateForForm ( startDate ) , function ( ) { setDate ( "startDate" , startDate , 0 ) ; } ) ; } if ( endDate !== "" ) { it ( "End date is entered " + dateForForm ( endDate ) , function ( ) { setDate ( "endDate" , endDate , 1 ) ; } ) ; } if ( description !== "" ) { it ( description + " description is entered" , function ( ) { enterText ( "description" , description ) ; } ) ; } it ( "Event is created" , function ( ) { Lib . ghostClick ( "calendar-form-add button[_text='Save']" , true ) ; } ) ; } ) ; if ( check ) { describe ( "Event is checked - " + title , function ( ) { afterAll ( function ( ) { EditForm . form ( ) . and ( function ( form ) { form . onCancelTap ( ) ; } ) ; } ) ; checkEvent ( calendar , title , allDay , startDate , endDate , description ) ; } ) ; } }
if you want create and also check event => check=true
if you want create and also check event = > check = true
// TODO can be removed when ORION-1669 is fixed