'use strict';

exports.config = {
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: [
    'app/account.js',
    'app/action.js',
    'app/app.js',
    'app/config.js',
    'app/connection.js',
    'app/log.js',
    'app/rate.js',
    'app/routes.js',
    'app/schema.js',
    'app/scope.js',
    'app/statistic.js',
    'app/user.js',
    'app/import.js'
  ],
  baseUrl: 'http://127.0.0.1:8008/fusio/index.htm',
  capabilities: {
    browserName: 'firefox'
  },
  onPrepare: function() {
    // login
    browser.driver.get('http://127.0.0.1:8008/fusio/index.htm#/login');

    element(by.model('credentials.username')).sendKeys('Developer');
    element(by.model('credentials.password')).sendKeys('qf2vX10Ec3wFZHx0K1eL');

    var EC = protractor.ExpectedConditions;
    var submitButton = element(by.css('button[type=submit]'));

    browser.wait(EC.elementToBeClickable(submitButton), 5000);
    submitButton.click();

    element(by.css('body')).getAttribute('innerHTML').then(function(value){
      console.log(value);
    });

    return browser.driver.wait(function() {
      return browser.driver.getCurrentUrl().then(function(url) {
        console.log(url);
        return /#\/dashboard/.test(url);
      });
    }, 10000);
  }
};

@@ -835,24 +835,31 @@
 t%5D'));%0A%0A    
+return 
 browser.wait
@@ -903,18 +903,37 @@
 ), 5000)
-;%0A
+.then(function()%7B%0A%0A  
     subm
@@ -947,24 +947,26 @@
 n.click();%0A%0A
+  
     element(
@@ -1031,24 +1031,26 @@
 lue)%7B%0A      
+ 
+ 
 console.log(
@@ -1057,24 +1057,26 @@
 value);%0A    
+  
 %7D);%0A%0A    ret
@@ -1064,32 +1064,34 @@
 %0A      %7D);%0A%0A    
+ 
+ 
 return browser.d
@@ -1110,24 +1110,26 @@
 unction() %7B%0A
+  
       return
@@ -1181,32 +1181,34 @@
 (url) %7B%0A        
+ 
+ 
 console.log(url)
@@ -1205,24 +1205,26 @@
 e.log(url);%0A
+  
         retu
@@ -1258,20 +1258,24 @@
 ;%0A      
+  
 %7D);%0A
+  
     %7D, 1
@@ -1280,16 +1280,32 @@
  10000);
+%0A%0A      %0A    %7D);
 %0A  %7D%0A%7D;%0A

use closure