Get help with testing, discuss unit testing strategies etc.


Post by AaronTovo »

I feel like I'm missing something very basic here :?

I'm running the phantomjs script that comes with siesta-trial and I get a timeout error.
E:\VitalDev\JavaCommonHg\vitrea-home\src\main\webapp\siesta-test\lib\siesta-1.0.8-trial\bin>.\phantomjs https://localhost:8770/vitrea-home/siesta --filter "sanity"
Launching PhantomJS at https://localhost:8770/vitrea-home/siest ... ter=sanity
TIMEOUT: Exit after 3 minutes of inactivity
I get the same error without the --filter option.

What am I missing here?

Post by jakub »

What test file are you running it against ?
JavaScript/Angular/ExtJS consulting - kuba@virtualdesign.pl

Post by AaronTovo »

010_sanity.t.js looks like
StartTest(function(t) {
    "use strict";

    t.diag("Sanity Test, loading classes on demand and verifying they were indeed loaded.");

    t.ok(Ext, 'ExtJS is here');
    t.ok(VI, 'VI namespace is here');
    t.ok(TR, 'TR strings are here');

    t.chain(
        function (next) { t.requireOk('StudySearch.model.Archive', next); },
        function (next) { t.requireOk('StudySearch.store.Archives', next); },
        function (next) { t.requireOk('StudySearch.view.ArchivesList', next); },
        function (next) { t.requireOk('StudySearch.controller.Filter', next); },
        function () { t.done(); }// Optional, marks the correct exit point from the test
    );
});
It runs just fine in the browser. Mats suggested it might be a firewall/anti-virus software issue. Maybe I need to add authentication - I tried adding the phantomjs parameter --settings {username: 'admin', password: 'MyPassword'} but that didn't seem to change anything.

I tried running
.\phantomjs https://www.google.com
and I get the same 3 minute timeout.

Post by mats »

Hmm, hard to debug these issues... Are you on Windows? Check Event Log for suspicious blocked activity or failures?

Post by AaronTovo »

Thank you for that suggestion. I didn't see anything in the event viewer. But it seems that just entering the event viewer causes an authentication failure "Informational" log entry.

I'm not experienced at looking at windows Event Viewer logs so I might be missing something.
Last edited by AaronTovo on Wed Jun 13, 2012 8:27 pm, edited 1 time in total.

Post by AaronTovo »

One obvious error in my attempt was adding the --settings parameter to the command line. These settings are intended for the phantom.webPage object. I didn't read the documentation closely enough and it looks like I can't pass those values in from the command line.

Instead I tried to add them directly to the phantomjs-launcher.js script as follows:
var page = new WebPage({
    settings : {
        localToRemoteUrlAccessEnabled   : true,
        username: 'admin', 
        password: 'MyPassword'
    }
})
This fails in the same manor.

Post by AaronTovo »

I've also tried this on localhost:80 which does not require authentication and that yields the same error. So I doubt my problem is related to authentication.

Post by AaronTovo »

Or maybe it is authentication... there are no siesta tests set up for localhost:80 so the timeout might be legitimate in that case.

I looked at my http traffic with fiddler2 and I see that running
.\lib\siesta-1.0.8-trial\bin\phantomjs https://localhost:8770/vitrea-home/siesta --verbose
brings up the login page and it's probably sitting there doing nothing. So I need a way for phantomjs to login...

Post by mats »

Could you try asking in the phantomjs group? Www.phantomjs.org

Post by AaronTovo »

I tried to run phantomjs on the bryntum example code:
>.\lib\siesta-1.0.8-trial\bin\phantomjs https://bryntum.com/products/siesta/late ... index.html --verbose --filter "sanity"
and phantomjs crashed with a message from Windows7 saying that it was looking for a solution to the problem (I usually take this as a veiled threat and hit the cancel button ;) )

Post Reply