describe('idai field app', function() {

    function createObject(fun) {

        clickCreateObject()
                .then(selectTypeObject)
                .then(typeInIdentifier)
                .then(saveObject)
                .then(function(){fun();});
    }


    function clickCreateObject() {
        return element(by.id('object-overview-button-create-object')).click()
    }

    function selectTypeObject() {
        return element(by.id('create-object-option-0')).click();
    }

    function typeInIdentifier() {
        return element(by.id('object-edit-input-identifier')).clear().sendKeys('1').sendKeys('2');
    }

    function saveObject() {
        return element(by.id('object-edit-button-save-object')).click();
    }

    beforeEach(function(){
        browser.get('/');
    });

    it('should create a new object of first listed type ', function() {
        createObject(function(){
            expect(element(by.id('object-overview-identifier-0')).getText()).toEqual("12");
        });
    });

    it('should warn if an existing id is used ', function() {
        createObject(function(){

            createObject(function() {
                expect(element(by.id('message-0')).getText()).
                    toEqual("Objekt Identifier existiert bereits. Bei Klick auf ein anderes Objekt wird der ursprüngliche Zustand wiederhergestellt.");
            });
        });
    });
});

@@ -60,19 +60,16 @@
 eObject(
-fun
 ) %7B%0A%0A   
@@ -73,16 +73,23 @@
         
+return 
 clickCre
@@ -217,50 +217,8 @@
 ect)
-%0A                .then(function()%7Bfun();%7D)
 ;%0A  
@@ -844,32 +844,52 @@
    createObject(
+)%0A            .then(
 function()%7B%0A    
@@ -876,32 +876,36 @@
 hen(function()%7B%0A
+    
             expe
@@ -980,32 +980,36 @@
 (%2212%22);%0A        
+ 
+   
 %7D);%0A    %7D);%0A%0A   
@@ -1001,32 +1001,33 @@
 );%0A    %7D);%0A%0A    
+f
 it('should warn 
@@ -1089,28 +1089,17 @@
 eObject(
-function()%7B%0A
+)
 %0A       
@@ -1095,32 +1095,38 @@
 t()%0A            
+.then(
 createObject(fun
@@ -1121,16 +1121,35 @@
 teObject
+)%0A            .then
 (functio
@@ -1143,33 +1143,32 @@
 .then(function()
- 
 %7B%0A              
@@ -1384,28 +1384,16 @@
     %7D);%0A
-        %7D);%0A
     %7D);%0A

Improve readability further.