Get help with testing, discuss unit testing strategies etc.


Post by brunotavares »

Hello everyone. So I'm trying to load the Ext Feed Viewer example, so I can run some test, check if everything is working perfect. Just a scenario of what I would do with Siesta while testing customer applications.
//index.js
var Harness = Siesta.Harness.Browser.ExtJS;

Harness.configure({
    title: 'Feed Viewer integration test',
    transparentEx: true,
    preload: [
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/resources/css/ext-all.css",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/Feed-Viewer.css",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/ext-all-debug.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedPost.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedDetail.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedGrid.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedInfo.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedPanel.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedViewer.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/feed-viewer/viewer/FeedWindow.js",
        "https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/ux/PreviewPlugin.js"
    ]
});

Harness.start(
    'lateral_menu.t.js'
);
//lateral_menu.t.js
StartTest(function (t) {
    
    Ext.Loader.setPath('Ext.ux', 'https://localhost/~brunotavares/sencha/ext-4.0.7-gpl/examples/ux');
    new FeedViewer.App();
    
    t.diag('todo');
});
So everything is working like a charm, the example is being rendered, but fetching data is not possible. My test stuff is in one website, and my application being tested is in another URL. So I'm receiving 404:

"NetworkError: 404 Not Found - https://localhost/~brunotavares/sencha/s ... 0&limit=25"

I'm trying to figure it out any other examples, but all of them just have mock data, or doesn't simulate the real environment of an application. Maybe I'm getting it all wrong as well. What you think?

Post by nickolay »

Hello,

Test pages are subject to the same origin policy as "usual" pages. The best approach is to run the test suite from the same domain as the application itself. Or you can configure a proxy (I can post a sample apache config if you want).

Post Reply