-
Notifications
You must be signed in to change notification settings - Fork 0
/
performancetest.js
34 lines (26 loc) · 1.01 KB
/
performancetest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* Created by evangelineireland on 10/27/14.
*/
var loginButton='html=sc-button-label:contains("Login as guest")'
var page = require('webpage').create(),
url = 'http://localhost:4020/dg?moreGames=[{%22name%22:%22PerformanceHarness%22,%22dimensions%22:{%22width%22:550,%22height%22:500},%22url%22:%22http://concord-consortium.github.io/codap-data-interactives/PerformanceHarness/PerformanceHarness.html%22}]';
//console.log('The default user agent is '+page.settings.userAgent);
page.settings.userAgent = 'SpecialAgent';
page.onConsoleMessage = function(msg) {
console.log("Login button ID is: " + msg);
};
page.open(url, function (status){
// console.log(status, url);
if (status !== 'success'){
console.log('Unable to open page');
phantom.exit();
} else {
/* var selection = page.evaluate(function () {
return document.getElementById('loginButton');
console.log(selection);*/
page.evaluate(function(){
console.log(this.getPath('loginButton'))
});
phantom.exit();
}
})