geoext / geoext2

GeoExt 2 — JavaScript Toolkit for Rich Web Mapping Applications
http://geoext.github.io/geoext2/
Other
142 stars 106 forks source link

Support `--engine=slimerjs` when headless testing (Gecko) #286

Open marcjansen opened 10 years ago

marcjansen commented 10 years ago

It'd be great if we could test gecko headlessly. SlimerJS integrates well with CasperJS, so we should see whether we can use it.

bentrm commented 10 years ago

As running the tests via SlimerJS is easy, there seems to be a problem with Ext.Loader.syncRequire classes ultimately failing when calling Ext.create. Seems it is loaded asynchronously anyway.

The following throws an error run with SlimerJS:

Ext.Loader.syncRequire([
    'GeoExt.data.LayerModel',
    'GeoExt.data.LayerStore',
    'GeoExt.panel.Map',
    'GeoExt.Action'
    ], function() {
        console.log(GeoExt.Action);
    }
);

GeoExt.Action should be available in the callback as it is when run via PhantomJS.

marcjansen commented 10 years ago

Good findings. Any chance we can work around this by monkey patching syncRequire in the testsuite? Alternatively we could include all GeoExt sourcefiles in plain <script> tags.

bentrm commented 10 years ago

I didn't come up with a quick and simple solution. It kind of feels like a problem with ExtJS or SlimerJS, too. Not sure which one though. As the tests work manually in the Firefox browser, I assume this to be a problem with the latter. In the docs they discribe the different handling of openURL() calls to PhantomJS, maybe thats a hint?

marcjansen commented 10 years ago

I think that may be the issue. A simple timeout beforer actually conuing after the page opened may help. This all feels ugly, though.

bentrm commented 9 years ago

The problem seems to be that the headless tests are run via file:// protocol. This works with PhantomJS but not SlimerJS. I made some changes in #294.