var exec = require("sync-exec");
var fs = require("fs");
var ini = require("ini");

exports.config = {
    getPageTimeout: 30000,
    directConnect: true,
    suites: {
        // FIXME: mercator tests fail on travis
        //current: "../src/current/current/tests/acceptance/*Spec.js",
        core: "../src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/*Spec.js"
    },
    baseUrl: "http://localhost:9090",
    beforeLaunch: function() {
        exec("bin/supervisord");
        exec("bin/supervisorctl restart  adhocracy_test:");
        exec("bin/ad_fixtures -a etc/test.ini ");
        exec("src/current/current/tests/acceptance/setup_tests.sh");
    },
    afterLaunch: function() {
        exec("bin/supervisorctl stop adhocracy_test:");
        exec("rm -rf var/db/test/Data.fs* var/db/test/blobs/* var/mail/new/* ");
    },
    onPrepare: function() {
        var getMailQueuePath = function() {
            var testConf = ini.parse(fs.readFileSync("etc/test.ini", "utf-8"));
            return testConf["app:main"]["mail.queue_path"]
                   .replace("%(here)s", process.cwd() + "/etc");
        };

        browser.params.mail = {
            queue_path: getMailQueuePath()
        }
    },
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000,
        isVerbose: true,
        includeStackTrace: true
    }
}

@@ -1209,16 +1209,398 @@
        %7D
+%0A%0A        // https://stackoverflow.com/questions/26584451/%0A        // Disable animations so e2e tests run more quickly%0A        var disableNgAnimate = function() %7B%0A          angular.module('disableNgAnimate', %5B%5D).run(%5B'$animate', function($animate) %7B%0A            $animate.enabled(false);%0A          %7D%5D);%0A        %7D;%0A%0A        browser.addMockModule('disableNgAnimate', disableNgAnimate);
 %0A    %7D,%0A

Disable angular animations in acceptance tests