3d-interface/utils/load/load.js

69 lines
1.4 KiB
JavaScript
Raw Normal View History

2015-10-06 16:58:04 +02:00
var baseUrl = 'http://localhost:4000/';
// var baseUrl = 'http://3dinterface.no-ip.org/';
2015-09-29 09:20:07 +02:00
function makeId()
{
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for( var i=0; i < 5; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
}
var fs = require('fs');
var casper = require('casper').create({
stepTimeout: 100000,
waitTimeout: 100000
});
2015-10-05 10:11:59 +02:00
var limit = 1000;
2015-09-29 09:20:07 +02:00
casper.start(baseUrl);
2015-10-06 16:58:04 +02:00
function addLevel(i) {
2015-10-06 16:58:04 +02:00
casper.thenOpen(baseUrl + 'user-study', function() {
2015-10-06 16:58:04 +02:00
console.log(i);
2015-10-06 16:58:04 +02:00
this.getHTML();
2015-10-06 16:58:04 +02:00
// this.waitForSelector('form#form', function() {
2015-10-06 16:58:04 +02:00
this.fillSelectors(
'form#form', {
'#inputId': makeId(),
'#sel1': '-15',
'#sel2': '3'
}, true
);
2015-10-06 16:58:04 +02:00
// }, true);
2015-10-06 16:58:04 +02:00
this.thenOpen(baseUrl + 'prototype/tutorial');
2015-10-13 16:29:41 +02:00
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');
});
});
});
2015-10-06 16:58:04 +02:00
this.thenOpen(baseUrl + 'logout');
2015-10-06 16:58:04 +02:00
});
}
for (var i = 0; i < limit; i++) {
2015-10-06 16:58:04 +02:00
addLevel(i);
}
casper.run();