5 seconds to load pages that have javascript routing enabled

42 views
Skip to first unread message

Giorgio Bozio

unread,
Nov 12, 2013, 12:17:51 PM11/12/13
to zomb...@googlegroups.com
Hi,

I'm trying to do functional tests on a SPA.

The first (very simple) test works, but it takes 5 seconds to run. As I understand that happens because the javascript fires a routing lib that makes zombies wait even if the page actually loaded completly. It then times out after 5 seconds.

The lib I'm using is pathjs https://github.com/mtrpcic/pathjs

I don't think the problem is tied to the particular lib but to all libs that listen to the browser history.
Am I right?

Is there any workaround? I was really interested in having tests run as fast as possible.

Thanks,

Giorgio Bozio

Giorgio Bozio

unread,
Nov 12, 2013, 7:20:22 PM11/12/13
to zomb...@googlegroups.com
It goes on timeout because the library on the page fires a setInterval to pull location info, instead of listening to the "hashchange" event. This is because it doesn't find "onhashchange" on the window object. So this means the problem would be solved if window had a "onhashchange" member that would be called on "hashchange".
Does it make sense?
Reply all
Reply to author
Forward
0 new messages