From 0f4521e3de9d92409ef3e87c86a24a055e0a85f3 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 13 Oct 2015 16:29:41 +0200 Subject: [PATCH] Preparing for local demo --- server.js | 3 ++- utils/load/load.js | 12 +++++++++--- utils/load/load.sh | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index b10ed1d..082f7a3 100644 --- a/server.js +++ b/server.js @@ -2,6 +2,7 @@ var http = require('http'); var express = require('express'); var jade = require('jade'); var pg = require('pg'); +var ip = require('ip'); var favicon = require('serve-favicon'); @@ -104,7 +105,7 @@ app.use(function(req, res) { var serverPort, serverIpAddress; if ( isDev ) { serverPort = 4000; - serverIpAddress = 'localhost'; + serverIpAddress = ip.address(); } else { // Openhift conf serverPort = process.env.OPENSHIFT_NODEJS_PORT || 8080; diff --git a/utils/load/load.js b/utils/load/load.js index 9ab608a..e586cb0 100644 --- a/utils/load/load.js +++ b/utils/load/load.js @@ -44,9 +44,15 @@ function addLevel(i) { // }, true); this.thenOpen(baseUrl + 'prototype/tutorial'); - this.thenOpen(baseUrl + 'prototype/play'); - this.thenOpen(baseUrl + 'prototype/play'); - this.thenOpen(baseUrl + 'prototype/play'); + this.wait(1000, function() { + this.thenOpen(baseUrl + 'prototype/play'); + this.wait(1000, function() { + this.thenOpen(baseUrl + 'prototype/play'); + this.wait(1000, function() { + this.thenOpen(baseUrl + 'prototype/play'); + }); + }); + }); this.thenOpen(baseUrl + 'logout'); diff --git a/utils/load/load.sh b/utils/load/load.sh index 0f52537..eb0566a 100755 --- a/utils/load/load.sh +++ b/utils/load/load.sh @@ -1,5 +1,5 @@ #!/usr/bin/bash rm -f cookies* -for i in `seq 1 8`; do +for i in `seq 1 30`; do casperjs load.js --cookies-file=cookies"$i".txt& done